1
Fork 0

Rollup merge of #120976 - matthiaskrgr:constify_TL_statics, r=lcnr

constify a couple thread_local statics
This commit is contained in:
Matthias Krüger 2024-03-04 22:16:30 +01:00 committed by GitHub
commit 706fe0b7d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -209,7 +209,7 @@ impl<'a> scoped_cell::ApplyL<'a> for BridgeStateL {
thread_local! {
static BRIDGE_STATE: scoped_cell::ScopedCell<BridgeStateL> =
scoped_cell::ScopedCell::new(BridgeState::NotConnected);
const { scoped_cell::ScopedCell::new(BridgeState::NotConnected) };
}
impl BridgeState<'_> {

View file

@ -223,7 +223,7 @@ thread_local! {
/// This is required as the thread-local state in the proc_macro client does
/// not handle being re-entered, and will invalidate all `Symbol`s when
/// entering a nested macro.
static ALREADY_RUNNING_SAME_THREAD: Cell<bool> = Cell::new(false);
static ALREADY_RUNNING_SAME_THREAD: Cell<bool> = const { Cell::new(false) };
}
/// Keep `ALREADY_RUNNING_SAME_THREAD` (see also its documentation)