diff options
| author | bors <bors@rust-lang.org> | 2023-11-12 16:15:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-12 16:15:47 +0000 |
| commit | 9721690ac57705c3ba80daba5382a2741da3ae6c (patch) | |
| tree | c544e93bf338bb0e957c8d496b342c76d8fa64e3 | |
| parent | eb2c643bf14f800b5c90a96bb11f92380e2979f3 (diff) | |
| parent | 10c9e7594ed9a3936a18ad9cb7c75efe713eb2ed (diff) | |
| download | rust-9721690ac57705c3ba80daba5382a2741da3ae6c.tar.gz rust-9721690ac57705c3ba80daba5382a2741da3ae6c.zip | |
Auto merge of #3158 - RalfJung:tls-rename, r=RalfJung
more consistent naming for TLS tests "tls_static" for `#[thread_local] static`, "tls_macro" for `thread_local!`
| -rw-r--r-- | src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.rs (renamed from src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.rs) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr (renamed from src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr) | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs (renamed from src/tools/miri/tests/fail/panic/thread_local_drop_panic.rs) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr (renamed from src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr) | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tls/tls_static_dealloc.rs (renamed from src/tools/miri/tests/fail/concurrency/thread_local_static_dealloc.rs) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr (renamed from src/tools/miri/tests/fail/concurrency/thread_local_static_dealloc.stderr) | 4 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tls_macro_leak.rs (renamed from src/tools/miri/tests/fail/leak_in_lib_tls.rs) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tls_macro_leak.stderr (renamed from src/tools/miri/tests/fail/leak_in_lib_tls.stderr) | 8 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tls_static_leak.rs (renamed from src/tools/miri/tests/fail/leak_in_static_tls.rs) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tls_static_leak.stderr (renamed from src/tools/miri/tests/fail/leak_in_static_tls.stderr) | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_leak_main_thread_allowed.rs (renamed from src/tools/miri/tests/pass/concurrency/tls_leak_main_thread_allowed.rs) | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_macro_drop.rs (renamed from src/tools/miri/tests/pass/concurrency/tls_lib_drop.rs) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_macro_drop.stack.stdout (renamed from src/tools/miri/tests/pass/concurrency/tls_lib_drop.stack.stdout) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_macro_drop.tree.stdout (renamed from src/tools/miri/tests/pass/concurrency/tls_lib_drop.tree.stdout) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_macro_drop_single_thread.rs (renamed from src/tools/miri/tests/pass/concurrency/tls_lib_drop_single_thread.rs) | 3 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_macro_drop_single_thread.stderr (renamed from src/tools/miri/tests/pass/concurrency/tls_lib_drop_single_thread.stderr) | 0 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_static.rs (renamed from src/tools/miri/tests/pass/concurrency/thread_locals.rs) | 0 |
17 files changed, 13 insertions, 10 deletions
diff --git a/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.rs b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.rs index 93ad42ea1cc..93ad42ea1cc 100644 --- a/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.rs +++ b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.rs diff --git a/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr index 550d009607d..17e92fec6fd 100644 --- a/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr @@ -1,4 +1,4 @@ -thread $NAME panicked at $DIR/thread_local_const_drop_panic.rs:LL:CC: +thread $NAME panicked at $DIR/tls_macro_const_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/panic/thread_local_drop_panic.rs b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs index 107d70a3b3c..107d70a3b3c 100644 --- a/src/tools/miri/tests/fail/panic/thread_local_drop_panic.rs +++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs diff --git a/src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr index 3d6c41faabc..b1a384bbb52 100644 --- a/src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr @@ -1,4 +1,4 @@ -thread $NAME panicked at $DIR/thread_local_drop_panic.rs:LL:CC: +thread $NAME panicked at $DIR/tls_macro_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/concurrency/thread_local_static_dealloc.rs b/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs index d5e6d37226a..d5e6d37226a 100644 --- a/src/tools/miri/tests/fail/concurrency/thread_local_static_dealloc.rs +++ b/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs diff --git a/src/tools/miri/tests/fail/concurrency/thread_local_static_dealloc.stderr b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr index 7069e8cccfe..ae8a421ca40 100644 --- a/src/tools/miri/tests/fail/concurrency/thread_local_static_dealloc.stderr +++ b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/thread_local_static_dealloc.rs:LL:CC + --> $DIR/tls_static_dealloc.rs:LL:CC | LL | let _val = *dangling_ptr.0; | ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,7 +7,7 @@ LL | let _val = *dangling_ptr.0; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/thread_local_static_dealloc.rs:LL:CC + = note: inside `main` at $DIR/tls_static_dealloc.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/leak_in_lib_tls.rs b/src/tools/miri/tests/fail/tls_macro_leak.rs index 996d7ed4a23..996d7ed4a23 100644 --- a/src/tools/miri/tests/fail/leak_in_lib_tls.rs +++ b/src/tools/miri/tests/fail/tls_macro_leak.rs diff --git a/src/tools/miri/tests/fail/leak_in_lib_tls.stderr b/src/tools/miri/tests/fail/tls_macro_leak.stderr index e3c99710f8b..e9daa78543c 100644 --- a/src/tools/miri/tests/fail/leak_in_lib_tls.stderr +++ b/src/tools/miri/tests/fail/tls_macro_leak.stderr @@ -10,14 +10,14 @@ LL | __rust_alloc(layout.size(), layout.align()) = note: inside `alloc::alloc::exchange_malloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC = note: inside `std::boxed::Box::<i32>::new` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside closure - --> $DIR/leak_in_lib_tls.rs:LL:CC + --> $DIR/tls_macro_leak.rs:LL:CC | LL | cell.set(Some(Box::leak(Box::new(123)))); | ^^^^^^^^^^^^^ - = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::try_with::<{closure@$DIR/leak_in_lib_tls.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC - = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::with::<{closure@$DIR/leak_in_lib_tls.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC + = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::try_with::<{closure@$DIR/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC + = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::with::<{closure@$DIR/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC note: inside closure - --> $DIR/leak_in_lib_tls.rs:LL:CC + --> $DIR/tls_macro_leak.rs:LL:CC | LL | / TLS.with(|cell| { LL | | cell.set(Some(Box::leak(Box::new(123)))); diff --git a/src/tools/miri/tests/fail/leak_in_static_tls.rs b/src/tools/miri/tests/fail/tls_static_leak.rs index 637d648fb3f..637d648fb3f 100644 --- a/src/tools/miri/tests/fail/leak_in_static_tls.rs +++ b/src/tools/miri/tests/fail/tls_static_leak.rs diff --git a/src/tools/miri/tests/fail/leak_in_static_tls.stderr b/src/tools/miri/tests/fail/tls_static_leak.stderr index 7ef25a52c17..bcfaf80229a 100644 --- a/src/tools/miri/tests/fail/leak_in_static_tls.stderr +++ b/src/tools/miri/tests/fail/tls_static_leak.stderr @@ -10,7 +10,7 @@ LL | __rust_alloc(layout.size(), layout.align()) = note: inside `alloc::alloc::exchange_malloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC = note: inside `std::boxed::Box::<i32>::new` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside closure - --> $DIR/leak_in_static_tls.rs:LL:CC + --> $DIR/tls_static_leak.rs:LL:CC | LL | TLS.set(Some(Box::leak(Box::new(123)))); | ^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/pass/concurrency/tls_leak_main_thread_allowed.rs b/src/tools/miri/tests/pass/tls/tls_leak_main_thread_allowed.rs index 500b7a80892..7732e3f9217 100644 --- a/src/tools/miri/tests/pass/concurrency/tls_leak_main_thread_allowed.rs +++ b/src/tools/miri/tests/pass/tls/tls_leak_main_thread_allowed.rs @@ -5,6 +5,8 @@ use std::cell::Cell; // Thread-local variables in the main thread are basically like `static` (they live // as long as the program does), so make sure we treat them the same for leak purposes. +// +// The test covers both TLS statics and the TLS macro. pub fn main() { thread_local! { static TLS_KEY: Cell<Option<&'static i32>> = Cell::new(None); diff --git a/src/tools/miri/tests/pass/concurrency/tls_lib_drop.rs b/src/tools/miri/tests/pass/tls/tls_macro_drop.rs index bd06eec9cd5..bd06eec9cd5 100644 --- a/src/tools/miri/tests/pass/concurrency/tls_lib_drop.rs +++ b/src/tools/miri/tests/pass/tls/tls_macro_drop.rs diff --git a/src/tools/miri/tests/pass/concurrency/tls_lib_drop.stack.stdout b/src/tools/miri/tests/pass/tls/tls_macro_drop.stack.stdout index b7877820a0c..b7877820a0c 100644 --- a/src/tools/miri/tests/pass/concurrency/tls_lib_drop.stack.stdout +++ b/src/tools/miri/tests/pass/tls/tls_macro_drop.stack.stdout diff --git a/src/tools/miri/tests/pass/concurrency/tls_lib_drop.tree.stdout b/src/tools/miri/tests/pass/tls/tls_macro_drop.tree.stdout index b7877820a0c..b7877820a0c 100644 --- a/src/tools/miri/tests/pass/concurrency/tls_lib_drop.tree.stdout +++ b/src/tools/miri/tests/pass/tls/tls_macro_drop.tree.stdout diff --git a/src/tools/miri/tests/pass/concurrency/tls_lib_drop_single_thread.rs b/src/tools/miri/tests/pass/tls/tls_macro_drop_single_thread.rs index 2766ba36d12..f36c460ae53 100644 --- a/src/tools/miri/tests/pass/concurrency/tls_lib_drop_single_thread.rs +++ b/src/tools/miri/tests/pass/tls/tls_macro_drop_single_thread.rs @@ -1,4 +1,5 @@ -//! Check that destructors of the thread locals are executed on all OSes. +//! Check that destructors of the thread locals are executed on all OSes +//! (even when we do not support concurrency, and cannot run the other test). use std::cell::RefCell; diff --git a/src/tools/miri/tests/pass/concurrency/tls_lib_drop_single_thread.stderr b/src/tools/miri/tests/pass/tls/tls_macro_drop_single_thread.stderr index 09ec1c3c2c5..09ec1c3c2c5 100644 --- a/src/tools/miri/tests/pass/concurrency/tls_lib_drop_single_thread.stderr +++ b/src/tools/miri/tests/pass/tls/tls_macro_drop_single_thread.stderr diff --git a/src/tools/miri/tests/pass/concurrency/thread_locals.rs b/src/tools/miri/tests/pass/tls/tls_static.rs index fc4c8a283dd..fc4c8a283dd 100644 --- a/src/tools/miri/tests/pass/concurrency/thread_locals.rs +++ b/src/tools/miri/tests/pass/tls/tls_static.rs |
