mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 20:53:37 +00:00
Auto merge of #92461 - rust-lang:const_tls_local_panic_count, r=Mark-Simulacrum
Use const initializer for LOCAL_PANIC_COUNT This reduces the size of the __getit function for LOCAL_PANIC_COUNT and should speed up accesses of LOCAL_PANIC_COUNT a bit.
This commit is contained in:
commit
ef9b49881b
@ -325,7 +325,7 @@ pub mod panic_count {
|
||||
pub const ALWAYS_ABORT_FLAG: usize = 1 << (usize::BITS - 1);
|
||||
|
||||
// Panic count for the current thread.
|
||||
thread_local! { static LOCAL_PANIC_COUNT: Cell<usize> = Cell::new(0) }
|
||||
thread_local! { static LOCAL_PANIC_COUNT: Cell<usize> = const { Cell::new(0) } }
|
||||
|
||||
// Sum of panic counts from all threads. The purpose of this is to have
|
||||
// a fast path in `is_zero` (which is used by `panicking`). In any particular
|
||||
|
Loading…
Reference in New Issue
Block a user