Skip to content

Commit d9b51b0

Browse files
Fix memory leak in os impl
1 parent 4b79b21 commit d9b51b0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/pass/thread_local-panic.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
thread_local! {
2+
static LOCAL: u64 = panic!();
3+
4+
}
5+
6+
fn main() {
7+
let _ = std::panic::catch_unwind(|| LOCAL.with(|_| {}));
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
thread 'main' ($TID) panicked at tests/pass/thread_local-panic.rs:LL:CC:
3+
explicit panic
4+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
5+
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

0 commit comments

Comments
 (0)