Skip to content

Commit 082dd6d

Browse files
author
Stjepan Glavina
committed
Fix a few run-pass tests
1 parent 27fae2b commit 082dd6d

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/test/run-pass/tls-init-on-init.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010

1111
// ignore-emscripten no threads support
1212

13-
#![feature(thread_local_state)]
14-
#![allow(deprecated)]
13+
#![feature(thread_local_try_with)]
1514

16-
use std::thread::{self, LocalKeyState};
15+
use std::thread;
1716
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
1817

1918
struct Foo { cnt: usize }
@@ -38,10 +37,8 @@ impl Drop for Foo {
3837
FOO.with(|foo| assert_eq!(foo.cnt, 0));
3938
} else {
4039
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");
4542
}
4643
}
4744
}

src/test/run-pass/tls-try-with.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// ignore-emscripten no threads support
1212

13-
#![feature(thread_local_state)]
13+
#![feature(thread_local_try_with)]
1414

1515
use std::thread;
1616

0 commit comments

Comments
 (0)