Repository navigation
mir: validate Move call arguments are locals or box derefs - #160651
Merged
rust-bors[bot] merged 1 commit intoSep 9, 2026
Merged
Conversation
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Collaborator
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
rabindra789
marked this pull request as draft
August 6, 2026 18:27
rabindra789
force-pushed
the
fix/mir-verifier-move-call-args
branch
from
August 7, 2026 06:08
6cf4605 to
1154159
Compare
rabindra789
marked this pull request as ready for review
August 7, 2026 06:17
Contributor
Collaborator
|
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 26, 2026
…call-args, r=WaffleLapkin mir: validate `Move` call arguments are locals or box derefs Fixes rust-lang#103362. This PR adds a MIR validation check for `Move` arguments passed to `Call` and `TailCall` terminators. A moved argument should be either a local or the contents of the `Box`. Other places can deinitialize memory that codegen does not track correctly. The check is only enabled with `-Zvalidate-mir`, using the same phase restriction as the existing `Copy` check. Added a regression test covering the invalid case.
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 26, 2026
…uwer Rollup of 4 pull requests Successful merges: - #160651 (mir: validate `Move` call arguments are locals or box derefs) - #161736 (Tidy: show todo reason when lint fails (and fix the lint's tidy allow statement which was weird and broken...)) - #161052 (Add regression test for generic inference) - #161818 (Fix long type on diagnostics for conditionally implemented traits)
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 26, 2026
…r=WaffleLapkin mir: validate `Move` call arguments are locals or box derefs Fixes #103362. This PR adds a MIR validation check for `Move` arguments passed to `Call` and `TailCall` terminators. A moved argument should be either a local or the contents of the `Box`. Other places can deinitialize memory that codegen does not track correctly. The check is only enabled with `-Zvalidate-mir`, using the same phase restriction as the existing `Copy` check. Added a regression test covering the invalid case.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 8, 2026
…call-args, r=WaffleLapkin mir: validate `Move` call arguments are locals or box derefs Fixes rust-lang#103362. This PR adds a MIR validation check for `Move` arguments passed to `Call` and `TailCall` terminators. A moved argument should be either a local or the contents of the `Box`. Other places can deinitialize memory that codegen does not track correctly. The check is only enabled with `-Zvalidate-mir`, using the same phase restriction as the existing `Copy` check. Added a regression test covering the invalid case.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 8, 2026
…uwer Rollup of 10 pull requests Successful merges: - #162470 (Subtree sync for rustc_codegen_cranelift) - #160505 (delegation: supporting inherent impls) - #160651 (mir: validate `Move` call arguments are locals or box derefs) - #161806 (Add tests and docs for `#[derive(GenericTypeVisitable)]`) - #161912 (run `extern "tail"` with `byval` argument test) - #162435 (windows-gnu: document libgcc requirement) - #162439 (Update books) - #162451 (Add regression test for item-local diagnostic attribute lint levels) - #162459 (docs(time): replace "method" with "function") - #162465 (Fix my duplicate thanks entry)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 8, 2026
…call-args, r=WaffleLapkin mir: validate `Move` call arguments are locals or box derefs Fixes rust-lang#103362. This PR adds a MIR validation check for `Move` arguments passed to `Call` and `TailCall` terminators. A moved argument should be either a local or the contents of the `Box`. Other places can deinitialize memory that codegen does not track correctly. The check is only enabled with `-Zvalidate-mir`, using the same phase restriction as the existing `Copy` check. Added a regression test covering the invalid case.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 8, 2026
…uwer Rollup of 9 pull requests Successful merges: - #160505 (delegation: supporting inherent impls) - #160651 (mir: validate `Move` call arguments are locals or box derefs) - #161806 (Add tests and docs for `#[derive(GenericTypeVisitable)]`) - #161912 (run `extern "tail"` with `byval` argument test) - #162435 (windows-gnu: document libgcc requirement) - #162439 (Update books) - #162451 (Add regression test for item-local diagnostic attribute lint levels) - #162459 (docs(time): replace "method" with "function") - #162465 (Fix my duplicate thanks entry)
Contributor
|
The bors config at |
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 8, 2026
…uwer Rollup of 9 pull requests Successful merges: - #160505 (delegation: supporting inherent impls) - #160651 (mir: validate `Move` call arguments are locals or box derefs) - #161806 (Add tests and docs for `#[derive(GenericTypeVisitable)]`) - #161912 (run `extern "tail"` with `byval` argument test) - #162435 (windows-gnu: document libgcc requirement) - #162439 (Update books) - #162451 (Add regression test for item-local diagnostic attribute lint levels) - #162459 (docs(time): replace "method" with "function") - #162465 (Fix my duplicate thanks entry)
Contributor
rabindra789
force-pushed
the
fix/mir-verifier-move-call-args
branch
from
September 9, 2026 13:56
98f4067 to
1a533b6
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Contributor
|
@bors r=WaffleLapkin |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 9, 2026
Rollup of 8 pull requests Successful merges: - #162412 (Fix msvc-specific differences in debuginfo tests) - #160651 (mir: validate `Move` call arguments are locals or box derefs) - #161946 (Generalise (most) impls on `Box`) - #162192 (normalize CoerceShared field types before relating) - #160518 (fix: fix no resolution for self import in namespaced crates) - #162509 (Avoid suggesting gated generic arguments for Fn-family traits) - #162521 (Don't explicitly specify `OnDuplicate::Error` as it is the default) - #162526 (yeet VisitorExt)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 9, 2026
Rollup of 8 pull requests Successful merges: - #162412 (Fix msvc-specific differences in debuginfo tests) - #160651 (mir: validate `Move` call arguments are locals or box derefs) - #161946 (Generalise (most) impls on `Box`) - #162192 (normalize CoerceShared field types before relating) - #160518 (fix: fix no resolution for self import in namespaced crates) - #162509 (Avoid suggesting gated generic arguments for Fn-family traits) - #162521 (Don't explicitly specify `OnDuplicate::Error` as it is the default) - #162526 (yeet VisitorExt)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 9, 2026
Rollup of 8 pull requests Successful merges: - #162412 (Fix msvc-specific differences in debuginfo tests) - #160651 (mir: validate `Move` call arguments are locals or box derefs) - #161946 (Generalise (most) impls on `Box`) - #162192 (normalize CoerceShared field types before relating) - #160518 (fix: fix no resolution for self import in namespaced crates) - #162509 (Avoid suggesting gated generic arguments for Fn-family traits) - #162521 (Don't explicitly specify `OnDuplicate::Error` as it is the default) - #162526 (yeet VisitorExt)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 9, 2026
Rollup merge of #160651 - rabindra789:fix/mir-verifier-move-call-args, r=WaffleLapkin mir: validate `Move` call arguments are locals or box derefs Fixes #103362. This PR adds a MIR validation check for `Move` arguments passed to `Call` and `TailCall` terminators. A moved argument should be either a local or the contents of the `Box`. Other places can deinitialize memory that codegen does not track correctly. The check is only enabled with `-Zvalidate-mir`, using the same phase restriction as the existing `Copy` check. Added a regression test covering the invalid case.
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.
View all comments
Fixes #103362.
This PR adds a MIR validation check for
Movearguments passed toCallandTailCallterminators.A moved argument should be either a local or the contents of the
Box. Other places can deinitialize memory that codegen does not track correctly. The check is only enabled with-Zvalidate-mir, using the same phase restriction as the existingCopycheck.Added a regression test covering the invalid case.