Fix a few run-pass tests

This commit is contained in:
Stjepan Glavina 2018-02-28 20:50:26 +01:00
parent 27fae2b24a
commit 082dd6d7af
2 changed files with 5 additions and 8 deletions

View file

@ -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");
}
}
}

View file

@ -10,7 +10,7 @@
// ignore-emscripten no threads support
#![feature(thread_local_state)]
#![feature(thread_local_try_with)]
use std::thread;