rust/tests/ui/box/unit/unique-fn-arg-mut.rs
2024-02-16 20:02:50 +00:00

12 lines
157 B
Rust

//@ run-pass
fn f(i: &mut Box<isize>) {
*i = Box::new(200);
}
pub fn main() {
let mut i = Box::new(100);
f(&mut i);
assert_eq!(*i, 200);
}