@@ -34,7 +34,7 @@ async fn local_current_thread_scheduler() {
34
34
#[ tokio:: test( flavor = "multi_thread" ) ]
35
35
async fn local_threadpool ( ) {
36
36
thread_local ! {
37
- static ON_RT_THREAD : Cell <bool > = Cell :: new( false ) ;
37
+ static ON_RT_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
38
38
}
39
39
40
40
ON_RT_THREAD . with ( |cell| cell. set ( true ) ) ;
@@ -55,7 +55,7 @@ async fn local_threadpool() {
55
55
#[ tokio:: test( flavor = "multi_thread" ) ]
56
56
async fn localset_future_threadpool ( ) {
57
57
thread_local ! {
58
- static ON_LOCAL_THREAD : Cell <bool > = Cell :: new( false ) ;
58
+ static ON_LOCAL_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
59
59
}
60
60
61
61
ON_LOCAL_THREAD . with ( |cell| cell. set ( true ) ) ;
@@ -118,7 +118,7 @@ async fn local_threadpool_timer() {
118
118
// This test ensures that runtime services like the timer are properly
119
119
// set for the local task set.
120
120
thread_local ! {
121
- static ON_RT_THREAD : Cell <bool > = Cell :: new( false ) ;
121
+ static ON_RT_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
122
122
}
123
123
124
124
ON_RT_THREAD . with ( |cell| cell. set ( true ) ) ;
@@ -158,7 +158,7 @@ fn enter_guard_spawn() {
158
158
#[ should_panic]
159
159
fn local_threadpool_blocking_in_place ( ) {
160
160
thread_local ! {
161
- static ON_RT_THREAD : Cell <bool > = Cell :: new( false ) ;
161
+ static ON_RT_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
162
162
}
163
163
164
164
ON_RT_THREAD . with ( |cell| cell. set ( true ) ) ;
@@ -182,7 +182,7 @@ fn local_threadpool_blocking_in_place() {
182
182
#[ tokio:: test( flavor = "multi_thread" ) ]
183
183
async fn local_threadpool_blocking_run ( ) {
184
184
thread_local ! {
185
- static ON_RT_THREAD : Cell <bool > = Cell :: new( false ) ;
185
+ static ON_RT_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
186
186
}
187
187
188
188
ON_RT_THREAD . with ( |cell| cell. set ( true ) ) ;
@@ -212,7 +212,7 @@ async fn local_threadpool_blocking_run() {
212
212
async fn all_spawns_are_local ( ) {
213
213
use futures:: future;
214
214
thread_local ! {
215
- static ON_RT_THREAD : Cell <bool > = Cell :: new( false ) ;
215
+ static ON_RT_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
216
216
}
217
217
218
218
ON_RT_THREAD . with ( |cell| cell. set ( true ) ) ;
@@ -238,7 +238,7 @@ async fn all_spawns_are_local() {
238
238
#[ tokio:: test( flavor = "multi_thread" ) ]
239
239
async fn nested_spawn_is_local ( ) {
240
240
thread_local ! {
241
- static ON_RT_THREAD : Cell <bool > = Cell :: new( false ) ;
241
+ static ON_RT_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
242
242
}
243
243
244
244
ON_RT_THREAD . with ( |cell| cell. set ( true ) ) ;
@@ -274,7 +274,7 @@ async fn nested_spawn_is_local() {
274
274
#[ test]
275
275
fn join_local_future_elsewhere ( ) {
276
276
thread_local ! {
277
- static ON_RT_THREAD : Cell <bool > = Cell :: new( false ) ;
277
+ static ON_RT_THREAD : Cell <bool > = const { Cell :: new( false ) } ;
278
278
}
279
279
280
280
ON_RT_THREAD . with ( |cell| cell. set ( true ) ) ;
0 commit comments