rust/src/test/compile-fail/regions-nested-fns.rs
Gareth Daniel Smith 6d86969260 change the test suite //! kind syntax to //~ kind in order to avoid a
conflict with the new single-line-sugared-inner-doc-comment (`//! ...`).
2012-06-30 12:23:59 +01:00

21 lines
472 B
Rust

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;
ay = z; //~ ERROR references with lifetime
});
ignore(fn&(z: &z.int) -> &z.int {
if false { ret x; } //~ ERROR references with lifetime
if false { ret &y; } //~ ERROR references with lifetime
if false { ret ay; } //~ ERROR references with lifetime
ret z;
});
}
fn main() {}