mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-03 18:43:38 +00:00
Rollup merge of #133464 - RalfJung:whitespace-panic, r=joboet
std:🧵 avoid leading whitespace in some panic messages This: ``` panic!( "use of std:🧵:current() is not possible after the thread's local data has been destroyed" ) ``` will print a newline followed by a bunch of spaces, since the entire string literal is interpreted literally. I think the intention was to print the message without the newline and the spaces, so let's add some `\` to make that happen. r? ``@joboet``
This commit is contained in:
commit
a06532e639
@ -243,17 +243,17 @@ fn init_current(current: *mut ()) -> Thread {
|
|||||||
// a particular API should be entirely allocation-free, feel free to open
|
// a particular API should be entirely allocation-free, feel free to open
|
||||||
// an issue on the Rust repository, we'll see what we can do.
|
// an issue on the Rust repository, we'll see what we can do.
|
||||||
rtabort!(
|
rtabort!(
|
||||||
"\n
|
"\n\
|
||||||
Attempted to access thread-local data while allocating said data.\n
|
Attempted to access thread-local data while allocating said data.\n\
|
||||||
Do not access functions that allocate in the global allocator!\n
|
Do not access functions that allocate in the global allocator!\n\
|
||||||
This is a bug in the global allocator.\n
|
This is a bug in the global allocator.\n\
|
||||||
"
|
"
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
debug_assert_eq!(current, DESTROYED);
|
debug_assert_eq!(current, DESTROYED);
|
||||||
panic!(
|
panic!(
|
||||||
"use of std::thread::current() is not possible after the thread's
|
"use of std::thread::current() is not possible after the thread's \
|
||||||
local data has been destroyed"
|
local data has been destroyed"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user