Use new thread-local const-init
Let's see if this gives us any speedup - some of the TLS state modified in this commit *is* pretty heavily accessed, so we can hope!
This commit is contained in:
parent
89ebad52a8
commit
5065144d6d
5 changed files with 8 additions and 6 deletions
|
@ -50,6 +50,7 @@
|
|||
#![feature(control_flow_enum)]
|
||||
#![feature(associated_type_defaults)]
|
||||
#![feature(iter_zip)]
|
||||
#![feature(thread_local_const_init)]
|
||||
#![recursion_limit = "512"]
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
@ -1705,7 +1705,7 @@ pub mod tls {
|
|||
#[cfg(not(parallel_compiler))]
|
||||
thread_local! {
|
||||
/// A thread local variable that stores a pointer to the current `ImplicitCtxt`.
|
||||
static TLV: Cell<usize> = Cell::new(0);
|
||||
static TLV: Cell<usize> = const { Cell::new(0) };
|
||||
}
|
||||
|
||||
/// Sets TLV to `value` during the call to `f`.
|
||||
|
|
|
@ -55,10 +55,10 @@ macro_rules! define_scoped_cx {
|
|||
}
|
||||
|
||||
thread_local! {
|
||||
static FORCE_IMPL_FILENAME_LINE: Cell<bool> = Cell::new(false);
|
||||
static SHOULD_PREFIX_WITH_CRATE: Cell<bool> = Cell::new(false);
|
||||
static NO_TRIMMED_PATH: Cell<bool> = Cell::new(false);
|
||||
static NO_QUERIES: Cell<bool> = Cell::new(false);
|
||||
static FORCE_IMPL_FILENAME_LINE: Cell<bool> = const { Cell::new(false) };
|
||||
static SHOULD_PREFIX_WITH_CRATE: Cell<bool> = const { Cell::new(false) };
|
||||
static NO_TRIMMED_PATH: Cell<bool> = const { Cell::new(false) };
|
||||
static NO_QUERIES: Cell<bool> = const { Cell::new(false) };
|
||||
}
|
||||
|
||||
/// Avoids running any queries during any prints that occur
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue