Continue folding in query normalizer on weak aliases#112777
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 19, 2023
Merged
Continue folding in query normalizer on weak aliases#112777bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
compiler-errors
commented
Jun 18, 2023
| if res != ty | ||
| && (res.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION) || kind == ty::Weak) | ||
| { | ||
| res.try_fold_with(self)? |
Contributor
Author
There was a problem hiding this comment.
Whereas for the CT_PROJECTION case we didn't care about the difference between try_fold_with and try_super_fold_with, for the weak case, we need to call try_fold_with or else we'll skip one layer of the alias's type.
compiler-errors
commented
Jun 18, 2023
| // Similarly, `tcx.normalize_weak_ty` will only unwrap one layer of type | ||
| // and we need to continue folding it to reveal the TAIT behind it. | ||
| if res != ty | ||
| && (res.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION) || kind == ty::Weak) |
Contributor
Author
There was a problem hiding this comment.
Alternatively, we could instead modify the normalize_weak_ty query and do the deep normalization there, instead of here.
Contributor
There was a problem hiding this comment.
that's not what we do for the other normalize queries. Maybe we should rename them to shallow_normalize_...
edit: ah, but we don't want to do this for things other than weak type aliases... hmm...
Member
|
I think #112776 is another issue that this PR might fix. |
Contributor
|
@bors r+ |
Collaborator
jyn514
added a commit
to jyn514/rust
that referenced
this pull request
Jun 19, 2023
…e, r=oli-obk Continue folding in query normalizer on weak aliases Fixes rust-lang#112752 Fixes rust-lang#112731 (same root cause, so didn't make a test for it) fixes rust-lang#112776 r? `@oli-obk`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 19, 2023
…e, r=oli-obk Continue folding in query normalizer on weak aliases Fixes rust-lang#112752 Fixes rust-lang#112731 (same root cause, so didn't make a test for it) fixes rust-lang#112776 r? ``@oli-obk``
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 19, 2023
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#109970 ([doc] `poll_fn`: explain how to `pin` captured state safely) - rust-lang#112705 (Simplify `Span::source_callee` impl) - rust-lang#112757 (Use BorrowFlag instead of explicit isize) - rust-lang#112768 (Rewrite various resolve/diagnostics errors as translatable diagnostics) - rust-lang#112777 (Continue folding in query normalizer on weak aliases) - rust-lang#112780 (Treat TAIT equation as always ambiguous in coherence) - rust-lang#112783 (Don't ICE on bound var in `reject_fn_ptr_impls`) r? `@ghost` `@rustbot` modify labels: rollup
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 #112752
Fixes #112731 (same root cause, so didn't make a test for it)
fixes #112776
r? @oli-obk