diff options
| author | Adam Perry <adam.n.perry@gmail.com> | 2019-10-23 19:30:21 -0700 |
|---|---|---|
| committer | Adam Perry <adam.n.perry@gmail.com> | 2019-10-27 12:50:58 -0700 |
| commit | aec97e050ea5247fa13612399a7a812dbce89ec9 (patch) | |
| tree | ad7ba453a36edd6d6c530dc1fa8eb947b99fdeca /src/libstd | |
| parent | 743964ad3fe566ca2ce5c2de14f8733887d283fd (diff) | |
| download | rust-aec97e050ea5247fa13612399a7a812dbce89ec9.tar.gz rust-aec97e050ea5247fa13612399a7a812dbce89ec9.zip | |
Panicking infra uses &core::panic::Location.
This allows us to remove `static_panic_msg` from the SSA<->LLVM boundary, along with its fat pointer representation for &str. Also changes the signature of PanicInfo::internal_contructor to avoid copying. Closes #65856.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/panicking.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 619b1820190..f76969146fd 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -323,10 +323,8 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>, } let (file, line, col) = *file_line_col; - let info = PanicInfo::internal_constructor( - Some(msg), - Location::internal_constructor(file, line, col), - ); + let location = Location::internal_constructor(file, line, col); + let info = PanicInfo::internal_constructor(Some(msg), &location); continue_panic_fmt(&info) } @@ -453,10 +451,8 @@ fn rust_panic_with_hook(payload: &mut dyn BoxMeUp, } unsafe { - let mut info = PanicInfo::internal_constructor( - message, - Location::internal_constructor(file, line, col), - ); + let location = Location::internal_constructor(file, line, col); + let mut info = PanicInfo::internal_constructor(message, &location); HOOK_LOCK.read(); match HOOK { // Some platforms know that printing to stderr won't ever actually |
