normalization rework: clean up projection_ty_core - #160608
Conversation
| |ty, variant_index, field, ()| { | ||
| self.normalize(PlaceTy::field_ty(tcx, ty, variant_index, field), locations) | ||
| }, |
There was a problem hiding this comment.
fair! I just brainlessly reverted to how the code looked before my PR #160443 haha :P
| T: ::std::fmt::Debug + Copy, | ||
| V: Debug, | ||
| T: Debug + Copy, | ||
| { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
For context for others: after discussion, this gets difficult, because we might be looking at serialized MIR from a different crate (e.g. std) that was compiled under the old solver, and hence has non-rigid aliases.
Additionally, even if we build std under the next solver, there's quite a few places that have nonrigid aliases in MIR that should theoretically be cleaned up at some point, but is a bit out of scope for this PR. For example, I think here is one:
rust/compiler/rustc_mir_transform/src/shim.rs
Line 110 in f73951d
1db21d8 to
52dff85
Compare
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