Skip to content

Commit fe32df9

Browse files
Nashenas88nikomatsakis
authored andcommitted
Fix failing test
1 parent 19c1736 commit fe32df9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/test/compile-fail/aggregate-rvalues-typeck.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// 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
1112

1213
#![allow(unused_assignments)]
1314

1415
struct Wrap<'a> { w: &'a mut u32 }
1516

1617
fn foo() {
17-
let mut x = 22u64;
18+
let mut x = 22;
1819
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]
2026
*wrapper.w += 1;
2127
}
2228

0 commit comments

Comments
 (0)