File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ declare_lint! {
132132
133133declare_lint ! {
134134 pub MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT ,
135- Warn ,
135+ Deny ,
136136 "unit struct or enum variant erroneously allowed to match via path::ident(..)"
137137}
138138
Original file line number Diff line number Diff line change 1212
1313// aux-build:empty-struct.rs
1414
15- #![ feature( rustc_attrs) ]
1615// remove prior feature after warning cycle and promoting warnings to errors
1716#![ feature( braced_empty_structs) ]
1817
@@ -26,8 +25,7 @@ enum E {
2625}
2726
2827// remove attribute after warning cycle and promoting warnings to errors
29- #[ rustc_error]
30- fn main ( ) { //~ ERROR: compilation successful
28+ fn main ( ) {
3129 let e2 = Empty2 ;
3230 let e4 = E :: Empty4 ;
3331 let xe2 = XEmpty2 ;
@@ -41,12 +39,12 @@ fn main() { //~ ERROR: compilation successful
4139 // XEmpty2() => () // ERROR `XEmpty2` does not name a tuple variant or a tuple struct
4240 // }
4341 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
4644 }
4745 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
5048 }
5149 // Rejected by parser as yet
5250 // match e4 {
@@ -57,12 +55,12 @@ fn main() { //~ ERROR: compilation successful
5755 // _ => {},
5856 // }
5957 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
6260 }
6361 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
6664 _ => { } ,
6765 }
6866}
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ #![ allow( match_of_unit_variant_via_paren_dotdot) ]
12+
1113enum E {
1214 A ,
1315 B ,
You can’t perform that action at this time.
0 commit comments