Make future-compat lint match_of_unit_variant_via_paren_dotdot
deny by default
This commit is contained in:
parent
8e2a577804
commit
e9506594b4
3 changed files with 12 additions and 12 deletions
|
@ -132,7 +132,7 @@ declare_lint! {
|
||||||
|
|
||||||
declare_lint! {
|
declare_lint! {
|
||||||
pub MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT,
|
pub MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT,
|
||||||
Warn,
|
Deny,
|
||||||
"unit struct or enum variant erroneously allowed to match via path::ident(..)"
|
"unit struct or enum variant erroneously allowed to match via path::ident(..)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
// aux-build:empty-struct.rs
|
// aux-build:empty-struct.rs
|
||||||
|
|
||||||
#![feature(rustc_attrs)]
|
|
||||||
// remove prior feature after warning cycle and promoting warnings to errors
|
// remove prior feature after warning cycle and promoting warnings to errors
|
||||||
#![feature(braced_empty_structs)]
|
#![feature(braced_empty_structs)]
|
||||||
|
|
||||||
|
@ -26,8 +25,7 @@ enum E {
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove attribute after warning cycle and promoting warnings to errors
|
// remove attribute after warning cycle and promoting warnings to errors
|
||||||
#[rustc_error]
|
fn main() {
|
||||||
fn main() { //~ ERROR: compilation successful
|
|
||||||
let e2 = Empty2;
|
let e2 = Empty2;
|
||||||
let e4 = E::Empty4;
|
let e4 = E::Empty4;
|
||||||
let xe2 = XEmpty2;
|
let xe2 = XEmpty2;
|
||||||
|
@ -41,12 +39,12 @@ fn main() { //~ ERROR: compilation successful
|
||||||
// XEmpty2() => () // ERROR `XEmpty2` does not name a tuple variant or a tuple struct
|
// XEmpty2() => () // ERROR `XEmpty2` does not name a tuple variant or a tuple struct
|
||||||
// }
|
// }
|
||||||
match e2 {
|
match e2 {
|
||||||
Empty2(..) => () //~ WARN `Empty2` does not name a tuple variant or a tuple struct
|
Empty2(..) => () //~ ERROR `Empty2` does not name a tuple variant or a tuple struct
|
||||||
//~^ WARN hard error
|
//~^ ERROR hard error
|
||||||
}
|
}
|
||||||
match xe2 {
|
match xe2 {
|
||||||
XEmpty2(..) => () //~ WARN `XEmpty2` does not name a tuple variant or a tuple struct
|
XEmpty2(..) => () //~ ERROR `XEmpty2` does not name a tuple variant or a tuple struct
|
||||||
//~^ WARN hard error
|
//~^ ERROR hard error
|
||||||
}
|
}
|
||||||
// Rejected by parser as yet
|
// Rejected by parser as yet
|
||||||
// match e4 {
|
// match e4 {
|
||||||
|
@ -57,12 +55,12 @@ fn main() { //~ ERROR: compilation successful
|
||||||
// _ => {},
|
// _ => {},
|
||||||
// }
|
// }
|
||||||
match e4 {
|
match e4 {
|
||||||
E::Empty4(..) => () //~ WARN `E::Empty4` does not name a tuple variant or a tuple struct
|
E::Empty4(..) => () //~ ERROR `E::Empty4` does not name a tuple variant or a tuple struct
|
||||||
//~^ WARN hard error
|
//~^ ERROR hard error
|
||||||
}
|
}
|
||||||
match xe4 {
|
match xe4 {
|
||||||
XE::XEmpty4(..) => (), //~ WARN `XE::XEmpty4` does not name a tuple variant or a tuple
|
XE::XEmpty4(..) => (), //~ ERROR `XE::XEmpty4` does not name a tuple variant or a tuple
|
||||||
//~^ WARN hard error
|
//~^ ERROR hard error
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![allow(match_of_unit_variant_via_paren_dotdot)]
|
||||||
|
|
||||||
enum E {
|
enum E {
|
||||||
A,
|
A,
|
||||||
B,
|
B,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue