Skip to content

Commit

Permalink
Disable clippy nightly warning about const TLS
Browse files Browse the repository at this point in the history
This complains:

> warning: initializer for `thread_local` value can be made `const`

But doing the suggested fix breaks the build on our MSRV, with:

> warning: a `const` item should never be interior mutable

So we can't really win.
  • Loading branch information
ctz committed Jan 16, 2024
1 parent 715928e commit 844ea57
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ include!(concat!(env!("OUT_DIR"), "/version.rs"));
// Rust code, we model these thread locals as a stack, so we can always
// restore the previous version.
thread_local! {
#[allow(clippy::thread_local_initializer_can_be_made_const)]
pub(crate) static USERDATA: RefCell<Vec<Userdata>> = RefCell::new(Vec::new());
}

Expand Down

0 comments on commit 844ea57

Please sign in to comment.