Files
rust/tests/ui/error-codes
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-01-18 22:41:00 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-12-02 18:25:13 +00:00
2025-12-02 18:25:13 +00:00
…
…
…
…
…
…
…
2026-04-27 10:58:30 +08:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
…
2026-02-17 16:51:44 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-01-18 22:41:00 +01:00
…
…
2025-11-27 14:13:58 -05:00
2025-11-27 14:13:58 -05:00
…
…
2025-11-27 14:13:58 -05:00
…
…
…
…
…
…
…
2025-11-25 10:19:44 +01:00
2025-11-26 11:09:03 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-28 16:18:11 +09:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-06-17 09:39:00 -04:00
2026-06-17 09:39:00 -04:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-12-12 11:32:26 +01:00