Skip to content

Commit

Permalink
Fix a few run-pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stjepan Glavina committed Feb 28, 2018
1 parent 27fae2b commit 082dd6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/test/run-pass/tls-init-on-init.rs
Expand Up @@ -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 }
Expand All @@ -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");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/tls-try-with.rs
Expand Up @@ -10,7 +10,7 @@

// ignore-emscripten no threads support

#![feature(thread_local_state)]
#![feature(thread_local_try_with)]

use std::thread;

Expand Down

0 comments on commit 082dd6d

Please sign in to comment.