Skip to content

normalization rework: clean up projection_ty_core - #160608

Open
khyperia wants to merge 1 commit into
rust-lang:mainfrom
khyperia:cleanup-projection_ty_core
Open

normalization rework: clean up projection_ty_core#160608
khyperia wants to merge 1 commit into
rust-lang:mainfrom
khyperia:cleanup-projection_ty_core

Conversation

@khyperia

@khyperia khyperia commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

in #160443 I was overly conservative in reworking how normalization works in projection_ty_core, because the PR was about other things. However, we can assume PlaceTy::ty is normalized (... I think).

r? lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 6, 2026

@adwinwhite adwinwhite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

r? me

View changes since this review

Comment on lines +482 to +484
|ty, variant_index, field, ()| {
self.normalize(PlaceTy::field_ty(tcx, ty, variant_index, field), locations)
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

field -> field_index

T: ::std::fmt::Debug + Copy,
V: Debug,
T: Debug + Copy,
{

@adwinwhite adwinwhite Aug 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe they should be normalized too. Is it a good idea that we add a debug assert to ensure the invariant holds? like debug_assert!(!tcx.next_trait_solver() || !self.ty.has_non_rigid_aliases()))
Though we seem to have no way of asserting this for the old solver.

@rustbot rustbot assigned adwinwhite and unassigned lcnr Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants