fix bugs in inline/force_inline and diagnostics of all attr parsers

This commit is contained in:
Jana Dönszelmann
2025-03-04 14:17:06 +01:00
parent 566f691374
commit ee976bbbca
34 changed files with 600 additions and 270 deletions

View File

@@ -282,11 +282,15 @@ fn emit_malformed_attribute(
name: Symbol,
template: AttributeTemplate,
) {
// attrs with new parsers are locally validated so excluded here
if matches!(name, sym::inline | sym::rustc_force_inline) {
return;
}
// Some of previously accepted forms were used in practice,
// report them as warnings for now.
let should_warn = |name| {
matches!(name, sym::doc | sym::ignore | sym::inline | sym::link | sym::test | sym::bench)
};
let should_warn =
|name| matches!(name, sym::doc | sym::ignore | sym::link | sym::test | sym::bench);
let error_msg = format!("malformed `{name}` attribute input");
let mut suggestions = vec![];