You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;fnmain(){}
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.
I took a shot at this and made a PR. Now your example code for deny(warnings) shows the following:
test_deny.rs:2:5: 2:16 error: unused import
test_deny.rs:2 use std::thread;
^~~~~~~~~~~
test_deny.rs:1:9: 1:17 note: lint level defined here
test_deny.rs:1 #![deny(warnings)]
^~~~~~~~
error: aborting due to previous error
Normally, an unused import:
Produces this compiler output:
Saying the 'unused_imports' lint is 'on by default'.
If you explicitly set that lint to deny:
Then the error indicates where the lint was set to 'deny':
If you instead change warnings to errors:
Then you get this 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.
cc @nikomatsakis
The text was updated successfully, but these errors were encountered: