Add test of deprecated type in From impl

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)]
       |             ^^^^^^^^^^
This commit is contained in:
David Tolnay 2024-12-08 10:34:17 -08:00
parent f1f159d7e7
commit caf585c978
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -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)]