2012-04-05 11:10:14 -05:00
|
|
|
fn ignore<T>(t: T) {}
|
|
|
|
|
|
|
|
fn nested(x: &x.int) {
|
|
|
|
let y = 3;
|
|
|
|
let mut ay = &y;
|
|
|
|
|
|
|
|
ignore(fn&(z: &z.int) {
|
|
|
|
ay = x;
|
|
|
|
ay = &y;
|
2012-04-17 10:40:06 -05:00
|
|
|
ay = z; //! ERROR references with lifetime
|
2012-04-05 11:10:14 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
ignore(fn&(z: &z.int) -> &z.int {
|
2012-04-17 10:40:06 -05:00
|
|
|
if false { ret x; } //! ERROR references with lifetime
|
|
|
|
if false { ret &y; } //! ERROR references with lifetime
|
|
|
|
if false { ret ay; } //! ERROR references with lifetime
|
2012-04-05 11:10:14 -05:00
|
|
|
ret z;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|