Use const-initialized thread locals (#3923)

This was a relatively recent feature added to the Rust standard library
which should help accelerate calls into WebAssembly slightly.
This commit is contained in:
Alex Crichton
2022-03-14 12:29:58 -05:00
committed by GitHub
parent 884ca1f75b
commit 62a6a7ab6c
3 changed files with 13 additions and 7 deletions

View File

@@ -176,7 +176,7 @@ mod details {
// Information about passes in a single thread.
thread_local! {
static CURRENT_PASS: Cell<Pass> = Cell::new(Pass::None);
static CURRENT_PASS: Cell<Pass> = const { Cell::new(Pass::None) };
static PASS_TIME: RefCell<PassTimes> = RefCell::new(Default::default());
}