Skip to content

Commit 2ee0698

Browse files
committed
constify a couple thread_local statics
1 parent 0a062ec commit 2ee0698

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

proc_macro/src/bridge/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl<'a> scoped_cell::ApplyL<'a> for BridgeStateL {
284284

285285
thread_local! {
286286
static BRIDGE_STATE: scoped_cell::ScopedCell<BridgeStateL> =
287-
scoped_cell::ScopedCell::new(BridgeState::NotConnected);
287+
const { scoped_cell::ScopedCell::new(BridgeState::NotConnected) };
288288
}
289289

290290
impl BridgeState<'_> {

proc_macro/src/bridge/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ thread_local! {
152152
/// This is required as the thread-local state in the proc_macro client does
153153
/// not handle being re-entered, and will invalidate all `Symbol`s when
154154
/// entering a nested macro.
155-
static ALREADY_RUNNING_SAME_THREAD: Cell<bool> = Cell::new(false);
155+
static ALREADY_RUNNING_SAME_THREAD: Cell<bool> = const { Cell::new(false) };
156156
}
157157

158158
/// Keep `ALREADY_RUNNING_SAME_THREAD` (see also its documentation)

0 commit comments

Comments
 (0)