mir: validate Move call arguments are locals or box derefs - #160651
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
6cf4605 to
1154159
Compare
|
|
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.
…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.
…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.
…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.
…uwer Rollup of 8 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) - #162459 (docs(time): replace "method" with "function") - #162465 (Fix my duplicate thanks entry)
…uwer Rollup of 8 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) - #162459 (docs(time): replace "method" with "function") - #162465 (Fix my duplicate thanks entry)
…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.
…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)
…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.
…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)
|
The bors config at |
…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)
|
Asked about the above error at https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Invalid.20rust-bors.2Etoml.20error/with/622534709 |
98f4067 to
1a533b6
Compare
|
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. |
|
@bors r=WaffleLapkin |
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)
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)
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)
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.
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.