The following snippet works fine before nightly-2017-08-11-x86_64-unknown-linux-gnu
#![allow(unknown_lints)]
#![allow(clippy)]
but now it reports a warning:
warning: unknown lint: `clippy`
--> /home/poc/src/../a/b.rs:2:10
|
2 | #![allow(clippy)]
| ^^^^^^
|
= note: #[warn(unknown_lints)] on by default
Steps to reproduce:
Is this an expected behavior, or a bug? Thank you!
cc @alexcrichton -- probably related to the new lint implementation
Yes this was caused by https://github.com/rust-lang/rust/pull/43522. The bug is on this line of code. The check for whether allow_lints
is in scope is not checking the current set of attributes being linted.
For example this does not warn:
#![allow(unknown_lints)]
#[allow(clippy)]
fn main() {}
but this warns:
#![allow(unknown_lints)]
#![allow(clippy)]
fn main() {}
(as you've noticed)
The fix is to just take the local variable specs
into account which has the up-to-that-point set of lint attributes collected.
I've opened a PR for this at https://github.com/rust-lang/rust/pull/43841
Most helpful comment
I've opened a PR for this at https://github.com/rust-lang/rust/pull/43841