File tree 3 files changed +12
-12
lines changed
3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ declare_lint! {
132
132
133
133
declare_lint ! {
134
134
pub MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT ,
135
- Warn ,
135
+ Deny ,
136
136
"unit struct or enum variant erroneously allowed to match via path::ident(..)"
137
137
}
138
138
Original file line number Diff line number Diff line change 12
12
13
13
// aux-build:empty-struct.rs
14
14
15
- #![ feature( rustc_attrs) ]
16
15
// remove prior feature after warning cycle and promoting warnings to errors
17
16
#![ feature( braced_empty_structs) ]
18
17
@@ -26,8 +25,7 @@ enum E {
26
25
}
27
26
28
27
// remove attribute after warning cycle and promoting warnings to errors
29
- #[ rustc_error]
30
- fn main ( ) { //~ ERROR: compilation successful
28
+ fn main ( ) {
31
29
let e2 = Empty2 ;
32
30
let e4 = E :: Empty4 ;
33
31
let xe2 = XEmpty2 ;
@@ -41,12 +39,12 @@ fn main() { //~ ERROR: compilation successful
41
39
// XEmpty2() => () // ERROR `XEmpty2` does not name a tuple variant or a tuple struct
42
40
// }
43
41
match e2 {
44
- Empty2 ( ..) => ( ) //~ WARN `Empty2` does not name a tuple variant or a tuple struct
45
- //~^ WARN hard error
42
+ Empty2 ( ..) => ( ) //~ ERROR `Empty2` does not name a tuple variant or a tuple struct
43
+ //~^ ERROR hard error
46
44
}
47
45
match xe2 {
48
- XEmpty2 ( ..) => ( ) //~ WARN `XEmpty2` does not name a tuple variant or a tuple struct
49
- //~^ WARN hard error
46
+ XEmpty2 ( ..) => ( ) //~ ERROR `XEmpty2` does not name a tuple variant or a tuple struct
47
+ //~^ ERROR hard error
50
48
}
51
49
// Rejected by parser as yet
52
50
// match e4 {
@@ -57,12 +55,12 @@ fn main() { //~ ERROR: compilation successful
57
55
// _ => {},
58
56
// }
59
57
match e4 {
60
- E :: Empty4 ( ..) => ( ) //~ WARN `E::Empty4` does not name a tuple variant or a tuple struct
61
- //~^ WARN hard error
58
+ E :: Empty4 ( ..) => ( ) //~ ERROR `E::Empty4` does not name a tuple variant or a tuple struct
59
+ //~^ ERROR hard error
62
60
}
63
61
match xe4 {
64
- XE :: XEmpty4 ( ..) => ( ) , //~ WARN `XE::XEmpty4` does not name a tuple variant or a tuple
65
- //~^ WARN hard error
62
+ XE :: XEmpty4 ( ..) => ( ) , //~ ERROR `XE::XEmpty4` does not name a tuple variant or a tuple
63
+ //~^ ERROR hard error
66
64
_ => { } ,
67
65
}
68
66
}
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ #![ allow( match_of_unit_variant_via_paren_dotdot) ]
12
+
11
13
enum E {
12
14
A ,
13
15
B ,
You can’t perform that action at this time.
0 commit comments