-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MIR typeck soundness holes #69145
Conversation
stealing review from niko |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
@@ -503,6 +490,31 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> { | |||
place_ty = self.sanitize_projection(place_ty, elem, place, location) | |||
} | |||
|
|||
if let PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) = context { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Copy
implsr? @nikomatsakis
closes #69114