-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
Normally, an unused import:
use std::thread;
fn main() { }
Produces this compiler output:
linttest.rs:4:5: 4:16 warning: unused import, #[warn(unused_imports)] on by default
linttest.rs:4 use std::thread;
Saying the 'unused_imports' lint is 'on by default'.
If you explicitly set that lint to deny:
#![deny(unused_imports)]
use std::thread;
fn main() { }
Then the error indicates where the lint was set to 'deny':
linttest.rs:4:5: 4:16 error: unused import
linttest.rs:4 use std::thread;
^~~~~~~~~~~
linttest.rs:1:9: 1:23 note: lint level defined here
linttest.rs:1 #![deny(unused_imports)]
^~~~~~~~~~~~~~
error: aborting due to previous error
If you instead change warnings to errors:
#![deny(warnings)]
use std::thread;
fn main() { }
Then you get this error:
linttest.rs:4:5: 4:16 error: unused import, #[deny(unused_imports)] on by default
linttest.rs:4 use std::thread;
^~~~~~~~~~~
error: aborting due to previous error
Which says 'deny(unused_imports)' is 'on by default'. That is not true. unused_imports is warn by default. This case should point to #[deny(warnings)]
as the source of the error.
Discovered while interpreting all the lint regressions in a recent crater report.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints