From 1384200b1c2f69808dd16df1e967ef4e8a31dfdd Mon Sep 17 00:00:00 2001 From: Rich Kadel Date: Fri, 4 Jun 2021 15:14:32 -0700 Subject: [PATCH] Added a new test demonstrating the issue requiring revert Note, the `Debug` impl is required. --- src/test/ui/deprecation/deprecation-lint.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/ui/deprecation/deprecation-lint.rs b/src/test/ui/deprecation/deprecation-lint.rs index b6c791c15fd20..35e42a6857f32 100644 --- a/src/test/ui/deprecation/deprecation-lint.rs +++ b/src/test/ui/deprecation/deprecation-lint.rs @@ -430,6 +430,24 @@ mod this_crate2 { // the patterns are all fine: (..) = x; } + + #[derive(Debug)] + #[deprecated(note = "Use something else instead")] + enum DeprecatedDebugEnum { + Variant1 { value: Option }, + } + + #[allow(deprecated)] + impl DeprecatedDebugEnum { + fn new() -> Self { + DeprecatedDebugEnum::Variant1 { value: None } + } + } + + #[allow(deprecated)] + pub fn allow_dep() { + let _ = DeprecatedDebugEnum::new(); + } } fn main() {}