mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00
14 lines
254 B
Rust
14 lines
254 B
Rust
//! 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));
|
|
}
|