Fix MIR typeck soundness holes#69145
Conversation
|
stealing review from niko |
| place_ty = self.sanitize_projection(place_ty, elem, place, location) | ||
| } | ||
|
|
||
| if let PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) = context { |
There was a problem hiding this comment.
The main change here is that we now do this for all places, right? I wonder why we didn't before? That just seems like a silly oversight to me.
|
@bors r+ |
|
📌 Commit ddc2545 has been approved by |
|
@bors p=10 rollup=never |
|
discussed in T-compiler meeting. accepted for beta and stable backport. however, please do wait until this lands in nighty before initiating such a backport... |
| ConstraintCategory::Boring, | ||
| ) { | ||
| span_mirbug!(self, constant, "bad static type {:?} ({:?})", constant, terr); | ||
| } |
There was a problem hiding this comment.
This is another thing where I don't understand why the new static representation doesn't result in correctness by default.
There was a problem hiding this comment.
Could MIR building inject a UserTypeAnnotation for static references/pointers? (note that I don't want to block this PR, any fix here should be equivalent, so we can clean it up later)
|
☀️ Test successful - checks-azure |
[stable] 1.41.1 release This backports the following PRs: * Revert "Remove `checked_add` in `Layout::repeat`" #69241 * Do not ICE when encountering `yield` inside `async` block #69175 * Correct ICE caused by macros generating invalid spans. #68611 * Changelog: Demonstrate final build-override syntax #68603 * Resolve long compile times when evaluating always valid constants #67667 * Fix MIR typeck soundness holes #69145 This also includes a commit which rustfmt's files which the latter commits touched (and perhaps a bit more) to make rebasing the PRs go more smoothly (thankfully, this should be the last time we need to do so). I have removed stable-nominated tags from PRs successfully backported.
[stable] 1.41.1 release This backports the following PRs: * Revert "Remove `checked_add` in `Layout::repeat`" #69241 * Do not ICE when encountering `yield` inside `async` block #69175 * Correct ICE caused by macros generating invalid spans. #68611 * Changelog: Demonstrate final build-override syntax #68603 * Resolve long compile times when evaluating always valid constants #67667 * Fix MIR typeck soundness holes #69145 This also includes a commit which rustfmt's files which the latter commits touched (and perhaps a bit more) to make rebasing the PRs go more smoothly (thankfully, this should be the last time we need to do so). I have removed stable-nominated tags from PRs successfully backported.
[beta] beta backports This backports the following PRs: * Revert "Remove `checked_add` in `Layout::repeat`" #69241 * Do not ICE when encountering `yield` inside `async` block #69175 * Fix MIR typeck soundness holes #69145 * Fix extra subslice lowering #69128 * Correct ICE caused by macros generating invalid spans. #68611 * Make conflicting_repr_hints a deny-by-default c-future-compat lint #68586
Copyimplsr? @nikomatsakis
closes #69114