2019-04-05 07:22:36 +02:00
|
|
|
// run-pass
|
|
|
|
|
2015-12-14 14:29:20 +01:00
|
|
|
#[allow(dead_code)]
|
2019-02-06 07:45:57 +01:00
|
|
|
|
|
|
|
/// Test for https://github.com/rust-lang/rust-clippy/issues/478
|
|
|
|
|
2015-12-14 14:29:20 +01:00
|
|
|
enum Baz {
|
2016-02-01 12:51:33 +01:00
|
|
|
One,
|
|
|
|
Two,
|
2015-12-14 14:29:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Test {
|
|
|
|
t: Option<usize>,
|
|
|
|
b: Baz,
|
|
|
|
}
|
|
|
|
|
2018-12-09 23:26:16 +01:00
|
|
|
fn main() {}
|
2018-05-11 13:20:39 +02:00
|
|
|
|
|
|
|
pub fn foo() {
|
2015-12-14 14:29:20 +01:00
|
|
|
use Baz::*;
|
2017-04-12 11:06:32 +02:00
|
|
|
let x = Test { t: Some(0), b: One };
|
2015-12-14 14:29:20 +01:00
|
|
|
|
|
|
|
match x {
|
2016-02-01 12:51:33 +01:00
|
|
|
Test { t: Some(_), b: One } => unreachable!(),
|
2018-12-09 23:26:16 +01:00
|
|
|
Test { t: Some(42), b: Two } => unreachable!(),
|
2015-12-14 14:29:20 +01:00
|
|
|
Test { t: None, .. } => unreachable!(),
|
|
|
|
Test { .. } => unreachable!(),
|
|
|
|
}
|
|
|
|
}
|