diff options
Diffstat (limited to 'src/test/ui/thread-local')
-rw-r--r-- | src/test/ui/thread-local/name-collision.rs | 15 | ||||
-rw-r--r-- | src/test/ui/thread-local/non-static.rs | 30 | ||||
-rw-r--r-- | src/test/ui/thread-local/non-static.stderr | 38 | ||||
-rw-r--r-- | src/test/ui/thread-local/thread-local-issue-37508.rs | 36 | ||||
-rw-r--r-- | src/test/ui/thread-local/tls.rs | 14 |
5 files changed, 0 insertions, 133 deletions
diff --git a/src/test/ui/thread-local/name-collision.rs b/src/test/ui/thread-local/name-collision.rs deleted file mode 100644 index dcff9183a..000000000 --- a/src/test/ui/thread-local/name-collision.rs +++ /dev/null @@ -1,15 +0,0 @@ -// check-pass - -#[allow(non_camel_case_types)] -struct u8; - -std::thread_local! { - pub static A: i32 = f(); - pub static B: i32 = const { 0 }; -} - -fn f() -> i32 { - 0 -} - -fn main() {} diff --git a/src/test/ui/thread-local/non-static.rs b/src/test/ui/thread-local/non-static.rs deleted file mode 100644 index f1c427387..000000000 --- a/src/test/ui/thread-local/non-static.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Check that #[thread_local] attribute is rejected on non-static items. -#![feature(thread_local)] - -#[thread_local] -//~^ ERROR attribute should be applied to a static -const A: u32 = 0; - -#[thread_local] -//~^ ERROR attribute should be applied to a static -fn main() { - #[thread_local] || {}; - //~^ ERROR attribute should be applied to a static -} - -struct S { - #[thread_local] - //~^ ERROR attribute should be applied to a static - a: String, - b: String, -} - -#[thread_local] -// Static. OK. -static B: u32 = 0; - -extern "C" { - #[thread_local] - // Foreign static. OK. - static C: u32; -} diff --git a/src/test/ui/thread-local/non-static.stderr b/src/test/ui/thread-local/non-static.stderr deleted file mode 100644 index 09a1618d6..000000000 --- a/src/test/ui/thread-local/non-static.stderr +++ /dev/null @@ -1,38 +0,0 @@ -error: attribute should be applied to a static - --> $DIR/non-static.rs:4:1 - | -LL | #[thread_local] - | ^^^^^^^^^^^^^^^ -LL | -LL | const A: u32 = 0; - | ----------------- not a static - -error: attribute should be applied to a static - --> $DIR/non-static.rs:8:1 - | -LL | #[thread_local] - | ^^^^^^^^^^^^^^^ -LL | -LL | / fn main() { -LL | | #[thread_local] || {}; -LL | | -LL | | } - | |_- not a static - -error: attribute should be applied to a static - --> $DIR/non-static.rs:11:5 - | -LL | #[thread_local] || {}; - | ^^^^^^^^^^^^^^^ ----- not a static - -error: attribute should be applied to a static - --> $DIR/non-static.rs:16:5 - | -LL | #[thread_local] - | ^^^^^^^^^^^^^^^ -LL | -LL | a: String, - | --------- not a static - -error: aborting due to 4 previous errors - diff --git a/src/test/ui/thread-local/thread-local-issue-37508.rs b/src/test/ui/thread-local/thread-local-issue-37508.rs deleted file mode 100644 index 219108c77..000000000 --- a/src/test/ui/thread-local/thread-local-issue-37508.rs +++ /dev/null @@ -1,36 +0,0 @@ -// only-x86_64 -// compile-flags: -Ccode-model=large --crate-type lib -// build-pass -// -// Regression test for issue #37508 - -#![no_main] -#![no_std] -#![feature(thread_local, lang_items)] - -#[lang = "eh_personality"] -extern "C" fn eh_personality() {} - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic(_panic: &PanicInfo<'_>) -> ! { - loop {} -} - -pub struct BB; - -#[thread_local] -static mut KEY: Key = Key { inner: BB, dtor_running: false }; - -pub unsafe fn set() -> Option<&'static BB> { - if KEY.dtor_running { - return None; - } - Some(&KEY.inner) -} - -pub struct Key { - inner: BB, - dtor_running: bool, -} diff --git a/src/test/ui/thread-local/tls.rs b/src/test/ui/thread-local/tls.rs deleted file mode 100644 index fbd341388..000000000 --- a/src/test/ui/thread-local/tls.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -// ignore-emscripten no threads support -// compile-flags: -O - -#![feature(thread_local)] - -#[thread_local] -static S: u32 = 222; - -fn main() { - let local = &S as *const u32 as usize; - let foreign = std::thread::spawn(|| &S as *const u32 as usize).join().unwrap(); - assert_ne!(local, foreign); -} |