Skip to content

Commit b6ed1de

Browse files
committed
Issue #2591: Change "upvar" to "variable declared in an outer block" in tests
1 parent 68670f6 commit b6ed1de

7 files changed

+9
-9
lines changed

src/test/compile-fail/block-deinitializes-upvar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:moving out of immutable upvar
1+
// error-pattern:moving out of immutable variable declared in an outer block
22
fn force(f: fn()) { f(); }
33
fn main() {
44
let mut x = @{x: 17, y: 2};

src/test/compile-fail/borrowck-lend-flow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn loop_in_block() {
6363
let mut v = ~3, w = ~4;
6464
let mut _x = &mut w;
6565
for uint::range(0u, 10u) {|_i|
66-
borrow(v); //! ERROR loan of mutable upvar as immutable conflicts with prior loan
66+
borrow(v); //! ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan
6767
_x = &mut v; //! NOTE prior loan as mutable granted here
6868
}
6969
}
@@ -77,7 +77,7 @@ fn at_most_once_block() {
7777
let mut v = ~3, w = ~4;
7878
let mut _x = &mut w;
7979
at_most_once {||
80-
borrow(v); //! ERROR loan of mutable upvar as immutable conflicts with prior loan
80+
borrow(v); //! ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan
8181
_x = &mut v; //! NOTE prior loan as mutable granted here
8282
}
8383
}

src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fn borrow(v: &int, f: fn(x: &int)) {
55
fn box_imm() {
66
let mut v = ~3;
77
borrow(v) { |w| //! NOTE loan of mutable local variable granted here
8-
v = ~4; //! ERROR assigning to mutable upvar prohibited due to outstanding loan
8+
v = ~4; //! ERROR assigning to mutable variable declared in an outer block prohibited due to outstanding loan
99
assert *v == 3;
1010
assert *w == 4;
1111
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fn main() {
22
let x = 5;
33
let _y = fn~(move x) -> int {
4-
let _z = fn~(move x) -> int { x }; //! ERROR moving out of upvar
4+
let _z = fn~(move x) -> int { x }; //! ERROR moving out of variable declared in an outer block
55
22
66
};
77
}

src/test/compile-fail/issue-1965.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// error-pattern:moving out of immutable upvar
1+
// error-pattern:moving out of immutable variable declared in an outer block
22
fn test(-x: uint) {}
33

44
fn main() {
55
let i = 3u;
66
for uint::range(0u, 10u) {|_x| test(i)}
7-
}
7+
}

src/test/compile-fail/lambda-mutate-nested.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:assigning to immutable upvar
1+
// error-pattern:assigning to immutable variable declared in an outer block
22
// Make sure that nesting a block within a fn@ doesn't let us
33
// mutate upvars from a fn@.
44
fn f2(x: fn()) { x(); }

src/test/compile-fail/lambda-mutate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:assigning to upvar
1+
// error-pattern:assigning to variable declared in an outer block
22
// Make sure we can't write to upvars from fn@s
33
fn main() {
44
let i = 0;

0 commit comments

Comments
 (0)