Skip to content

Commit 1384200

Browse files
committed
Added a new test demonstrating the issue requiring revert
Note, the `Debug` impl is required.
1 parent 2a6dd25 commit 1384200

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/ui/deprecation/deprecation-lint.rs

+18
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,24 @@ mod this_crate2 {
430430
// the patterns are all fine:
431431
(..) = x;
432432
}
433+
434+
#[derive(Debug)]
435+
#[deprecated(note = "Use something else instead")]
436+
enum DeprecatedDebugEnum {
437+
Variant1 { value: Option<String> },
438+
}
439+
440+
#[allow(deprecated)]
441+
impl DeprecatedDebugEnum {
442+
fn new() -> Self {
443+
DeprecatedDebugEnum::Variant1 { value: None }
444+
}
445+
}
446+
447+
#[allow(deprecated)]
448+
pub fn allow_dep() {
449+
let _ = DeprecatedDebugEnum::new();
450+
}
433451
}
434452

435453
fn main() {}

0 commit comments

Comments
 (0)