Make more doc attribute parsing error into future warnings

This commit is contained in:
Guillaume Gomez 2026-02-01 00:58:51 +01:00
parent 7dbbab63e2
commit 6d713489d0
9 changed files with 80 additions and 19 deletions

View file

@ -558,6 +558,10 @@ lint_macro_expr_fragment_specifier_2024_migration =
lint_malformed_attribute = malformed lint attribute input
lint_malformed_doc =
malformed `doc` attribute input
.warn = {-lint_previously_accepted}
lint_map_unit_fn = `Iterator::map` call that discard the iterator's values
.note = `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated
.function_label = this function returns `()`, which is likely not what you wanted

View file

@ -428,5 +428,7 @@ pub fn decorate_attribute_lint(
sugg: suggested.map(|s| lints::UnknownCrateTypesSuggestion { span, snippet: s }),
}
.decorate_lint(diag),
&AttributeLintKind::MalformedDoc => lints::MalformedDoc.decorate_lint(diag),
}
}

View file

@ -3185,6 +3185,11 @@ pub(crate) struct UnusedDuplicate {
pub warning: bool,
}
#[derive(LintDiagnostic)]
#[diag(lint_malformed_doc)]
#[warning]
pub(crate) struct MalformedDoc;
#[derive(LintDiagnostic)]
#[diag(lint_unsafe_attr_outside_unsafe)]
pub(crate) struct UnsafeAttrOutsideUnsafeLint {