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:
Yuki Okushi 2022-05-11 13:16:32 +09:00 committed by GitHub
commit 7bf795bc65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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());
}