File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 10
10
11
11
// ignore-emscripten no threads support
12
12
13
- #![ feature( thread_local_state) ]
14
- #![ allow( deprecated) ]
13
+ #![ feature( thread_local_try_with) ]
15
14
16
- use std:: thread:: { self , LocalKeyState } ;
15
+ use std:: thread;
17
16
use std:: sync:: atomic:: { AtomicUsize , Ordering , ATOMIC_USIZE_INIT } ;
18
17
19
18
struct Foo { cnt : usize }
@@ -38,10 +37,8 @@ impl Drop for Foo {
38
37
FOO . with ( |foo| assert_eq ! ( foo. cnt, 0 ) ) ;
39
38
} else {
40
39
assert_eq ! ( self . cnt, 0 ) ;
41
- match FOO . state ( ) {
42
- LocalKeyState :: Valid => panic ! ( "should not be in valid state" ) ,
43
- LocalKeyState :: Uninitialized |
44
- LocalKeyState :: Destroyed => { }
40
+ if FOO . try_with ( |_| ( ) ) . is_ok ( ) {
41
+ panic ! ( "should not be in valid state" ) ;
45
42
}
46
43
}
47
44
}
Original file line number Diff line number Diff line change 10
10
11
11
// ignore-emscripten no threads support
12
12
13
- #![ feature( thread_local_state ) ]
13
+ #![ feature( thread_local_try_with ) ]
14
14
15
15
use std:: thread;
16
16
You can’t perform that action at this time.
0 commit comments