Skip to content

Commit 10c9e75

Browse files
committed
more consistent naming for TLS tests
1 parent eb2c643 commit 10c9e75

17 files changed

+13
-10
lines changed

Diff for: src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr renamed to src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread $NAME panicked at $DIR/thread_local_const_drop_panic.rs:LL:CC:
1+
thread $NAME panicked at $DIR/tls_macro_const_drop_panic.rs:LL:CC:
22
ow
33
fatal runtime error: thread local panicked on drop
44
error: abnormal termination: the program aborted execution

Diff for: src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr renamed to src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread $NAME panicked at $DIR/thread_local_drop_panic.rs:LL:CC:
1+
thread $NAME panicked at $DIR/tls_macro_drop_panic.rs:LL:CC:
22
ow
33
fatal runtime error: thread local panicked on drop
44
error: abnormal termination: the program aborted execution

Diff for: src/tools/miri/tests/fail/concurrency/thread_local_static_dealloc.stderr renamed to src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
2-
--> $DIR/thread_local_static_dealloc.rs:LL:CC
2+
--> $DIR/tls_static_dealloc.rs:LL:CC
33
|
44
LL | let _val = *dangling_ptr.0;
55
| ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
10-
= note: inside `main` at $DIR/thread_local_static_dealloc.rs:LL:CC
10+
= note: inside `main` at $DIR/tls_static_dealloc.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1313

Diff for: src/tools/miri/tests/fail/leak_in_lib_tls.stderr renamed to src/tools/miri/tests/fail/tls_macro_leak.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ LL | __rust_alloc(layout.size(), layout.align())
1010
= note: inside `alloc::alloc::exchange_malloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
= note: inside `std::boxed::Box::<i32>::new` at RUSTLIB/alloc/src/boxed.rs:LL:CC
1212
note: inside closure
13-
--> $DIR/leak_in_lib_tls.rs:LL:CC
13+
--> $DIR/tls_macro_leak.rs:LL:CC
1414
|
1515
LL | cell.set(Some(Box::leak(Box::new(123))));
1616
| ^^^^^^^^^^^^^
17-
= 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
18-
= 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
17+
= 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
18+
= 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
1919
note: inside closure
20-
--> $DIR/leak_in_lib_tls.rs:LL:CC
20+
--> $DIR/tls_macro_leak.rs:LL:CC
2121
|
2222
LL | / TLS.with(|cell| {
2323
LL | | cell.set(Some(Box::leak(Box::new(123))));

Diff for: src/tools/miri/tests/fail/leak_in_static_tls.stderr renamed to src/tools/miri/tests/fail/tls_static_leak.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | __rust_alloc(layout.size(), layout.align())
1010
= note: inside `alloc::alloc::exchange_malloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
= note: inside `std::boxed::Box::<i32>::new` at RUSTLIB/alloc/src/boxed.rs:LL:CC
1212
note: inside closure
13-
--> $DIR/leak_in_static_tls.rs:LL:CC
13+
--> $DIR/tls_static_leak.rs:LL:CC
1414
|
1515
LL | TLS.set(Some(Box::leak(Box::new(123))));
1616
| ^^^^^^^^^^^^^

Diff for: src/tools/miri/tests/pass/concurrency/tls_leak_main_thread_allowed.rs renamed to src/tools/miri/tests/pass/tls/tls_leak_main_thread_allowed.rs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use std::cell::Cell;
55

66
// Thread-local variables in the main thread are basically like `static` (they live
77
// as long as the program does), so make sure we treat them the same for leak purposes.
8+
//
9+
// The test covers both TLS statics and the TLS macro.
810
pub fn main() {
911
thread_local! {
1012
static TLS_KEY: Cell<Option<&'static i32>> = Cell::new(None);

Diff for: src/tools/miri/tests/pass/concurrency/tls_lib_drop_single_thread.rs renamed to src/tools/miri/tests/pass/tls/tls_macro_drop_single_thread.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//! Check that destructors of the thread locals are executed on all OSes.
1+
//! Check that destructors of the thread locals are executed on all OSes
2+
//! (even when we do not support concurrency, and cannot run the other test).
23
34
use std::cell::RefCell;
45

0 commit comments

Comments
 (0)