13
13
14
14
// ignore-tidy-linelength
15
15
// revisions: ast mir
16
- //[mir]compile-flags: -Z emit-end-regions -Z borrowck- mir
16
+ //[mir]compile-flags: -Z borrowck= mir
17
17
18
18
#![ feature( box_syntax) ]
19
19
@@ -29,48 +29,42 @@ fn a() {
29
29
let mut x = 3 ;
30
30
let c1 = || x = 4 ;
31
31
let c2 = || x * 5 ; //[ast]~ ERROR cannot borrow `x`
32
- //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable (Ast)
33
- //[mir]~| ERROR cannot borrow `x` as immutable because it is also borrowed as mutable (Mir)
32
+ //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
34
33
}
35
34
36
35
fn b ( ) {
37
36
let mut x = 3 ;
38
37
let c1 = || set ( & mut x) ;
39
38
let c2 = || get ( & x) ; //[ast]~ ERROR cannot borrow `x`
40
- //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable (Ast)
41
- //[mir]~| ERROR cannot borrow `x` as immutable because it is also borrowed as mutable (Mir)
39
+ //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
42
40
}
43
41
44
42
fn c ( ) {
45
43
let mut x = 3 ;
46
44
let c1 = || set ( & mut x) ;
47
45
let c2 = || x * 5 ; //[ast]~ ERROR cannot borrow `x`
48
- //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable (Ast)
49
- //[mir]~| ERROR cannot borrow `x` as immutable because it is also borrowed as mutable (Mir)
46
+ //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
50
47
}
51
48
52
49
fn d ( ) {
53
50
let mut x = 3 ;
54
51
let c2 = || x * 5 ;
55
52
x = 5 ; //[ast]~ ERROR cannot assign
56
- //[mir]~^ ERROR cannot assign to `x` because it is borrowed (Ast)
57
- //[mir]~| ERROR cannot assign to `x` because it is borrowed (Mir)
53
+ //[mir]~^ ERROR cannot assign to `x` because it is borrowed
58
54
}
59
55
60
56
fn e ( ) {
61
57
let mut x = 3 ;
62
58
let c1 = || get ( & x) ;
63
59
x = 5 ; //[ast]~ ERROR cannot assign
64
- //[mir]~^ ERROR cannot assign to `x` because it is borrowed (Ast)
65
- //[mir]~| ERROR cannot assign to `x` because it is borrowed (Mir)
60
+ //[mir]~^ ERROR cannot assign to `x` because it is borrowed
66
61
}
67
62
68
63
fn f ( ) {
69
64
let mut x: Box < _ > = box 3 ;
70
65
let c1 = || get ( & * x) ;
71
- * x = 5 ; //[ast]~ ERROR cannot assign
72
- //[mir]~^ ERROR cannot assign to `*x` because it is borrowed (Ast)
73
- //[mir]~| ERROR cannot assign to `*x` because it is borrowed (Mir)
66
+ * x = 5 ; //[ast]~ ERROR cannot assign to `*x`
67
+ //[mir]~^ ERROR cannot assign to `*x` because it is borrowed
74
68
}
75
69
76
70
fn g ( ) {
@@ -81,8 +75,7 @@ fn g() {
81
75
let mut x: Box < _ > = box Foo { f : box 3 } ;
82
76
let c1 = || get ( & * x. f ) ;
83
77
* x. f = 5 ; //[ast]~ ERROR cannot assign to `*x.f`
84
- //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed (Ast)
85
- //[mir]~| ERROR cannot assign to `*x.f` because it is borrowed (Mir)
78
+ //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed
86
79
}
87
80
88
81
fn h ( ) {
@@ -93,8 +86,7 @@ fn h() {
93
86
let mut x: Box < _ > = box Foo { f : box 3 } ;
94
87
let c1 = || get ( & * x. f ) ;
95
88
let c2 = || * x. f = 5 ; //[ast]~ ERROR cannot borrow `x` as mutable
96
- //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable (Ast)
97
- //[mir]~| ERROR cannot borrow `x` as mutable because it is also borrowed as immutable (Mir)
89
+ //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
98
90
}
99
91
100
92
fn main ( ) {
0 commit comments