Files
rust/tests/ui/codegen/rvalue-mut-ref-box-drop.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
254 B
Rust
Raw Permalink Normal View History

2025-06-03 17:47:38 +05:00
//! Tests cleanup of a temporary `Box` rvalue passed as a mutable reference.
//!
//! - Issue: <https://github.com/rust-lang/rust/issues/7972>.
//@ run-pass
fn foo(x: &mut Box<u8>) {
*x = Box::new(5);
}
pub fn main() {
foo(&mut Box::new(4));
}