Skip to content

Commit

Permalink
extend group-forbid-always-trumps-cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 27, 2024
1 parent dff3e7c commit 37d3c61
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.allow-first-lint.stderr
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.allow-first-mix1.stderr
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.allow-first-mix2.stderr
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.forbid-first-group.stderr
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.forbid-first-lint.stderr
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix1.stderr
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix2.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 17 additions & 0 deletions tests/ui/lint/forbid-always-trumps-cli.rs
Original file line number Diff line number Diff line change
@@ -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`
}
6 changes: 0 additions & 6 deletions tests/ui/lint/group-forbid-always-trumps-cli.rs

This file was deleted.

0 comments on commit 37d3c61

Please sign in to comment.