Skip to content

Improve E0637 suggestions for associated type bindings#156750

Open
qaijuang wants to merge 5 commits into
rust-lang:mainfrom
qaijuang:fix-e0637-assoc-type-lifetime-suggestion
Open

Improve E0637 suggestions for associated type bindings#156750
qaijuang wants to merge 5 commits into
rust-lang:mainfrom
qaijuang:fix-e0637-assoc-type-lifetime-suggestion

Conversation

@qaijuang

@qaijuang qaijuang commented May 19, 2026

Copy link
Copy Markdown
Contributor

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 19, 2026
@qaijuang

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot 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 May 19, 2026
@qaijuang qaijuang marked this pull request as ready for review May 19, 2026 14:32
@rustbot

rustbot commented May 19, 2026

Copy link
Copy Markdown
Collaborator

r? @nikomatsakis

rustbot has assigned @nikomatsakis.
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 73 candidates
  • Random selection from 20 candidates

@nikomatsakis nikomatsakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! Nice improvements. I have two suggestions.

View changes since this review

None
}
});
let suggestion = if self.diag_metadata.in_assoc_ty_binding {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining the rationale here? Why does this if make sense? What is the output we are trying to produce? Why are we looking for a LifetimeRibKind::Generics below?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

self.point_at_impl_lifetimes(&mut err, i, lifetime.ident.span);
err.emit()
}
} else if self.diag_metadata.in_assoc_ty_binding {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, a comment -- I think it'd be great to have a code example and show what this is doing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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

rustbot commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@qaijuang

qaijuang commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot 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 Jun 6, 2026
@nikomatsakis

Copy link
Copy Markdown
Contributor

bors r+

@qaijuang

Copy link
Copy Markdown
Contributor Author

bors didn't catch that, maybe because of the missing "@"

@rust-bors

This comment has been minimized.

@qaijuang

Copy link
Copy Markdown
Contributor Author

☔ The latest upstream changes (presumably #157991) made this pull request unmergeable. Please resolve the merge conflicts.

will do a rebase rq

@qaijuang qaijuang force-pushed the fix-e0637-assoc-type-lifetime-suggestion branch from d160492 to f2dbc3d Compare June 17, 2026 13:40
@rustbot

rustbot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

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.

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

3 participants