forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122930 - RalfJung:panic-in-panic-fmt, r=Amanieu add panic location to 'panicked while processing panic' Fixes rust-lang#97181 r? `@Amanieu`
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Checks what happens when formatting the panic message panics. | ||
|
||
//@ run-fail | ||
//@ exec-env:RUST_BACKTRACE=0 | ||
//@ check-run-results | ||
//@ error-pattern: panicked while processing panic | ||
//@ normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "" | ||
//@ normalize-stderr-test: "\n +at [^\n]+" -> "" | ||
//@ normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL" | ||
//@ ignore-emscripten "RuntimeError" junk in output | ||
|
||
use std::fmt::{Display, self}; | ||
|
||
struct MyStruct; | ||
|
||
impl Display for MyStruct { | ||
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
todo!() | ||
} | ||
} | ||
|
||
fn main() { | ||
let instance = MyStruct; | ||
panic!("this is wrong: {}", instance); | ||
} |
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,2 @@ | ||
panicked at $DIR/panic-in-message-fmt.rs:18:9: | ||
thread panicked while processing panic. aborting. |