Files
rust/tests/ui/span
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
..
2025-11-27 14:13:58 -05:00
2025-11-27 14:13:58 -05:00
…
…
…
…
2026-06-27 14:36:16 +02:00
2026-06-27 14:36:16 +02:00
2025-11-27 14:13:58 -05:00
2025-11-27 14:13:58 -05:00
2026-02-22 17:10:36 +03:00
2026-01-19 18:54:02 +00:00
2026-07-13 10:54:53 +02:00