This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
rustc_data_structures/src/sync
rustc_errors/src/markdown
library/proc_macro/src/bridge Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ pub struct Registry(Arc<RegistryData>);
4242thread_local ! {
4343 /// The registry associated with the thread.
4444 /// This allows the `WorkerLocal` type to clone the registry in its constructor.
45- static REGISTRY : OnceCell <Registry > = OnceCell :: new( ) ;
45+ static REGISTRY : OnceCell <Registry > = const { OnceCell :: new( ) } ;
4646}
4747
4848struct ThreadData {
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ const DEFAULT_COLUMN_WIDTH: usize = 140;
99
1010thread_local ! {
1111 /// Track the position of viewable characters in our buffer
12- static CURSOR : Cell <usize > = Cell :: new( 0 ) ;
12+ static CURSOR : Cell <usize > = const { Cell :: new( 0 ) } ;
1313 /// Width of the terminal
14- static WIDTH : Cell <usize > = Cell :: new( DEFAULT_COLUMN_WIDTH ) ;
14+ static WIDTH : Cell <usize > = const { Cell :: new( DEFAULT_COLUMN_WIDTH ) } ;
1515}
1616
1717/// Print to terminal output to a buffer
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ impl<'a> scoped_cell::ApplyL<'a> for BridgeStateL {
209209
210210thread_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
215215impl BridgeState < ' _ > {
Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments