Skip to content

Tweak E0599 note#153682

Open
estebank wants to merge 1 commit intorust-lang:mainfrom
estebank:tweak-e0599-note
Open

Tweak E0599 note#153682
estebank wants to merge 1 commit intorust-lang:mainfrom
estebank:tweak-e0599-note

Conversation

@estebank
Copy link
Contributor

When not finding a method for a type, but finding it for a single other impl, special case the output to emit a single message instead of a list.

error[E0599]: no associated item named `C` found for struct `Fail<i32, u32>` in the current scope
  --> $DIR/wrong-projection-self-ty-invalid-bivariant-arg2.rs:15:23
   |
LL | struct Fail<T: Proj<Assoc = U>, U>(T);
   | ---------------------------------- associated item `C` not found for this struct
...
LL |     Fail::<i32, u32>::C
   |                       ^ associated item not found in `Fail<i32, u32>`
   |
   = note: the associated item was found for `Fail<i32, i32>`

instead of

   = note: the associated item was found for
           - `Fail<i32, i32>`

When not finding a method for a type, but finding it for a single other impl, special case the output to emit a single message instead of a list.

```
error[E0599]: no associated item named `C` found for struct `Fail<i32, u32>` in the current scope
  --> $DIR/wrong-projection-self-ty-invalid-bivariant-arg2.rs:15:23
   |
LL | struct Fail<T: Proj<Assoc = U>, U>(T);
   | ---------------------------------- associated item `C` not found for this struct
...
LL |     Fail::<i32, u32>::C
   |                       ^ associated item not found in `Fail<i32, u32>`
   |
   = note: the associated item was found for `Fail<i32, i32>`
```
instead of

```
   = note: the associated item was found for
           - `Fail<i32, i32>`
```
@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. labels Mar 11, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2026

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 17 candidates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants