refactor the normalization in coerce_shared_info#158659
Open
adwinwhite wants to merge 1 commit into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
lcnr
reviewed
Jul 1, 2026
8104ac2 to
e230f7e
Compare
e230f7e to
3d7f010
Compare
lcnr
reviewed
Jul 2, 2026
| let ty = f.ty(tcx, args).skip_norm_wip(); | ||
| if ty.is_phantom_data() { | ||
| let ty = f.ty(tcx, args); | ||
| if ty.skip_normalization().is_phantom_data() { |
Contributor
There was a problem hiding this comment.
can you keep that as skip_norm_wip? I am not confident we don't want to allow <PhantomData as Id>::This here or some free type alias that normalizes to PhantomData
Contributor
There was a problem hiding this comment.
maybe even a FIXME(whatever-feature)
lcnr
reviewed
Jul 2, 2026
| @@ -0,0 +1,45 @@ | |||
| //@ check-pass | |||
|
|
|||
Contributor
There was a problem hiding this comment.
can you add a comment explaining what this does :>
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.
This is pre-requisite of removing
eq_structurally_relating_aliaseswhich is part of #155345.coerce_shared_infois only used in the unstable featurereborrowwhich provides aCoerceSharedtrait indicating a mutable borrow can be converted into a shared borrow.I think using
deeply_normalizeis more suitable for these identity instantiated types.No reason to allow ambiguous normalization and use infer vars as normalization result here.
r? lcnr