Skip to content

Commit

Permalink
Add test of deprecated type in From impl
Browse files Browse the repository at this point in the history
    error: use of deprecated struct `test_deprecated::DeprecatedStruct`
      --> tests/test_lints.rs:73:13
       |
    73 |             DeprecatedStruct,
       |             ^^^^^^^^^^^^^^^^
       |
    note: the lint level is defined here
      --> tests/test_lints.rs:39:13
       |
    39 |     #![deny(deprecated)]
       |             ^^^^^^^^^^
  • Loading branch information
dtolnay committed Dec 8, 2024
1 parent f1f159d commit caf585c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ fn test_deprecated() {
Variant,
}

#[derive(Error, Debug)]
pub enum DeprecatedFrom {
#[error(transparent)]
Variant(
#[from]
#[allow(deprecated)]
DeprecatedStruct,
),
}

#[allow(deprecated)]
let _: DeprecatedStruct;
#[allow(deprecated)]
Expand Down

0 comments on commit caf585c

Please sign in to comment.