blob: 0c1146339c45fe7cd8c0ba4b5df4eb4f34753515 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#![feature(if_let_guard)]
#![allow(unused, non_snake_case)]
enum E {
A,
}
#[allow(bindings_with_variant_name, irrefutable_let_patterns)]
fn foo() {
match E::A {
#[deny(bindings_with_variant_name)]
A => {}
//~^ ERROR pattern binding `A` is named the same as one of the variants of the type `E`
}
match &E::A {
#[deny(irrefutable_let_patterns)]
a if let b = a => {}
//~^ ERROR irrefutable `if let` guard pattern
_ => {}
}
}
fn main() { }
|