Skip to content

Commit e950659

Browse files
committed
Make future-compat lint match_of_unit_variant_via_paren_dotdot deny by default
1 parent 8e2a577 commit e950659

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Diff for: src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ declare_lint! {
132132

133133
declare_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

Diff for: src/test/compile-fail/empty-struct-unit-pat.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
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
}

Diff for: src/test/run-pass/issue-pr29383.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
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+
1113
enum E {
1214
A,
1315
B,

0 commit comments

Comments
 (0)