Rustc does not parse tool name for lints controlled by the command line #86628
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Problem
This came up during the discussion of rust-lang/cargo#5034. Lints can be broken into rustc builtin lints, and lints supplied by a tool such as clippy. For clippy lints, they are prefixed by
clippy::
. The idea is that external lints are supposed to be ignored if the tool is not active. This works for lints controlled through attributes, such as#![allow(clippy::foo)]
.Unfortunately the same thing doesn't work when allowing the lint through the command line, doing
rustc -A clippy::foo
.Steps
rustc -A clippy::foo test.rs
Possible Solution(s)
The problem is at:
rust/compiler/rustc_lint/src/context.rs
Line 345 in 4733f32
There is a hard-coded
None
passed in as the tool name incheck_lint_name
.The text was updated successfully, but these errors were encountered: