File tree 5 files changed +8
-6
lines changed
5 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 50
50
#![ feature( control_flow_enum) ]
51
51
#![ feature( associated_type_defaults) ]
52
52
#![ feature( iter_zip) ]
53
+ #![ feature( thread_local_const_init) ]
53
54
#![ recursion_limit = "512" ]
54
55
55
56
#[ macro_use]
Original file line number Diff line number Diff line change @@ -1705,7 +1705,7 @@ pub mod tls {
1705
1705
#[ cfg( not( parallel_compiler) ) ]
1706
1706
thread_local ! {
1707
1707
/// 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 ) } ;
1709
1709
}
1710
1710
1711
1711
/// 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 {
55
55
}
56
56
57
57
thread_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 ) } ;
62
62
}
63
63
64
64
/// 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) {
1330
1330
// This cache is only used by `DummyHashStableContext`,
1331
1331
// so we won't pollute the cache values of the normal `StableHashingContext`
1332
1332
thread_local ! {
1333
- static CACHE : ExpnIdCache = Default :: default ( ) ;
1333
+ static CACHE : ExpnIdCache = const { ExpnIdCache :: new ( Vec :: new ( ) ) } ;
1334
1334
}
1335
1335
1336
1336
& CACHE
Original file line number Diff line number Diff line change 20
20
#![ feature( negative_impls) ]
21
21
#![ feature( nll) ]
22
22
#![ feature( min_specialization) ]
23
+ #![ feature( thread_local_const_init) ]
23
24
24
25
#[ macro_use]
25
26
extern crate rustc_macros;
You can’t perform that action at this time.
0 commit comments