Skip to content

Commit

Permalink
Added a new test demonstrating the issue requiring revert
Browse files Browse the repository at this point in the history
Note, the `Debug` impl is required.
  • Loading branch information
richkadel committed Jun 4, 2021
1 parent 2a6dd25 commit 1384200
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/ui/deprecation/deprecation-lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> },
}

#[allow(deprecated)]
impl DeprecatedDebugEnum {
fn new() -> Self {
DeprecatedDebugEnum::Variant1 { value: None }
}
}

#[allow(deprecated)]
pub fn allow_dep() {
let _ = DeprecatedDebugEnum::new();
}
}

fn main() {}

0 comments on commit 1384200

Please sign in to comment.