diff options
Diffstat (limited to 'tests/ui/borrowck/immut-function-arguments.rs')
-rw-r--r-- | tests/ui/borrowck/immut-function-arguments.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/borrowck/immut-function-arguments.rs b/tests/ui/borrowck/immut-function-arguments.rs new file mode 100644 index 000000000..242a33e82 --- /dev/null +++ b/tests/ui/borrowck/immut-function-arguments.rs @@ -0,0 +1,9 @@ +fn f(y: Box<isize>) { + *y = 5; //~ ERROR cannot assign +} + +fn g() { + let _frob = |q: Box<isize>| { *q = 2; }; //~ ERROR cannot assign +} + +fn main() {} |