-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't use item name to look up associated item from trait item #140278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.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( |
There was a problem hiding this comment.
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.
@bors r+ rollup |
…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
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`
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