diff options
| author | Eric Holk <ericholk@microsoft.com> | 2021-06-25 14:28:03 -0700 |
|---|---|---|
| committer | Eric Holk <ericholk@microsoft.com> | 2021-07-06 15:49:47 -0700 |
| commit | 65b28a987bfce11c37634fff2be129ffc16096d5 (patch) | |
| tree | 51c1a423fc329487c62b66a6b6d4c000c1dcd368 /src | |
| parent | 6e0b554619a3bb7e75b3334e97f191af20ef5d76 (diff) | |
| download | rust-65b28a987bfce11c37634fff2be129ffc16096d5.tar.gz rust-65b28a987bfce11c37634fff2be129ffc16096d5.zip | |
Add ui test for command line lints with tool names
This adds a ui test to make sure rustc accepts lint arguments such as `-A clippy::foo` when clippy is disabled.
Diffstat (limited to 'src')
3 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/lint/command-line-register-lint-tool.rs b/src/test/ui/lint/command-line-register-lint-tool.rs new file mode 100644 index 00000000000..d6e95fd3ec4 --- /dev/null +++ b/src/test/ui/lint/command-line-register-lint-tool.rs @@ -0,0 +1,7 @@ +// compile-flags: -A known_tool::foo +// check-pass + +#![feature(register_tool)] +#![register_tool(known_tool)] + +fn main() {} diff --git a/src/test/ui/lint/command-line-register-unknown-lint-tool.rs b/src/test/ui/lint/command-line-register-unknown-lint-tool.rs new file mode 100644 index 00000000000..435e951c809 --- /dev/null +++ b/src/test/ui/lint/command-line-register-unknown-lint-tool.rs @@ -0,0 +1,4 @@ +// compile-flags: -A unknown_tool::foo +// check-fail + +fn main() {} diff --git a/src/test/ui/lint/command-line-register-unknown-lint-tool.stderr b/src/test/ui/lint/command-line-register-unknown-lint-tool.stderr new file mode 100644 index 00000000000..9e0177c47da --- /dev/null +++ b/src/test/ui/lint/command-line-register-unknown-lint-tool.stderr @@ -0,0 +1,11 @@ +error[E0602]: unknown lint: `unknown_tool::foo` + | + = note: requested on the command line with `-A unknown_tool::foo` + +error[E0602]: unknown lint: `unknown_tool::foo` + | + = note: requested on the command line with `-A unknown_tool::foo` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0602`. |
