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-04-12 23:59:33 -05:00
|
|
|
let mut y = [&x]; //! ERROR reference is not valid
|
2012-04-05 22:59:36 -05:00
|
|
|
while x < 10 {
|
|
|
|
let z = x;
|
|
|
|
y += [&z];
|
|
|
|
x += 1;
|
|
|
|
}
|
|
|
|
vec::foldl(0, y) {|v, p| v + *p }
|
2012-04-12 23:59:33 -05:00
|
|
|
//!^ ERROR reference is not valid
|
|
|
|
//!^^ ERROR reference is not valid
|
|
|
|
//!^^^ 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() { }
|