Do not point at #[allow(_)] as the reason for compat lint triggering

Fix #121009.
This commit is contained in:
Esteban Küber 2024-02-13 20:19:17 +00:00
parent eaff1af8fd
commit 24b52fd9df
8 changed files with 6 additions and 53 deletions

View file

@ -207,6 +207,11 @@ pub fn explain_lint_level_source(
err: &mut Diagnostic,
) {
let name = lint.name_lower();
if let Level::Allow = level {
// Do not point at `#[allow(compat_lint)]` as the reason for a compatibility lint
// triggering. (#121009)
return;
}
match src {
LintLevelSource::Default => {
err.note_once(format!("`#[{}({})]` on by default", level.as_str(), name));