Skip to content

Commit

Permalink
std::thread: avoid leading whitespace in some panic messages
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 25, 2024
1 parent 7db7489 commit 5030686
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/std/src/thread/current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ fn init_current(current: *mut ()) -> Thread {
// 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.
rtabort!(
"\n
Attempted to access thread-local data while allocating said data.\n
Do not access functions that allocate in the global allocator!\n
This is a bug in the global allocator.\n
"\n\
Attempted to access thread-local data while allocating said data.\n\
Do not access functions that allocate in the global allocator!\n\
This is a bug in the global allocator.\n\
"
)
} else {
debug_assert_eq!(current, DESTROYED);
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"
)
}
Expand Down

0 comments on commit 5030686

Please sign in to comment.