rust/tests/ui/box/unit/unique-fn-arg-mut.rs

12 lines
156 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);
}