Files
rust/tests/ui/force-inlining
Nicholas Nethercote b982472b92 Make attribute template suggestions work at the level of attr items
Attribute templated mismatch suggestions come in two forms:
- for a normal attribute, something like `#[inline(always)]`;
- for an attribute embedded in `cfg_attr`, something like
  `inline(always)`.

This commit replaces the former with the latter, and removes the need
for the fragile span-based test for detecting embedded attributes in
`template_suggestions`, and also `AttributeParseError::attr_span`. It
takes advantage of the newly added (and accurate) `AttrItem::span`
field.

This change has a minor effect on error messages: when there are
multiple suggestions their order can change because the `#[`/`]` are
no longer included. This actually improves things, because e.g. if you
write the invalid `#[inline(please)]`, the simpler `#[inline]` will be
suggested ahead of the longer `#[inline(always)]` and `#[inline(never)`]
alternatives.
2026-07-26 18:18:15 +10:00
..
…
…
…
2026-07-22 11:42:09 +02:00
2026-07-22 11:42:09 +02:00
…