diff options
| author | Stjepan Glavina <stjepang@gmail.com> | 2018-02-28 20:50:26 +0100 |
|---|---|---|
| committer | Stjepan Glavina <stjepang@gmail.com> | 2018-02-28 20:52:38 +0100 |
| commit | 082dd6d7af37ac76d99147ae7242080d4f5c74aa (patch) | |
| tree | cb74380564fcafa53bd805f75ed15bcaf97d7df9 /src | |
| parent | 27fae2b24af48041ceea6e04c7f217d3db372164 (diff) | |
| download | rust-082dd6d7af37ac76d99147ae7242080d4f5c74aa.tar.gz rust-082dd6d7af37ac76d99147ae7242080d4f5c74aa.zip | |
Fix a few run-pass tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/run-pass/tls-init-on-init.rs | 11 | ||||
| -rw-r--r-- | src/test/run-pass/tls-try-with.rs | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/test/run-pass/tls-init-on-init.rs b/src/test/run-pass/tls-init-on-init.rs index b5b9fb561ae..48a0d4a99ec 100644 --- a/src/test/run-pass/tls-init-on-init.rs +++ b/src/test/run-pass/tls-init-on-init.rs @@ -10,10 +10,9 @@ // ignore-emscripten no threads support -#![feature(thread_local_state)] -#![allow(deprecated)] +#![feature(thread_local_try_with)] -use std::thread::{self, LocalKeyState}; +use std::thread; use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; struct Foo { cnt: usize } @@ -38,10 +37,8 @@ impl Drop for Foo { FOO.with(|foo| assert_eq!(foo.cnt, 0)); } else { assert_eq!(self.cnt, 0); - match FOO.state() { - LocalKeyState::Valid => panic!("should not be in valid state"), - LocalKeyState::Uninitialized | - LocalKeyState::Destroyed => {} + if FOO.try_with(|_| ()).is_ok() { + panic!("should not be in valid state"); } } } diff --git a/src/test/run-pass/tls-try-with.rs b/src/test/run-pass/tls-try-with.rs index c072ec0679d..552f4c5e829 100644 --- a/src/test/run-pass/tls-try-with.rs +++ b/src/test/run-pass/tls-try-with.rs @@ -10,7 +10,7 @@ // ignore-emscripten no threads support -#![feature(thread_local_state)] +#![feature(thread_local_try_with)] use std::thread; |
