diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2021-03-28 00:25:07 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-04-05 04:13:36 -0400 |
| commit | d19083d9da626080cb4617caa9be8f234a9a80fa (patch) | |
| tree | 26996073e09daa2e37c75d7be9e655d3dd1f6add /compiler | |
| parent | ef4e5b9ecb10480cd87bd7875e4169ca5edeb0fd (diff) | |
| download | rust-d19083d9da626080cb4617caa9be8f234a9a80fa.tar.gz rust-d19083d9da626080cb4617caa9be8f234a9a80fa.zip | |
Fix bug where rustc_lint would not apply renamed tool lints
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/src/levels.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 863023fa7b5..e0857ad1eb9 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -464,15 +464,16 @@ impl<'s> LintLevelsBuilder<'s> { // we don't warn about the name change. if let CheckLintNameResult::Warning(_, Some(new_name)) = lint_result { // Ignore any errors or warnings that happen because the new name is inaccurate - if let CheckLintNameResult::Ok(ids) = - store.check_lint_name(&new_name, tool_name) - { + // NOTE: `new_name` already includes the tool name, so we don't have to add it again. + if let CheckLintNameResult::Ok(ids) = store.check_lint_name(&new_name, None) { let src = LintLevelSource::Node(Symbol::intern(&new_name), li.span(), reason); for &id in ids { self.check_gated_lint(id, attr.span); self.insert_spec(&mut specs, id, (level, src)); } + } else { + panic!("renamed lint does not exist: {}", new_name); } } } |
