Skip to content

Unify wording of resolve error#145399

Open
estebank wants to merge 2 commits intorust-lang:mainfrom
estebank:resolve-error-wording-2
Open

Unify wording of resolve error#145399
estebank wants to merge 2 commits intorust-lang:mainfrom
estebank:resolve-error-wording-2

Conversation

@estebank
Copy link
Contributor

@estebank estebank commented Aug 14, 2025

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 #126810 and #128086, a subset of the intended changes there with review comments applied.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 14, 2025

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the resolve-error-wording-2 branch from fd49d2a to 298dec7 Compare August 14, 2025 16:32
@estebank estebank added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 14, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 15, 2025
@estebank estebank force-pushed the resolve-error-wording-2 branch 2 times, most recently from 0b0bd12 to f6ce33d Compare August 15, 2025 19:28
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@petrochenkov
Copy link
Contributor

Not sure what is the status here, the PR was updated at some point, but never marked as waiting on review.

@estebank
Copy link
Contributor Author

If the wording changes are agreeable (which #145399 (comment) makes it sound like it might be), I can try to clean up the PR again into a mergable state.

@petrochenkov
Copy link
Contributor

Yes, I think we can rebase and merge this.
Now I remember that I did full review and the two comments above was everything that I thought needed addressing.

@estebank estebank force-pushed the resolve-error-wording-2 branch from 6890c8d to 830b1d7 Compare February 13, 2026 19:22
@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2026

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

The Miri subtree was changed

cc @rust-lang/miri

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs T-clippy Relevant to the Clippy team. labels Feb 13, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 13, 2026
@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the resolve-error-wording-2 branch from 702fbc4 to 0c612ca Compare February 13, 2026 23:16
@rust-log-analyzer

This comment has been minimized.

Remove "failed to resolve" 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`
```
@estebank estebank force-pushed the resolve-error-wording-2 branch from 0c612ca to 61211ba Compare February 14, 2026 00:51
@petrochenkov
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 16, 2026

📌 Commit 61211ba has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 16, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 16, 2026
…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 rust-lang#126810 and rust-lang#128086, a subset of the intended changes there with review comments applied.

r? @petrochenkov
rust-bors bot pushed a commit that referenced this pull request Feb 17, 2026
Rollup of 6 pull requests

Successful merges:

 - #145399 (Unify wording of resolve error)
 - #152512 (core: Implement feature `float_exact_integer_constants`)
 - #152661 (Avoid ICE in From/TryFrom diagnostic under -Znext-solver)
 - #152703 (Remove `rustc_query_system`)
 - #152727 (`probe_op` silence ambiguity errors if tainted)
 - #152728 (Port #![default_lib_allocator] to the new attribute parser)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants