Files
rust/tests/ui/issues
Stuart Cook efbc8957a6 Rollup merge of #145399 - estebank:resolve-error-wording-2, r=petrochenkov
Unify wording of resolve error

Remove "failed to resolve" from the main error message and use the same format we use in other resolution errors "cannot find `name`":

```
error[E0433]: cannot find `nonexistent` in `existent`
  --> $DIR/custom_attr_multisegment_error.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`
```

The intent behind this is to end up with all resolve errors eventually be on the form of

```
error[ECODE]: cannot find `{NAME}` in {SCOPE}
  --> $DIR/file.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ {SPECIFIC LABEL}
```

A category of errors that is interest are those that involve keywords. For example:

```
error[E0433]: cannot find `Self` in this scope
  --> $DIR/issue-97194.rs:2:35
   |
LL |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
   |                                   ^^^^ `Self` is only available in impls, traits, and type definitions
```
and

```
error[E0433]: cannot find `super` in this scope
  --> $DIR/keyword-super.rs:2:9
   |
LL |     let super: isize;
   |         ^^^^^ there are too many leading `super` keywords
```

For these the label provides the actual help, while the message is less informative beyond telling you "couldn't find `name`".

This is an off-shoot of https://github.com/rust-lang/rust/pull/126810 and https://github.com/rust-lang/rust/pull/128086, a subset of the intended changes there with review comments applied.

r? @petrochenkov
2026-02-18 17:29:41 +11:00
..
2026-01-22 19:50:00 +01:00
2026-01-21 13:54:00 +00:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-02-04 10:57:49 +00:00
2025-02-03 19:00:22 +00:00
2025-10-11 20:50:21 +00:00
2024-01-13 12:46:58 -05:00
2025-12-10 23:41:19 +00:00
2025-08-26 14:46:11 +02:00
2025-10-01 07:39:03 +00:00
2025-11-27 11:19:00 -05:00
2024-01-05 10:00:59 +00:00
2025-12-02 18:25:13 +00:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-22 08:58:45 +02:00
2023-11-16 17:00:23 +00:00
2025-11-27 11:19:00 -05:00
2025-12-02 18:25:13 +00:00
2025-12-05 09:51:27 -05:00
2026-02-17 16:51:44 +00:00
2024-04-29 14:53:38 +02:00
2025-08-14 18:18:42 +02:00
2026-02-17 16:51:44 +00:00
2025-08-22 13:16:44 +08:00
2025-08-22 13:16:44 +08:00
2026-01-18 22:41:00 +01:00