Handle Node::Crate in generics_of to prevent ICE#155192
Closed
blackms wants to merge 2 commits intorust-lang:mainfrom
Closed
Handle Node::Crate in generics_of to prevent ICE#155192blackms wants to merge 2 commits intorust-lang:mainfrom
Node::Crate in generics_of to prevent ICE#155192blackms wants to merge 2 commits intorust-lang:mainfrom
Conversation
The `generics_of` query did not handle `Node::Crate`, causing an ICE when the crate root DefId was passed to it during dyn-compatibility checking. This adds `Node::Crate(_)` to the match arm for nodes with no parent generics, alongside `Node::Item` and `Node::ForeignItem`. Fixes rust-lang#144888
Collaborator
|
This comment has been minimized.
This comment has been minimized.
The tidy check requires test file names to have the reason before the
issue number: {reason}-issue-{number}.rs
Contributor
|
|
Author
|
You're right — I dug deeper and found that the offending caller was already fixed by #153615, which changed So this PR is redundant. I'll close it. Thanks for the pointer! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #144888
The
generics_ofquery did not handleNode::Crate, causing an ICE when the crate root DefId reached it during dyn-compatibility checking. The query stack was:The fix adds
Node::Crate(_)to the existing match arm for nodes with no parent generics (alongsideNode::ItemandNode::ForeignItem), returning empty generics for the crate root. This is consistent with how other query implementations handleNode::Crate(e.g.,resolve_bound_vars,check_well_formed).r? compiler