Don't Fold Self-Referential ADTs in check_inferred_predicates()#123866
Closed
veera-sivarajan wants to merge 2 commits intorust-lang:masterfrom
Closed
Don't Fold Self-Referential ADTs in check_inferred_predicates()#123866veera-sivarajan wants to merge 2 commits intorust-lang:masterfrom
check_inferred_predicates()#123866veera-sivarajan wants to merge 2 commits intorust-lang:masterfrom
Conversation
Collaborator
Contributor
|
Can you please find what PR introduced this regression? I'm also suspicious about if this is the right way to solve this problem -- there's no explanation of the side-effects of the change, nor any reasoning about if this affects soundness or anything like that. In general, I think this needs more explanation. |
Contributor
Author
|
Sure! The issue bisects to #53793. Will analyze more about soundness and update with a detailed explanation. |
Contributor
Author
|
On second thought, this approach doesn't work for cases like: trait Trait {
type Assoc: Trait;
}
struct Outer<'a, T: Trait> {
value: &'a Inner<'a, T>,
}
struct Inner<'a, T: Trait> {
value: &'a Outer<'a, T::Assoc>,
}Thanks for pointing it out. |
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 #118163, #118449
The I-hang was caused by the compiler trying to instantiate a predicate for self-referential ADTs.
This PR fixes it by not instantiating a predicate when an ADT's field refers to the ADT itself.