@@ -33,28 +33,25 @@ 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+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
37+ let _y = a. y ; //~ ERROR use of moved value
38+ //~^ NOTE value used here after move
4039}
4140
4241fn move_after_move ( ) {
4342 let a: Box < _ > = box B { x : box 0 , y : box 1 } ;
4443 let _x = a. x ;
45- //~^ value moved here
44+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
4645 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
46+ //~^ NOTE value used here after move
4947}
5048
5149fn borrow_after_move ( ) {
5250 let a: Box < _ > = box A { x : box 0 , y : 1 } ;
5351 let _x = a. x ;
54- //~^ value moved here
52+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
5553 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+ //~^ NOTE value used here after move
5855}
5956
6057fn move_after_borrow ( ) {
@@ -63,7 +60,7 @@ fn move_after_borrow() {
6360 //~^ NOTE borrow of `a.x` occurs here
6461 let _y = a. y ;
6562 //~^ ERROR cannot move
66- //~| move out of
63+ //~| NOTE move out of
6764}
6865
6966fn copy_after_mut_borrow ( ) {
@@ -80,15 +77,15 @@ fn move_after_mut_borrow() {
8077 //~^ NOTE borrow of `a.x` occurs here
8178 let _y = a. y ;
8279 //~^ ERROR cannot move
83- //~| move out of
80+ //~| NOTE move out of
8481}
8582
8683fn borrow_after_mut_borrow ( ) {
8784 let mut a: Box < _ > = box A { x : box 0 , y : 1 } ;
8885 let _x = & mut a. x ;
8986 //~^ NOTE mutable borrow occurs here (via `a.x`)
9087 let _y = & a. y ; //~ ERROR cannot borrow
91- //~^ immutable borrow occurs here (via `a.y`)
88+ //~^ NOTE immutable borrow occurs here (via `a.y`)
9289}
9390//~^ NOTE mutable borrow ends here
9491
@@ -97,44 +94,41 @@ fn mut_borrow_after_borrow() {
9794 let _x = & a. x ;
9895 //~^ NOTE immutable borrow occurs here (via `a.x`)
9996 let _y = & mut a. y ; //~ ERROR cannot borrow
100- //~^ mutable borrow occurs here (via `a.y`)
97+ //~^ NOTE mutable borrow occurs here (via `a.y`)
10198}
10299//~^ NOTE immutable borrow ends here
103100
104101fn copy_after_move_nested ( ) {
105102 let a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
106103 let _x = a. x . x ;
107- //~^ value moved here
104+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
108105 let _y = a. y ; //~ ERROR use of collaterally moved
109- //~^ NOTE move occurs because `a.x.x` has type `std::boxed::Box<isize>`
110- //~| value used here after move
106+ //~^ NOTE value used here after move
111107}
112108
113109fn move_after_move_nested ( ) {
114110 let a: Box < _ > = box D { x : box A { x : box 0 , y : 1 } , y : box 2 } ;
115111 let _x = a. x . x ;
116- //~^ value moved here
112+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
117113 let _y = a. y ; //~ ERROR use of collaterally moved
118- //~^ NOTE move occurs because `a.x.x` has type `std::boxed::Box<isize>`
119- //~| value used here after move
114+ //~^ NOTE value used here after move
120115}
121116
122117fn borrow_after_move_nested ( ) {
123118 let a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
124119 let _x = a. x . x ;
125- //~^ value moved here
120+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
126121 let _y = & a. y ; //~ ERROR use of collaterally moved
127- //~^ NOTE move occurs because `a.x.x` has type `std::boxed::Box<isize>`
128- //~| value used here after move
122+ //~^ NOTE value used here after move
129123}
130124
131125fn move_after_borrow_nested ( ) {
132126 let a: Box < _ > = box D { x : box A { x : box 0 , y : 1 } , y : box 2 } ;
133127 let _x = & a. x . x ;
134- //~^ borrow of `a.x.x` occurs here
128+ //~^ NOTE borrow of `a.x.x` occurs here
135129 let _y = a. y ;
136130 //~^ ERROR cannot move
137- //~| move out of
131+ //~| NOTE move out of
138132}
139133
140134fn copy_after_mut_borrow_nested ( ) {
@@ -151,24 +145,24 @@ fn move_after_mut_borrow_nested() {
151145 //~^ NOTE borrow of `a.x.x` occurs here
152146 let _y = a. y ;
153147 //~^ ERROR cannot move
154- //~| move out of
148+ //~| NOTE move out of
155149}
156150
157151fn borrow_after_mut_borrow_nested ( ) {
158152 let mut a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
159153 let _x = & mut a. x . x ;
160- //~^ mutable borrow occurs here
154+ //~^ NOTE mutable borrow occurs here
161155 let _y = & a. y ; //~ ERROR cannot borrow
162- //~^ immutable borrow occurs here
156+ //~^ NOTE immutable borrow occurs here
163157}
164158//~^ NOTE mutable borrow ends here
165159
166160fn mut_borrow_after_borrow_nested ( ) {
167161 let mut a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
168162 let _x = & a. x . x ;
169- //~^ immutable borrow occurs here
163+ //~^ NOTE immutable borrow occurs here
170164 let _y = & mut a. y ; //~ ERROR cannot borrow
171- //~^ mutable borrow occurs here
165+ //~^ NOTE mutable borrow occurs here
172166}
173167//~^ NOTE immutable borrow ends here
174168
0 commit comments