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