Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend group-forbid-always-trumps-cli test #133534

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:14: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:14: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:14: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:14: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:14: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:14: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:14: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:14: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.

Loading