Skip to content

Commit 7bdf177

Browse files
committed
mir-borrowck: Fix existing tests
1 parent ff8ea69 commit 7bdf177

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/test/compile-fail/borrowck/borrowck-assign-comp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn a() {
2222
// immutable. Otherwise the type of &_q.x (&isize) would be wrong.
2323
p.x = 5; //[ast]~ ERROR cannot assign to `p.x`
2424
//[mir]~^ ERROR cannot assign to `p.x` because it is borrowed (Ast)
25-
//[mir]~| ERROR cannot assign to `p.0` because it is borrowed (Mir)
25+
//[mir]~| ERROR cannot assign to `p.x` because it is borrowed (Mir)
2626
q.x;
2727
}
2828

@@ -47,7 +47,7 @@ fn d() {
4747
let q = &p.y;
4848
p.y = 5; //[ast]~ ERROR cannot assign to `p.y`
4949
//[mir]~^ ERROR cannot assign to `p.y` because it is borrowed (Ast)
50-
//[mir]~| ERROR cannot assign to `p.1` because it is borrowed (Mir)
50+
//[mir]~| ERROR cannot assign to `p.y` because it is borrowed (Mir)
5151
*q;
5252
}
5353

src/test/compile-fail/borrowck/borrowck-closures-mut-and-imm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn g() {
8282
let c1 = || get(&*x.f);
8383
*x.f = 5; //[ast]~ ERROR cannot assign to `*x.f`
8484
//[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed (Ast)
85-
//[mir]~| ERROR cannot assign to `(*(*x).0)` because it is borrowed (Mir)
85+
//[mir]~| ERROR cannot assign to `(*x.f)` because it is borrowed (Mir)
8686
}
8787

8888
fn h() {

src/test/compile-fail/borrowck/borrowck-union-borrow.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ fn main() {
3434
let ra = &u.a;
3535
let rma = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable
3636
//[mir]~^ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable (Ast)
37-
//[mir]~| ERROR cannot borrow `u.0` as mutable because it is also borrowed as immutable (Mir)
37+
//[mir]~| ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable (Mir)
3838
}
3939
{
4040
let ra = &u.a;
4141
u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed
4242
//[mir]~^ ERROR cannot assign to `u.a` because it is borrowed (Ast)
43-
//[mir]~| ERROR cannot assign to `u.0` because it is borrowed (Mir)
43+
//[mir]~| ERROR cannot assign to `u.a` because it is borrowed (Mir)
4444
}
4545
// Imm borrow, other field
4646
{
@@ -68,25 +68,25 @@ fn main() {
6868
let rma = &mut u.a;
6969
let ra = &u.a; //[ast]~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable
7070
//[mir]~^ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable (Ast)
71-
//[mir]~| ERROR cannot borrow `u.0` as immutable because it is also borrowed as mutable (Mir)
71+
//[mir]~| ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable (Mir)
7272
}
7373
{
7474
let ra = &mut u.a;
7575
let a = u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
7676
//[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed (Ast)
77-
//[mir]~| ERROR cannot use `u.0` because it was mutably borrowed (Mir)
77+
//[mir]~| ERROR cannot use `u.a` because it was mutably borrowed (Mir)
7878
}
7979
{
8080
let rma = &mut u.a;
8181
let rma2 = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable more than once at a time
8282
//[mir]~^ ERROR cannot borrow `u.a` as mutable more than once at a time (Ast)
83-
//[mir]~| ERROR cannot borrow `u.0` as mutable more than once at a time (Mir)
83+
//[mir]~| ERROR cannot borrow `u.a` as mutable more than once at a time (Mir)
8484
}
8585
{
8686
let rma = &mut u.a;
8787
u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed
8888
//[mir]~^ ERROR cannot assign to `u.a` because it is borrowed (Ast)
89-
//[mir]~| ERROR cannot assign to `u.0` because it is borrowed (Mir)
89+
//[mir]~| ERROR cannot assign to `u.a` because it is borrowed (Mir)
9090
}
9191
// Mut borrow, other field
9292
{

0 commit comments

Comments
 (0)