@@ -33,131 +33,131 @@ struct D {
3333fn copy_after_move ( ) {
3434 let a: Box < _ > = box A { x : box 0 , y : 1 } ;
3535 let _x = a. x ;
36- //~^ value moved here
37- let _y = a. y ; //~ ERROR use of moved
38- //~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
39- //~| value used here after move
36+ //[ast] ~^ value moved here
37+ let _y = a. y ; //[ast] ~ ERROR use of moved
38+ //[ast] ~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
39+ //[ast] ~| value used here after move
4040}
4141
4242fn move_after_move ( ) {
4343 let a: Box < _ > = box B { x : box 0 , y : box 1 } ;
4444 let _x = a. x ;
45- //~^ value moved here
46- let _y = a. y ; //~ ERROR use of moved
47- //~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
48- //~| value used here after move
45+ //[ast] ~^ value moved here
46+ let _y = a. y ; //[ast] ~ ERROR use of moved
47+ //[ast] ~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
48+ //[ast] ~| value used here after move
4949}
5050
5151fn borrow_after_move ( ) {
5252 let a: Box < _ > = box A { x : box 0 , y : 1 } ;
5353 let _x = a. x ;
54- //~^ value moved here
55- let _y = & a. y ; //~ ERROR use of moved
56- //~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
57- //~| value used here after move
54+ //[ast] ~^ value moved here
55+ let _y = & a. y ; //[ast] ~ ERROR use of moved
56+ //[ast] ~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
57+ //[ast] ~| value used here after move
5858}
5959
6060fn move_after_borrow ( ) {
6161 let a: Box < _ > = box B { x : box 0 , y : box 1 } ;
6262 let _x = & a. x ;
6363 let _y = a. y ;
64- //~^ ERROR cannot move
65- //~| move out of
64+ //[ast] ~^ ERROR cannot move
65+ //[ast] ~| move out of
6666 use_imm ( _x) ;
6767}
6868fn copy_after_mut_borrow ( ) {
6969 let mut a: Box < _ > = box A { x : box 0 , y : 1 } ;
7070 let _x = & mut a. x ;
71- let _y = a. y ; //~ ERROR cannot use
71+ let _y = a. y ; //[ast] ~ ERROR cannot use
7272 use_mut ( _x) ;
7373}
7474fn move_after_mut_borrow ( ) {
7575 let mut a: Box < _ > = box B { x : box 0 , y : box 1 } ;
7676 let _x = & mut a. x ;
7777 let _y = a. y ;
78- //~^ ERROR cannot move
79- //~| move out of
78+ //[ast] ~^ ERROR cannot move
79+ //[ast] ~| move out of
8080 use_mut ( _x) ;
8181}
8282fn borrow_after_mut_borrow ( ) {
8383 let mut a: Box < _ > = box A { x : box 0 , y : 1 } ;
8484 let _x = & mut a. x ;
85- let _y = & a. y ; //~ ERROR cannot borrow
86- //~^ immutable borrow occurs here (via `a.y`)
85+ let _y = & a. y ; //[ast] ~ ERROR cannot borrow
86+ //[ast] ~^ immutable borrow occurs here (via `a.y`)
8787 use_mut ( _x) ;
8888}
8989fn mut_borrow_after_borrow ( ) {
9090 let mut a: Box < _ > = box A { x : box 0 , y : 1 } ;
9191 let _x = & a. x ;
92- let _y = & mut a. y ; //~ ERROR cannot borrow
93- //~^ mutable borrow occurs here (via `a.y`)
92+ let _y = & mut a. y ; //[ast] ~ ERROR cannot borrow
93+ //[ast] ~^ mutable borrow occurs here (via `a.y`)
9494 use_imm ( _x) ;
9595}
9696fn copy_after_move_nested ( ) {
9797 let a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
9898 let _x = a. x . x ;
99- //~^ value moved here
100- let _y = a. y ; //~ ERROR use of collaterally moved
101- //~| value used here after move
99+ //[ast] ~^ value moved here
100+ let _y = a. y ; //[ast] ~ ERROR use of collaterally moved
101+ //[ast] ~| value used here after move
102102}
103103
104104fn move_after_move_nested ( ) {
105105 let a: Box < _ > = box D { x : box A { x : box 0 , y : 1 } , y : box 2 } ;
106106 let _x = a. x . x ;
107- //~^ value moved here
108- let _y = a. y ; //~ ERROR use of collaterally moved
109- //~| value used here after move
107+ //[ast] ~^ value moved here
108+ let _y = a. y ; //[ast] ~ ERROR use of collaterally moved
109+ //[ast] ~| value used here after move
110110}
111111
112112fn borrow_after_move_nested ( ) {
113113 let a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
114114 let _x = a. x . x ;
115- //~^ value moved here
116- let _y = & a. y ; //~ ERROR use of collaterally moved
117- //~| value used here after move
115+ //[ast] ~^ value moved here
116+ let _y = & a. y ; //[ast] ~ ERROR use of collaterally moved
117+ //[ast] ~| value used here after move
118118}
119119
120120fn move_after_borrow_nested ( ) {
121121 let a: Box < _ > = box D { x : box A { x : box 0 , y : 1 } , y : box 2 } ;
122122 let _x = & a. x . x ;
123- //~^ borrow of `a.x.x` occurs here
123+ //[ast] ~^ borrow of `a.x.x` occurs here
124124 let _y = a. y ;
125- //~^ ERROR cannot move
126- //~| move out of
125+ //[ast] ~^ ERROR cannot move
126+ //[ast] ~| move out of
127127 use_imm ( _x) ;
128128}
129129fn copy_after_mut_borrow_nested ( ) {
130130 let mut a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
131131 let _x = & mut a. x . x ;
132- let _y = a. y ; //~ ERROR cannot use
132+ let _y = a. y ; //[ast] ~ ERROR cannot use
133133 use_mut ( _x) ;
134134}
135135fn move_after_mut_borrow_nested ( ) {
136136 let mut a: Box < _ > = box D { x : box A { x : box 0 , y : 1 } , y : box 2 } ;
137137 let _x = & mut a. x . x ;
138138 let _y = a. y ;
139- //~^ ERROR cannot move
140- //~| move out of
139+ //[ast] ~^ ERROR cannot move
140+ //[ast] ~| move out of
141141 use_mut ( _x) ;
142142}
143143fn borrow_after_mut_borrow_nested ( ) {
144144 let mut a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
145145 let _x = & mut a. x . x ;
146- //~^ mutable borrow occurs here
147- let _y = & a. y ; //~ ERROR cannot borrow
148- //~^ immutable borrow occurs here
146+ //[ast] ~^ mutable borrow occurs here
147+ let _y = & a. y ; //[ast] ~ ERROR cannot borrow
148+ //[ast] ~^ immutable borrow occurs here
149149 use_mut ( _x) ;
150150}
151151fn mut_borrow_after_borrow_nested ( ) {
152152 let mut a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
153153 let _x = & a. x . x ;
154- //~^ immutable borrow occurs here
155- let _y = & mut a. y ; //~ ERROR cannot borrow
156- //~^ mutable borrow occurs here
154+ //[ast] ~^ immutable borrow occurs here
155+ let _y = & mut a. y ; //[ast] ~ ERROR cannot borrow
156+ //[ast] ~^ mutable borrow occurs here
157157 use_imm ( _x) ;
158158}
159159#[ rustc_error]
160- fn main ( ) {
160+ fn main ( ) { //[mir]~ ERROR compilation successful
161161 copy_after_move ( ) ;
162162 move_after_move ( ) ;
163163 borrow_after_move ( ) ;
0 commit comments