2012-04-05 22:59:36 -05:00
|
|
|
// The type of `y` ends up getting inferred to the type of the block.
|
|
|
|
// This generates a ton of error msgs at the moment.
|
|
|
|
fn broken() -> int {
|
|
|
|
let mut x = 3;
|
2012-07-02 16:44:31 -05:00
|
|
|
let mut y = ~[&mut x]; //~ ERROR reference is not valid
|
2012-04-05 22:59:36 -05:00
|
|
|
while x < 10 {
|
2012-04-26 18:02:01 -05:00
|
|
|
let mut z = x;
|
2012-06-29 18:26:56 -05:00
|
|
|
y += ~[&mut z];
|
2012-04-05 22:59:36 -05:00
|
|
|
x += 1;
|
|
|
|
}
|
2012-06-30 18:19:07 -05:00
|
|
|
vec::foldl(0, y, |v, p| v + *p )
|
2012-06-30 06:23:59 -05:00
|
|
|
//~^ ERROR reference is not valid
|
|
|
|
//~^^ ERROR reference is not valid
|
|
|
|
//~^^^ ERROR reference is not valid
|
2012-04-05 22:59:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|