Skip to content

Commit 440f8df

Browse files
committed
Correct tests
rs=breakage
1 parent 532c94d commit 440f8df

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ impl @Liveness {
18391839

18401840
self.report_illegal_read(move_span, lnk, var, MovedValue);
18411841
self.tcx.sess.span_note(
1842-
move_span, ~"move of variable occurred here");
1842+
move_span, ~"move of value occurred here");
18431843

18441844
}
18451845

src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,11 @@ fn b() {
4747
}
4848

4949
fn c() {
50-
// Here the receiver is in aliased memory and hence we cannot
51-
// consider it immutable:
50+
// Here the receiver is in aliased memory but due to write
51+
// barriers we can still consider it immutable.
5252
let q = @mut Point {x: 3, y: 4};
53-
54-
// ...this is ok for pure fns
5553
*q + 3;
56-
57-
58-
// ...and impure fns
59-
(*q).times(3);
54+
q.times(3);
6055
}
6156

6257
fn main() {

src/test/compile-fail/borrowck-loan-rcvr.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,10 @@ fn b() {
5555
}
5656

5757
fn c() {
58-
// Here the receiver is in aliased memory and hence we cannot
59-
// consider it immutable:
58+
// Loaning @mut as & is considered legal due to dynamic checks:
6059
let q = @mut {x: 3, y: 4};
61-
62-
// ...this is ok for pure fns
63-
(*q).purem();
64-
65-
// ...and impure fns
66-
(*q).impurem();
60+
q.purem();
61+
q.impurem();
6762
}
6863

6964
fn main() {

src/test/compile-fail/liveness-move-from-mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ fn main() {
1515
let x: int = 25;
1616
loop {
1717
take(move x); //~ ERROR use of moved value: `x`
18-
//~^ NOTE move of variable occurred here
18+
//~^ NOTE move of value occurred here
1919
}
2020
}

0 commit comments

Comments
 (0)