Skip to content

Commit e293779

Browse files
authored
Rollup merge of rust-lang#120976 - matthiaskrgr:constify_TL_statics, r=lcnr
constify a couple thread_local statics
2 parents 3e797a3 + 2ee0698 commit e293779

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
@@ -209,7 +209,7 @@ impl<'a> scoped_cell::ApplyL<'a> for BridgeStateL {
209209

210210
thread_local! {
211211
static BRIDGE_STATE: scoped_cell::ScopedCell<BridgeStateL> =
212-
scoped_cell::ScopedCell::new(BridgeState::NotConnected);
212+
const { scoped_cell::ScopedCell::new(BridgeState::NotConnected) };
213213
}
214214

215215
impl BridgeState<'_> {

proc_macro/src/bridge/server.rs

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

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

0 commit comments

Comments
 (0)