Skip to content

Commit 124f89e

Browse files
committed
Fix clippy::thread_local_initializer_can_be_made_const
warning: initializer for `thread_local` value can be made `const` --> gc/src/gc.rs:29:52 | 29 | thread_local!(pub static GC_DROPPING: Cell<bool> = Cell::new(false)); | ^^^^^^^^^^^^^^^^ help: replace with: `const { Cell::new(false) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const = note: `#[warn(clippy::thread_local_initializer_can_be_made_const)]` on by default Signed-off-by: Anders Kaseorg <[email protected]>
1 parent d84eb95 commit 124f89e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gc/src/gc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Drop for GcState {
2626

2727
// Whether or not the thread is currently in the sweep phase of garbage collection.
2828
// During this phase, attempts to dereference a `Gc<T>` pointer will trigger a panic.
29-
thread_local!(pub static GC_DROPPING: Cell<bool> = Cell::new(false));
29+
thread_local!(pub static GC_DROPPING: Cell<bool> = const { Cell::new(false) });
3030
struct DropGuard;
3131
impl DropGuard {
3232
fn new() -> DropGuard {

0 commit comments

Comments
 (0)