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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
156 B
Rust
Raw Normal View History

// 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);
}