This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +8
-6
lines changed Expand file tree Collapse file tree 5 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 5050#![ feature( control_flow_enum) ]
5151#![ feature( associated_type_defaults) ]
5252#![ feature( iter_zip) ]
53+ #![ feature( thread_local_const_init) ]
5354#![ recursion_limit = "512" ]
5455
5556#[ macro_use]
Original file line number Diff line number Diff line change @@ -1705,7 +1705,7 @@ pub mod tls {
17051705 #[ cfg( not( parallel_compiler) ) ]
17061706 thread_local ! {
17071707 /// A thread local variable that stores a pointer to the current `ImplicitCtxt`.
1708- static TLV : Cell <usize > = Cell :: new( 0 ) ;
1708+ static TLV : Cell <usize > = const { Cell :: new( 0 ) } ;
17091709 }
17101710
17111711 /// Sets TLV to `value` during the call to `f`.
Original file line number Diff line number Diff line change @@ -55,10 +55,10 @@ macro_rules! define_scoped_cx {
5555}
5656
5757thread_local ! {
58- static FORCE_IMPL_FILENAME_LINE : Cell <bool > = Cell :: new( false ) ;
59- static SHOULD_PREFIX_WITH_CRATE : Cell <bool > = Cell :: new( false ) ;
60- static NO_TRIMMED_PATH : Cell <bool > = Cell :: new( false ) ;
61- static NO_QUERIES : Cell <bool > = Cell :: new( false ) ;
58+ static FORCE_IMPL_FILENAME_LINE : Cell <bool > = const { Cell :: new( false ) } ;
59+ static SHOULD_PREFIX_WITH_CRATE : Cell <bool > = const { Cell :: new( false ) } ;
60+ static NO_TRIMMED_PATH : Cell <bool > = const { Cell :: new( false ) } ;
61+ static NO_QUERIES : Cell <bool > = const { Cell :: new( false ) } ;
6262}
6363
6464/// Avoids running any queries during any prints that occur
Original file line number Diff line number Diff line change @@ -1330,7 +1330,7 @@ fn update_disambiguator(expn_id: ExpnId) {
13301330 // This cache is only used by `DummyHashStableContext`,
13311331 // so we won't pollute the cache values of the normal `StableHashingContext`
13321332 thread_local ! {
1333- static CACHE : ExpnIdCache = Default :: default ( ) ;
1333+ static CACHE : ExpnIdCache = const { ExpnIdCache :: new ( Vec :: new ( ) ) } ;
13341334 }
13351335
13361336 & CACHE
Original file line number Diff line number Diff line change 2020#![ feature( negative_impls) ]
2121#![ feature( nll) ]
2222#![ feature( min_specialization) ]
23+ #![ feature( thread_local_const_init) ]
2324
2425#[ macro_use]
2526extern crate rustc_macros;
You can’t perform that action at this time.
0 commit comments