File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 7
7
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
- //compile-flags: -Z emit-end-regions -Z borrowck-mir -Z mir
10
+ //revisions: ast mir
11
+ //[mir] compile-flags: -Z emit-end-regions -Z borrowck-mir -Z nll
11
12
12
13
#![ allow( unused_assignments) ]
13
14
14
15
struct Wrap < ' a > { w : & ' a mut u32 }
15
16
16
17
fn foo ( ) {
17
- let mut x = 22u64 ;
18
+ let mut x = 22 ;
18
19
let wrapper = Wrap { w : & mut x } ;
19
- x += 1 ; //~ ERROR cannot assign to `x`
20
+ //~^ ERROR cannot assign to `x` because it is borrowed (Mir) [E0506]
21
+ //~^^ ERROR cannot use `x` because it was mutably borrowed (Mir) [E0503]
22
+ x += 1 ; //[ast]~ ERROR cannot assign to `x` because it is borrowed [E0506]
23
+ //[mir]~^ ERROR cannot assign to `x` because it is borrowed (Ast) [E0506]
24
+ //[mir]~^^ ERROR cannot assign to `x` because it is borrowed (Mir) [E0506]
25
+ //[mir]~^^^ ERROR cannot use `x` because it was mutably borrowed (Mir) [E0503]
20
26
* wrapper. w += 1 ;
21
27
}
22
28
You can’t perform that action at this time.
0 commit comments