diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-06-03 17:47:38 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-06-04 17:48:50 +0500 |
| commit | ff005610d5956cee82d4b2d162c3ee8da71e8164 (patch) | |
| tree | 77396c729e1908f08fd74829f6c330b65b4492fd /tests/ui/codegen | |
| parent | c68032fd4c442d275f4daa571ba19c076106b490 (diff) | |
cleaned up some tests
Diffstat (limited to 'tests/ui/codegen')
| -rw-r--r-- | tests/ui/codegen/rvalue-mut-ref-box-drop.rs | 13 |
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)); +} |
