Skip to content

Tweak E0599 note#153682

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
estebank:tweak-e0599-note
Mar 18, 2026
Merged

Tweak E0599 note#153682
rust-bors[bot] merged 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

@wesleywiser
Copy link
Member

Thanks @estebank! 🥇

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 17, 2026

📌 Commit ed25d00 has been approved by wesleywiser

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 Mar 17, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 17, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #152998 (std: make `OsString::truncate` a no-op when `len > current_len`)
 - #153682 (Tweak E0599 note)
 - #153795 (Point turbofish inference errors at the uninferred generic arg)
 - #153994 (move `tests/ui/invalid` tests to new folders)
 - #154006 (attrs: Ignore ExprKind::Err when converting path attr expr to lit)
 - #154012 (unstable impl of `From<{i64, u64}> for f128`)
@rust-bors rust-bors bot merged commit 907464d into rust-lang:main Mar 18, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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