以下代码段在nightly-2017-08-11-x86_64-unknown-linux-gnu
之前工作正常
#![allow(unknown_lints)]
#![allow(clippy)]
但现在它报告了一个警告:
warning: unknown lint: `clippy`
--> /home/poc/src/../a/b.rs:2:10
|
2 | #![allow(clippy)]
| ^^^^^^
|
= note: #[warn(unknown_lints)] on by default
重现步骤:
这是预期的行为还是错误? 谢谢!
cc @alexcrichton -- 可能与新的 lint 实现有关
是的,这是由https://github.com/rust-lang/rust/pull/43522引起的这行代码上。 检查allow_lints
是否在范围内不是检查当前正在检查的属性集。
例如,这不会警告:
#![allow(unknown_lints)]
#[allow(clippy)]
fn main() {}
但这警告:
#![allow(unknown_lints)]
#![allow(clippy)]
fn main() {}
(正如你所注意到的)
解决方法是将局部变量specs
考虑在内,该变量已收集到该点的 lint 属性集。
我已经在https://github.com/rust-lang/rust/pull/43841为此打开了一个 PR
最有用的评论
我已经在https://github.com/rust-lang/rust/pull/43841为此打开了一个 PR