diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-12-07 20:48:12 +0200 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-12-10 17:46:31 +0200 |
| commit | b64ddecae8112ca41d9a37ed8a3ebfd388b7e453 (patch) | |
| tree | f5bac209b527bc063497be670f52d74cfb9a3aee /src/test/compile-fail/immut-function-arguments.rs | |
| parent | 97c58ed66ca20e849db0dc3942fb9735819909fd (diff) | |
| download | rust-b64ddecae8112ca41d9a37ed8a3ebfd388b7e453.tar.gz rust-b64ddecae8112ca41d9a37ed8a3ebfd388b7e453.zip | |
use `places_conflict` to handle reassignment
This fixes the handling of reassignment of struct fields.
Diffstat (limited to 'src/test/compile-fail/immut-function-arguments.rs')
| -rw-r--r-- | src/test/compile-fail/immut-function-arguments.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/compile-fail/immut-function-arguments.rs b/src/test/compile-fail/immut-function-arguments.rs index 949c1c0d9c4..b32056fcb91 100644 --- a/src/test/compile-fail/immut-function-arguments.rs +++ b/src/test/compile-fail/immut-function-arguments.rs @@ -8,14 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// revisions: ast mir +//[mir]compile-flags: -Z borrowck=mir fn f(y: Box<isize>) { - *y = 5; //~ ERROR cannot assign + *y = 5; //[ast]~ ERROR cannot assign + //[mir]~^ ERROR cannot assign twice } fn g() { - let _frob = |q: Box<isize>| { *q = 2; }; //~ ERROR cannot assign - + let _frob = |q: Box<isize>| { *q = 2; }; //[ast]~ ERROR cannot assign + //[mir]~^ ERROR cannot assign twice } fn main() {} |
