Add regression test for dead code elimination with drop + panic#155370
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Apr 19, 2026
Merged
Conversation
Collaborator
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
4683be7 to
1b7cc0c
Compare
This comment has been minimized.
This comment has been minimized.
1b7cc0c to
edea8ca
Compare
This comment has been minimized.
This comment has been minimized.
Dead code elimination used to fail when a Drop impl contained a panic and a potentially-panicking external function was called after the value was created. This was fixed since 1.82 but no regression test was added. The test verifies that foo() compiles to just a call to unknown() and ret void, with no panic or panicking call in the function body. Signed-off-by: Naveen R. Iyer <iyernaveenr@gmail.com>
edea8ca to
46f360a
Compare
Member
|
@bors r+ rollup=iffy |
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Apr 19, 2026
…4532-needs-test, r=Mark-Simulacrum Add regression test for dead code elimination with drop + panic Add a codegen test for rust-lang#114532. The bug was that dead code elimination failed when a `Drop` impl contained a `panic!` and a potentially-panicking external function was called after the value was created. This was fixed since 1.82 but no regression test was added. The test verifies that `foo()` compiles to just a call to `unknown()` + `ret void`, with no panic or panicking call in the function body. Closes rust-lang#114532
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 19, 2026
Rollup of 8 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #152995 (ACP Implementation of PermissionsExt for Windows ) - #153873 (deprecate `std::char` constants and functions) - #154654 (Move `std::io::ErrorKind` to `core::io`) - #154865 (libtest: use binary search for --exact test filtering)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Apr 19, 2026
…4532-needs-test, r=Mark-Simulacrum Add regression test for dead code elimination with drop + panic Add a codegen test for rust-lang#114532. The bug was that dead code elimination failed when a `Drop` impl contained a `panic!` and a potentially-panicking external function was called after the value was created. This was fixed since 1.82 but no regression test was added. The test verifies that `foo()` compiles to just a call to `unknown()` + `ret void`, with no panic or panicking call in the function body. Closes rust-lang#114532
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 19, 2026
Rollup of 9 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #154972 (Implement `core::arch::return_address` and tests) - #155294 (Add test for coalescing of diagnostic attribute duplicates) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #152995 (ACP Implementation of PermissionsExt for Windows ) - #153873 (deprecate `std::char` constants and functions) - #154865 (libtest: use binary search for --exact test filtering)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Apr 19, 2026
…4532-needs-test, r=Mark-Simulacrum Add regression test for dead code elimination with drop + panic Add a codegen test for rust-lang#114532. The bug was that dead code elimination failed when a `Drop` impl contained a `panic!` and a potentially-panicking external function was called after the value was created. This was fixed since 1.82 but no regression test was added. The test verifies that `foo()` compiles to just a call to `unknown()` + `ret void`, with no panic or panicking call in the function body. Closes rust-lang#114532
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 19, 2026
Rollup of 10 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #155294 (Add test for coalescing of diagnostic attribute duplicates) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #152995 (ACP Implementation of PermissionsExt for Windows ) - #153873 (deprecate `std::char` constants and functions) - #154865 (libtest: use binary search for --exact test filtering) - #154979 (add #[must_use] macros for floats) - #155504 (Remove `AttributeLintKind` variants - part 2)
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 19, 2026
…uwer Rollup of 12 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #155294 (Add test for coalescing of diagnostic attribute duplicates) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #153873 (deprecate `std::char` constants and functions) - #154865 (libtest: use binary search for --exact test filtering) - #154979 (add #[must_use] macros for floats) - #155486 (c-variadic: add roundtrip test) - #155504 (Remove `AttributeLintKind` variants - part 2) - #155510 (Update Tidy python executable path) - #155514 (codegen-options docs: remove -Csoft-float)
rust-timer
added a commit
that referenced
this pull request
Apr 19, 2026
Rollup merge of #155370 - iyernaveenr:naveen_r_iyer/issue-114532-needs-test, r=Mark-Simulacrum Add regression test for dead code elimination with drop + panic Add a codegen test for #114532. The bug was that dead code elimination failed when a `Drop` impl contained a `panic!` and a potentially-panicking external function was called after the value was created. This was fixed since 1.82 but no regression test was added. The test verifies that `foo()` compiles to just a call to `unknown()` + `ret void`, with no panic or panicking call in the function body. Closes #114532
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.
Add a codegen test for #114532.
The bug was that dead code elimination failed when a
Dropimpl contained apanic!and a potentially-panicking external function was called after the value was created. This was fixed since 1.82 but no regression test was added.The test verifies that
foo()compiles to just a call tounknown()+ret void, with no panic or panicking call in the function body.Closes #114532