From 79cbdba03760347393778607be2127763829a570 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 5 Apr 2012 09:10:14 -0700 Subject: [PATCH] new tests for things we'll have to fix eventually --- src/test/compile-fail/regions-nested-fns.rs | 23 +++++++++++++++++++ .../{region-param.rs => regions-params.rs} | 0 2 files changed, 23 insertions(+) create mode 100644 src/test/compile-fail/regions-nested-fns.rs rename src/test/run-pass/{region-param.rs => regions-params.rs} (100%) diff --git a/src/test/compile-fail/regions-nested-fns.rs b/src/test/compile-fail/regions-nested-fns.rs new file mode 100644 index 00000000000..5953fe9348f --- /dev/null +++ b/src/test/compile-fail/regions-nested-fns.rs @@ -0,0 +1,23 @@ +// xfail-test + +fn ignore(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 foo + }); + + ignore(fn&(z: &z.int) -> &z.int { + if false { ret x; } //! ERROR bar + if false { ret &y; } //! ERROR bar + if false { ret ay; } //! ERROR bar + ret z; + }); +} + +fn main() {} \ No newline at end of file diff --git a/src/test/run-pass/region-param.rs b/src/test/run-pass/regions-params.rs similarity index 100% rename from src/test/run-pass/region-param.rs rename to src/test/run-pass/regions-params.rs