extend group-forbid-always-trumps-cli test
This commit is contained in:
parent
dff3e7ccd4
commit
37d3c6186e
10 changed files with 88 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/group-forbid-always-trumps-cli.rs:4:9
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
|
@ -0,0 +1,10 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||
|
|
||||
= note: requested on the command line with `-F unused-variables`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||
|
|
||||
= note: `-F unused-variables` implied by `-F unused`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||
|
|
||||
= note: requested on the command line with `-F unused-variables`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||
|
|
||||
= note: `-F unused-variables` implied by `-F unused`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||
|
|
||||
= note: requested on the command line with `-F unused-variables`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||
|
|
||||
= note: `-F unused-variables` implied by `-F unused`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
error: unused variable: `x`
|
||||
--> $DIR/forbid-always-trumps-cli.rs:15:9
|
||||
|
|
||||
LL | let x = 1;
|
||||
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||
|
|
||||
= note: requested on the command line with `-F unused-variables`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
17
tests/ui/lint/forbid-always-trumps-cli.rs
Normal file
17
tests/ui/lint/forbid-always-trumps-cli.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
//! Ensure that "forbid" always trumps" allow" in CLI arguments, no matter the order
|
||||
//! and no matter whether it is used with a lint group vs an individual lint.
|
||||
// ignore-tidy-linelength
|
||||
//@ revisions: forbid-first-group allow-first-group forbid-first-lint allow-first-lint forbid-first-mix1 allow-first-mix1 forbid-first-mix2 allow-first-mix2
|
||||
//@[forbid-first-group] compile-flags: -F unused -A unused
|
||||
//@[allow-first-group] compile-flags: -A unused -F unused
|
||||
//@[forbid-first-lint] compile-flags: -F unused_variables -A unused_variables
|
||||
//@[allow-first-lint] compile-flags: -A unused_variables -F unused_variables
|
||||
//@[forbid-first-mix1] compile-flags: -F unused -A unused_variables
|
||||
//@[allow-first-mix1] compile-flags: -A unused_variables -F unused
|
||||
//@[forbid-first-mix2] compile-flags: -F unused_variables -A unused
|
||||
//@[allow-first-mix2] compile-flags: -A unused -F unused_variables
|
||||
|
||||
fn main() {
|
||||
let x = 1;
|
||||
//~^ ERROR unused variable: `x`
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
//@ compile-flags: -F unused -A unused
|
||||
|
||||
fn main() {
|
||||
let x = 1;
|
||||
//~^ ERROR unused variable: `x`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue