diff --git a/tests/test_lints.rs b/tests/test_lints.rs index 6c39fba..b46a391 100644 --- a/tests/test_lints.rs +++ b/tests/test_lints.rs @@ -39,12 +39,37 @@ fn test_deprecated() { #![deny(deprecated)] #[derive(Error, Debug)] - pub enum MyError { + #[deprecated] + #[error("...")] + pub struct DeprecatedStruct; + + #[derive(Error, Debug)] + #[error("{message} {}", .message)] + pub struct DeprecatedStructField { + #[deprecated] + message: String, + } + + #[derive(Error, Debug)] + #[deprecated] + pub enum DeprecatedEnum { + #[error("...")] + Variant, + } + + #[derive(Error, Debug)] + pub enum DeprecatedVariant { #[deprecated] #[error("...")] - Deprecated, + Variant, } #[allow(deprecated)] - let _ = MyError::Deprecated; + let _: DeprecatedStruct; + #[allow(deprecated)] + let _: DeprecatedStructField; + #[allow(deprecated)] + let _ = DeprecatedEnum::Variant; + #[allow(deprecated)] + let _ = DeprecatedVariant::Variant; }