Rollup merge of #96896 - JohnTitor:issue-68408, r=compiler-errors
Add regression test for #68408 Closes https://github.com/rust-lang/rust/issues/68408
This commit is contained in:
commit
7bf795bc65
22
src/test/ui/lint/dead-code/issue-68408-false-positive.rs
Normal file
22
src/test/ui/lint/dead-code/issue-68408-false-positive.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// check-pass
|
||||
|
||||
// Make sure we don't have any false positives here.
|
||||
|
||||
#![deny(dead_code)]
|
||||
|
||||
enum X {
|
||||
A { _a: () },
|
||||
B { _b: () },
|
||||
}
|
||||
impl X {
|
||||
fn a() -> X {
|
||||
X::A { _a: () }
|
||||
}
|
||||
fn b() -> Self {
|
||||
Self::B { _b: () }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let (_, _) = (X::a(), X::b());
|
||||
}
|
Loading…
Reference in New Issue
Block a user