Skip to content

Conversation

compiler-errors
Copy link
Member

This fix should be self-justifying b/c the fact that we were using identifiers here was kinda sus anyways, esp b/c we have a failproof way of doing the comparison :) I'll leave some info about why this repro needs a macro.

Fixes #140259

r? @nnethercote

@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 Apr 25, 2025
.associated_items(impl_def_id)
.in_definition_order()
.find(|assoc| assoc.ident(self.tcx) == trait_assoc_ident),
self.tcx.associated_items(impl_def_id).in_definition_order().find(
Copy link
Member Author

@compiler-errors compiler-errors Apr 25, 2025

Choose a reason for hiding this comment

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

Note on item ordering: RPITITs are typically last in this list, so we typically do not encounter RPITITs here (and thus, it's harder to reproduce this ICE).

However, when we have a macro, the identifier of the macro wasn't being adjusted, so although it had the same Symbol, it has a different span and thus identifier equality works a bit differently. So we fall through the assoc item list to the RPITITs, and try to compute their item names and ICE.

@nnethercote
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 25, 2025

📌 Commit 1d0b3be has been approved by nnethercote

It is now in the queue for this repository.

@bors bors 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 Apr 25, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137653 (Deprecate the unstable `concat_idents!`)
 - rust-lang#138957 (Update the index of Option to make the summary more comprehensive)
 - rust-lang#140006 (ensure compiler existance of tools on the dist step)
 - rust-lang#140143 (Move `sys::pal::os::Env` into `sys::env`)
 - rust-lang#140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/)
 - rust-lang#140236 (norm nested aliases before evaluating the parent goal)
 - rust-lang#140257 (Some drive-by housecleaning in `rustc_borrowck`)
 - rust-lang#140278 (Don't use item name to look up associated item from trait item)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3c08a50 into rust-lang:master Apr 25, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 25, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2025
Rollup merge of rust-lang#140278 - compiler-errors:name-based-comparison, r=nnethercote

Don't use item name to look up associated item from trait item

This fix should be self-justifying b/c the fact that we were using identifiers here was kinda sus anyways, esp b/c we have a failproof way of doing the comparison :) I'll leave some info about why this repro needs a macro.

Fixes rust-lang#140259

r? `@nnethercote`
@compiler-errors compiler-errors deleted the name-based-comparison branch April 30, 2025 15:08
VlaDexa added a commit to VlaDexa/rust that referenced this pull request May 2, 2025
…son, r=oli-obk

Use select in projection lookup in `report_projection_error`

Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to rust-lang#140278.

r? oli-obk
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 2, 2025
…son, r=oli-obk

Use select in projection lookup in `report_projection_error`

Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to rust-lang#140278.

r? oli-obk
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2025
Rollup merge of rust-lang#140519 - compiler-errors:name-based-comparison, r=oli-obk

Use select in projection lookup in `report_projection_error`

Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to rust-lang#140278.

r? oli-obk
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request May 3, 2025
…i-obk

Use select in projection lookup in `report_projection_error`

Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to rust-lang/rust#140278.

r? oli-obk
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request May 9, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137653 (Deprecate the unstable `concat_idents!`)
 - rust-lang#138957 (Update the index of Option to make the summary more comprehensive)
 - rust-lang#140006 (ensure compiler existance of tools on the dist step)
 - rust-lang#140143 (Move `sys::pal::os::Env` into `sys::env`)
 - rust-lang#140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/)
 - rust-lang#140236 (norm nested aliases before evaluating the parent goal)
 - rust-lang#140257 (Some drive-by housecleaning in `rustc_borrowck`)
 - rust-lang#140278 (Don't use item name to look up associated item from trait item)

r? `@ghost`
`@rustbot` modify labels: rollup
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.

name of non-Rpitit assoc item error
4 participants