Skip to content

Commit 485026e

Browse files
committed
moved renamed docs | cancel-clean-via-immediate-rvalue-ref.rs
1 parent 92001aa commit 485026e

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

tests/ui/cancel-clean-via-immediate-rvalue-ref.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//! Tests cleanup of a temporary `Box` rvalue passed as a mutable reference.
2+
//!
3+
//! - Issue: <https://github.com/rust-lang/rust/issues/7972>.
4+
5+
//@ run-pass
6+
7+
fn foo(x: &mut Box<u8>) {
8+
*x = Box::new(5);
9+
}
10+
11+
pub fn main() {
12+
foo(&mut Box::new(4));
13+
}

0 commit comments

Comments
 (0)