Add MIR validation for unwind out from nounwind functions + fixes to make validation pass by nbdd0121 · Pull Request #113124 · rust-lang/rust

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Jun 28, 2023

@ojeda ojeda mentioned this pull request

Jun 28, 2023

67 tasks

Noratrieb

cjgillot

nbdd0121

@nbdd0121

Otherwise the file name generated for generator_drop will become

core.ptr-drop_in_place.[generator@<FILEPATH>_<NUMBERS>].generator_drop.0.mir

instead of main-{closure#0}.generator_drop.0.mir which breaks a mir-opt
test.

@bors bors added the S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

label

Aug 20, 2023

This was referenced

Aug 20, 2023

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request

Nov 29, 2023
Validation introduced in rust-lang#113124 allows UnwindAction::Continue and
TerminatorKind::Resume to occur only in functions with ABI that can
unwind. The function ABI depends on the panic strategy, which can vary
across crates.

Usually MIR is built and validated in the same crate. The coroutine drop
glue thus far was an exception. As a result validation could fail when
mixing different panic strategies.

Avoid the problem by executing AbortUnwindingCalls along with the
validation.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Nov 29, 2023
Fix coroutine validation for mixed panic strategy

Validation introduced in rust-lang#113124 allows `UnwindAction::Continue` and `TerminatorKind::Resume` to occur only in functions with ABI that can unwind. The function ABI depends on the panic strategy, which can vary across crates.

Usually MIR is built and validated in the same crate. The coroutine drop glue thus far was an exception. As a result validation could fail when mixing different panic strategies.

Avoid the problem by executing `AbortUnwindingCalls` along with the validation.

Fixes rust-lang#116953.

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Nov 29, 2023
Rollup merge of rust-lang#118422 - tmiasko:mix, r=compiler-errors

Fix coroutine validation for mixed panic strategy

Validation introduced in rust-lang#113124 allows `UnwindAction::Continue` and `TerminatorKind::Resume` to occur only in functions with ABI that can unwind. The function ABI depends on the panic strategy, which can vary across crates.

Usually MIR is built and validated in the same crate. The coroutine drop glue thus far was an exception. As a result validation could fail when mixing different panic strategies.

Avoid the problem by executing `AbortUnwindingCalls` along with the validation.

Fixes rust-lang#116953.

kjetilkjeka pushed a commit to kjetilkjeka/rust that referenced this pull request

Nov 30, 2023
Validation introduced in rust-lang#113124 allows UnwindAction::Continue and
TerminatorKind::Resume to occur only in functions with ABI that can
unwind. The function ABI depends on the panic strategy, which can vary
across crates.

Usually MIR is built and validated in the same crate. The coroutine drop
glue thus far was an exception. As a result validation could fail when
mixing different panic strategies.

Avoid the problem by executing AbortUnwindingCalls along with the
validation.

cuviper pushed a commit to cuviper/rust that referenced this pull request

Dec 1, 2023
Validation introduced in rust-lang#113124 allows UnwindAction::Continue and
TerminatorKind::Resume to occur only in functions with ABI that can
unwind. The function ABI depends on the panic strategy, which can vary
across crates.

Usually MIR is built and validated in the same crate. The coroutine drop
glue thus far was an exception. As a result validation could fail when
mixing different panic strategies.

Avoid the problem by executing AbortUnwindingCalls along with the
validation.

(cherry picked from commit 5161b22)