Skip to content

Commit 954e9d5

Browse files
committed
---
yaml --- r: 179054 b: refs/heads/master c: 4583272 h: refs/heads/master v: v3
1 parent 765480b commit 954e9d5

File tree

5 files changed

+6
-81
lines changed

5 files changed

+6
-81
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 128ac9dfcbb096c8bbc373f554a0c97ca3e9e030
2+
refs/heads/master: 4583272bf5054e84c4c59ba3b9334a52cfcf5208
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ac134f7ca435551964996ee88319241cd3c7c110
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77

trunk/src/test/compile-fail/borrowck-array-double-move.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

trunk/src/test/compile-fail/borrowck-use-in-index-lvalue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
fn test() {
1212
let w: &mut [isize];
13-
w[5] = 0; //~ ERROR use of possibly uninitialized variable: `w`
13+
w[5] = 0; //~ ERROR use of possibly uninitialized variable: `*w`
1414

1515
let mut w: &mut [isize];
16-
w[5] = 0; //~ ERROR use of possibly uninitialized variable: `w`
16+
w[5] = 0; //~ ERROR use of possibly uninitialized variable: `*w`
1717
}
1818

1919
fn main() { test(); }

trunk/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ fn main() {
1414
[1, 2, tail..] => tail,
1515
_ => unreachable!()
1616
};
17-
a[0] = 0; //~ ERROR cannot assign to `a[..]` because it is borrowed
17+
println!("t[0]: {}", t[0]);
18+
a[2] = 0; //~ ERROR cannot assign to `a[..]` because it is borrowed
19+
println!("t[0]: {}", t[0]);
1820
t[0];
1921
}

trunk/src/test/compile-fail/move-fragments-9.rs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ pub fn test_move_array_into_recv(a: [D; 3], recv: &mut [D; 3]) {
3333
*recv = a;
3434
}
3535

36-
#[rustc_move_fragments]
37-
pub fn test_extract_array_elem(a: [D; 3], i: usize) -> D {
38-
//~^ ERROR parent_of_fragments: `$(local a)`
39-
//~| ERROR assigned_leaf_path: `$(local i)`
40-
//~| ERROR moved_leaf_path: `$(local a).[]`
41-
//~| ERROR unmoved_fragment: `$(allbutone $(local a).[])`
42-
a[i]
43-
}
44-
4536
#[rustc_move_fragments]
4637
pub fn test_overwrite_array_elem(mut a: [D; 3], i: usize, d: D) {
4738
//~^ ERROR parent_of_fragments: `$(local mut a)`
@@ -53,48 +44,4 @@ pub fn test_overwrite_array_elem(mut a: [D; 3], i: usize, d: D) {
5344
a[i] = d;
5445
}
5546

56-
// FIXME (pnkfelix): Both test_move_array_then_overwrite_elem1 and
57-
// test_move_array_then_overwrite_elem2 illustrate a behavior that
58-
// we need to make illegal if we want to get rid of drop-flags.
59-
// See RFC PR 320 for more discussion.
60-
61-
#[rustc_move_fragments]
62-
pub fn test_move_array_then_overwrite_elem1(mut a: [D; 3], i: usize, recv: &mut [D; 3], d: D) {
63-
//~^ ERROR parent_of_fragments: `$(local mut a)`
64-
//~| ERROR parent_of_fragments: `$(local recv)`
65-
//~| ERROR assigned_leaf_path: `$(local recv).*`
66-
//~| ERROR assigned_leaf_path: `$(local i)`
67-
//~| ERROR assigned_leaf_path: `$(local d)`
68-
//~| ERROR moved_leaf_path: `$(local d)`
69-
//~| ERROR assigned_leaf_path: `$(local mut a).[]`
70-
//~| ERROR unmoved_fragment: `$(allbutone $(local mut a).[])`
71-
72-
// This test covers the case where the array contents have been all moved away, but
73-
// we still need to deal with new initializing writes into the array.
74-
*recv = a;
75-
a[i] = d;
76-
}
77-
78-
#[rustc_move_fragments]
79-
pub fn test_move_array_then_overwrite_elem2(mut a: [D; 3], i: usize, j: usize,
80-
recv: &mut [D; 3], d1: D, d2: D) {
81-
//~^^ ERROR parent_of_fragments: `$(local mut a)`
82-
//~| ERROR parent_of_fragments: `$(local recv)`
83-
//~| ERROR assigned_leaf_path: `$(local recv).*`
84-
//~| ERROR assigned_leaf_path: `$(local i)`
85-
//~| ERROR assigned_leaf_path: `$(local j)`
86-
//~| ERROR assigned_leaf_path: `$(local d1)`
87-
//~| ERROR assigned_leaf_path: `$(local d2)`
88-
//~| ERROR moved_leaf_path: `$(local d1)`
89-
//~| ERROR moved_leaf_path: `$(local d2)`
90-
//~| ERROR assigned_leaf_path: `$(local mut a).[]`
91-
//~| ERROR unmoved_fragment: `$(allbutone $(local mut a).[])`
92-
93-
// This test covers the case where the array contents have been all moved away, but
94-
// we still need to deal with new initializing writes into the array.
95-
*recv = a;
96-
a[i] = d1;
97-
a[j] = d2;
98-
}
99-
10047
pub fn main() { }

0 commit comments

Comments
 (0)