-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for nested panics to miri
- Loading branch information
Showing
6 changed files
with
53 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//@normalize-stderr-test: "\| +\^+" -> "| ^" | ||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1" | ||
//@normalize-stderr-test: "\n at [^\n]+" -> "$1" | ||
|
||
// Checks that nested panics work correctly. | ||
|
||
use std::panic::catch_unwind; | ||
|
||
fn double() { | ||
struct Double; | ||
|
||
impl Drop for Double { | ||
fn drop(&mut self) { | ||
let _ = catch_unwind(|| panic!("twice")); | ||
} | ||
} | ||
|
||
let _d = Double; | ||
|
||
panic!("once"); | ||
} | ||
|
||
fn main() { | ||
assert!(catch_unwind(|| double()).is_err()); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
thread 'main' panicked at 'once', $DIR/nested_panic_caught.rs:LL:CC | ||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace | ||
thread 'main' panicked at 'twice', $DIR/nested_panic_caught.rs:LL:CC | ||
stack backtrace: |