@@ -33,28 +33,25 @@ struct D {
33
33
fn copy_after_move ( ) {
34
34
let a: Box < _ > = box A { x : box 0 , y : 1 } ;
35
35
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
40
39
}
41
40
42
41
fn move_after_move ( ) {
43
42
let a: Box < _ > = box B { x : box 0 , y : box 1 } ;
44
43
let _x = a. x ;
45
- //~^ value moved here
44
+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
46
45
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
49
47
}
50
48
51
49
fn borrow_after_move ( ) {
52
50
let a: Box < _ > = box A { x : box 0 , y : 1 } ;
53
51
let _x = a. x ;
54
- //~^ value moved here
52
+ //~^ NOTE value moved here because it has type `std::boxed::Box<isize>`, which does not
55
53
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
58
55
}
59
56
60
57
fn move_after_borrow ( ) {
@@ -63,7 +60,7 @@ fn move_after_borrow() {
63
60
//~^ NOTE borrow of `a.x` occurs here
64
61
let _y = a. y ;
65
62
//~^ ERROR cannot move
66
- //~| move out of
63
+ //~| NOTE move out of
67
64
}
68
65
69
66
fn copy_after_mut_borrow ( ) {
@@ -80,15 +77,15 @@ fn move_after_mut_borrow() {
80
77
//~^ NOTE borrow of `a.x` occurs here
81
78
let _y = a. y ;
82
79
//~^ ERROR cannot move
83
- //~| move out of
80
+ //~| NOTE move out of
84
81
}
85
82
86
83
fn borrow_after_mut_borrow ( ) {
87
84
let mut a: Box < _ > = box A { x : box 0 , y : 1 } ;
88
85
let _x = & mut a. x ;
89
86
//~^ NOTE mutable borrow occurs here (via `a.x`)
90
87
let _y = & a. y ; //~ ERROR cannot borrow
91
- //~^ immutable borrow occurs here (via `a.y`)
88
+ //~^ NOTE immutable borrow occurs here (via `a.y`)
92
89
}
93
90
//~^ NOTE mutable borrow ends here
94
91
@@ -97,44 +94,41 @@ fn mut_borrow_after_borrow() {
97
94
let _x = & a. x ;
98
95
//~^ NOTE immutable borrow occurs here (via `a.x`)
99
96
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`)
101
98
}
102
99
//~^ NOTE immutable borrow ends here
103
100
104
101
fn copy_after_move_nested ( ) {
105
102
let a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
106
103
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
108
105
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
111
107
}
112
108
113
109
fn move_after_move_nested ( ) {
114
110
let a: Box < _ > = box D { x : box A { x : box 0 , y : 1 } , y : box 2 } ;
115
111
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
117
113
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
120
115
}
121
116
122
117
fn borrow_after_move_nested ( ) {
123
118
let a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
124
119
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
126
121
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
129
123
}
130
124
131
125
fn move_after_borrow_nested ( ) {
132
126
let a: Box < _ > = box D { x : box A { x : box 0 , y : 1 } , y : box 2 } ;
133
127
let _x = & a. x . x ;
134
- //~^ borrow of `a.x.x` occurs here
128
+ //~^ NOTE borrow of `a.x.x` occurs here
135
129
let _y = a. y ;
136
130
//~^ ERROR cannot move
137
- //~| move out of
131
+ //~| NOTE move out of
138
132
}
139
133
140
134
fn copy_after_mut_borrow_nested ( ) {
@@ -151,24 +145,24 @@ fn move_after_mut_borrow_nested() {
151
145
//~^ NOTE borrow of `a.x.x` occurs here
152
146
let _y = a. y ;
153
147
//~^ ERROR cannot move
154
- //~| move out of
148
+ //~| NOTE move out of
155
149
}
156
150
157
151
fn borrow_after_mut_borrow_nested ( ) {
158
152
let mut a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
159
153
let _x = & mut a. x . x ;
160
- //~^ mutable borrow occurs here
154
+ //~^ NOTE mutable borrow occurs here
161
155
let _y = & a. y ; //~ ERROR cannot borrow
162
- //~^ immutable borrow occurs here
156
+ //~^ NOTE immutable borrow occurs here
163
157
}
164
158
//~^ NOTE mutable borrow ends here
165
159
166
160
fn mut_borrow_after_borrow_nested ( ) {
167
161
let mut a: Box < _ > = box C { x : box A { x : box 0 , y : 1 } , y : 2 } ;
168
162
let _x = & a. x . x ;
169
- //~^ immutable borrow occurs here
163
+ //~^ NOTE immutable borrow occurs here
170
164
let _y = & mut a. y ; //~ ERROR cannot borrow
171
- //~^ mutable borrow occurs here
165
+ //~^ NOTE mutable borrow occurs here
172
166
}
173
167
//~^ NOTE immutable borrow ends here
174
168
0 commit comments