diff options
Diffstat (limited to 'tests/ui/unique/unique-fn-arg-mut.rs')
-rw-r--r-- | tests/ui/unique/unique-fn-arg-mut.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/unique/unique-fn-arg-mut.rs b/tests/ui/unique/unique-fn-arg-mut.rs new file mode 100644 index 000000000..01510200b --- /dev/null +++ b/tests/ui/unique/unique-fn-arg-mut.rs @@ -0,0 +1,11 @@ +// 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); +} |