Add regression test for #68408
This commit is contained in:
parent
2226f19f70
commit
c7d5e40f7e
1 changed files with 22 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue