Skip to content

Commit

Permalink
more consistent naming for TLS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 12, 2023
1 parent 6db4c80 commit e4db428
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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
|
= 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

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
| ^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
File renamed without changes.

0 comments on commit e4db428

Please sign in to comment.