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