2012-04-05 09:10:14 -07:00
|
|
|
fn ignore<T>(t: T) {}
|
|
|
|
|
2012-07-12 09:36:56 -07:00
|
|
|
fn nested(x: &x/int) {
|
2012-04-05 09:10:14 -07:00
|
|
|
let y = 3;
|
|
|
|
let mut ay = &y;
|
|
|
|
|
2012-07-12 09:36:56 -07:00
|
|
|
ignore(fn&(z: &z/int) {
|
2012-04-05 09:10:14 -07:00
|
|
|
ay = x;
|
|
|
|
ay = &y;
|
2012-06-30 12:23:59 +01:00
|
|
|
ay = z; //~ ERROR references with lifetime
|
2012-04-05 09:10:14 -07:00
|
|
|
});
|
|
|
|
|
2012-07-12 09:36:56 -07:00
|
|
|
ignore(fn&(z: &z/int) -> &z/int {
|
2012-06-30 12:23:59 +01:00
|
|
|
if false { ret x; } //~ ERROR references with lifetime
|
|
|
|
if false { ret ay; } //~ ERROR references with lifetime
|
2012-04-05 09:10:14 -07:00
|
|
|
ret z;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|