New force_warn diagnostic builder and ensure cap-lints doesn't reduce force_warn level
This commit is contained in:
parent
a3d6905053
commit
33cc7b1fe2
7 changed files with 67 additions and 15 deletions
15
src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs
Normal file
15
src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// compile-flags: --cap-lints warn --force-warns rust-2021-compatibility -Zunstable-options
|
||||
// check-pass
|
||||
#![allow(ellipsis_inclusive_range_patterns)]
|
||||
|
||||
pub fn f() -> bool {
|
||||
let x = 123;
|
||||
match x {
|
||||
0...100 => true,
|
||||
//~^ WARN range patterns are deprecated
|
||||
//~| WARN this is accepted in the current edition
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
12
src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr
Normal file
12
src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
warning: `...` range patterns are deprecated
|
||||
--> $DIR/force-warn-cap-lints-warn.rs:8:10
|
||||
|
|
||||
LL | 0...100 => true,
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
|
||||
= note: `--force-warns ellipsis-inclusive-range-patterns` implied by `--force-warns rust-2021-compatibility`
|
||||
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
||||
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
warning: trait objects without an explicit `dyn` are deprecated
|
||||
--> $DIR/force-warns-cap-lints.rs:6:25
|
||||
--> $DIR/force-warns-cap-lints-allow.rs:6:25
|
||||
|
|
||||
LL | pub fn function(_x: Box<SomeTrait>) {}
|
||||
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
|
||||
Loading…
Add table
Add a link
Reference in a new issue