about summary refs log tree commit diff
path: root/tests/ui/codegen
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-06-03 17:47:38 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-06-04 17:48:50 +0500
commitff005610d5956cee82d4b2d162c3ee8da71e8164 (patch)
tree77396c729e1908f08fd74829f6c330b65b4492fd /tests/ui/codegen
parentc68032fd4c442d275f4daa571ba19c076106b490 (diff)
cleaned up some tests
Diffstat (limited to 'tests/ui/codegen')
-rw-r--r--tests/ui/codegen/rvalue-mut-ref-box-drop.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/codegen/rvalue-mut-ref-box-drop.rs b/tests/ui/codegen/rvalue-mut-ref-box-drop.rs
new file mode 100644
index 00000000000..441820ad64e
--- /dev/null
+++ b/tests/ui/codegen/rvalue-mut-ref-box-drop.rs
@@ -0,0 +1,13 @@
+//! 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));
+}