|
| 1 | +error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here: |
| 2 | + --> RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 3 | + | |
| 4 | +LL | __rust_alloc(layout.size(), layout.align()) |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: inside `std::alloc::alloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 8 | + = note: inside `std::alloc::Global::alloc_impl` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 9 | + = note: inside `<std::alloc::Global as std::alloc::Allocator>::allocate` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 10 | + = note: inside `alloc::alloc::exchange_malloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 11 | + = note: inside `std::boxed::Box::<i32>::new` at RUSTLIB/alloc/src/boxed.rs:LL:CC |
| 12 | +note: inside closure |
| 13 | + --> $DIR/leak_in_tls.rs:LL:CC |
| 14 | + | |
| 15 | +LL | let b = Box::new(a); |
| 16 | + | ^^^^^^^^^^^ |
| 17 | + = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::try_with::<[closure@$DIR/leak_in_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_tls.rs:LL:CC], ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC |
| 19 | +note: inside closure |
| 20 | + --> $DIR/leak_in_tls.rs:LL:CC |
| 21 | + | |
| 22 | +LL | / REF.with(|cell| { |
| 23 | +LL | | let a = 123; |
| 24 | +LL | | let b = Box::new(a); |
| 25 | +LL | | let r = Box::leak(b); |
| 26 | +LL | | cell.set(Some(r)); |
| 27 | +LL | | }) |
| 28 | + | |__________^ |
| 29 | + |
| 30 | +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace |
| 31 | + |
| 32 | +note: the evaluated program leaked memory, pass `-Zmiri-ignore-leaks` to disable this check |
| 33 | + |
| 34 | +error: aborting due to previous error |
| 35 | + |
0 commit comments