Skip to content

Commit d22260d

Browse files
author
Cameron Zwarich
committed
---
yaml --- r: 117623 b: refs/heads/auto c: 61c81bf h: refs/heads/master i: 117621: 59f9815 117619: 9f7e86e 117615: 9a27b7b v: v3
1 parent d79c661 commit d22260d

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 8a543ffc76eea08db59cffbd6f8be7926bdb78c2
16+
refs/heads/auto: 61c81bf00cc8f8a87940fce3ba7be0bfd66cf04f
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/test/run-pass/borrowck-field-sensitivity.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,41 +125,83 @@ fn copy_after_assign_after_move() {
125125
drop(*x.b);
126126
}
127127

128+
fn copy_after_assign_after_fu_move() {
129+
let mut x = A { a: 1, b: box 2 };
130+
let _y = A { a: 3, .. x };
131+
x = A { a: 3, b: box 4 };
132+
drop(*x.b);
133+
}
134+
128135
fn copy_after_field_assign_after_move() {
129136
let mut x = A { a: 1, b: box 2 };
130137
drop(x.b);
131138
x.b = box 3;
132139
drop(*x.b);
133140
}
134141

142+
fn copy_after_field_assign_after_fu_move() {
143+
let mut x = A { a: 1, b: box 2 };
144+
let _y = A { a: 3, .. x };
145+
x.b = box 3;
146+
drop(*x.b);
147+
}
148+
135149
fn borrow_after_assign_after_move() {
136150
let mut x = A { a: 1, b: box 2 };
137151
drop(x.b);
138152
x = A { a: 3, b: box 4 };
139153
borrow(&x.b);
140154
}
141155

156+
fn borrow_after_assign_after_fu_move() {
157+
let mut x = A { a: 1, b: box 2 };
158+
let _y = A { a: 3, .. x };
159+
x = A { a: 3, b: box 4 };
160+
borrow(&x.b);
161+
}
162+
142163
fn borrow_after_field_assign_after_move() {
143164
let mut x = A { a: 1, b: box 2 };
144165
drop(x.b);
145166
x.b = box 3;
146167
borrow(&x.b);
147168
}
148169

170+
fn borrow_after_field_assign_after_fu_move() {
171+
let mut x = A { a: 1, b: box 2 };
172+
let _y = A { a: 3, .. x };
173+
x.b = box 3;
174+
borrow(&x.b);
175+
}
176+
149177
fn move_after_assign_after_move() {
150178
let mut x = A { a: 1, b: box 2 };
151179
let _y = x.b;
152180
x = A { a: 3, b: box 4 };
153181
drop(x.b);
154182
}
155183

184+
fn move_after_assign_after_fu_move() {
185+
let mut x = A { a: 1, b: box 2 };
186+
let _y = A { a: 3, .. x };
187+
x = A { a: 3, b: box 4 };
188+
drop(x.b);
189+
}
190+
156191
fn move_after_field_assign_after_move() {
157192
let mut x = A { a: 1, b: box 2 };
158193
drop(x.b);
159194
x.b = box 3;
160195
drop(x.b);
161196
}
162197

198+
fn move_after_field_assign_after_fu_move() {
199+
let mut x = A { a: 1, b: box 2 };
200+
let _y = A { a: 3, .. x };
201+
x.b = box 3;
202+
drop(x.b);
203+
}
204+
163205
fn copy_after_assign_after_uninit() {
164206
let mut x: A;
165207
x = A { a: 1, b: box 2 };
@@ -200,11 +242,19 @@ fn main() {
200242
fu_move_after_fu_move();
201243

202244
copy_after_assign_after_move();
245+
copy_after_assign_after_fu_move();
203246
copy_after_field_assign_after_move();
247+
copy_after_field_assign_after_fu_move();
248+
204249
borrow_after_assign_after_move();
250+
borrow_after_assign_after_fu_move();
205251
borrow_after_field_assign_after_move();
252+
borrow_after_field_assign_after_fu_move();
253+
206254
move_after_assign_after_move();
255+
move_after_assign_after_fu_move();
207256
move_after_field_assign_after_move();
257+
move_after_field_assign_after_fu_move();
208258

209259
copy_after_assign_after_uninit();
210260
borrow_after_assign_after_uninit();

0 commit comments

Comments
 (0)