Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy::thread_local_initializer_can_be_made_const #180

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

andersk
Copy link
Collaborator

@andersk andersk commented Jul 17, 2024

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

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 <andersk@mit.edu>
@Manishearth Manishearth merged commit 9738caa into Manishearth:master Jul 17, 2024
1 check passed
@andersk andersk deleted the thread-const branch October 2, 2024 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants