From 8bef2716fe80c3aa0e5cb0654e36a2de77e22bfd Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sat, 24 Mar 2012 18:59:11 -0700 Subject: [PATCH] test: Add a simple test for dangling pointers --- src/test/compile-fail/regions-ret.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/test/compile-fail/regions-ret.rs diff --git a/src/test/compile-fail/regions-ret.rs b/src/test/compile-fail/regions-ret.rs new file mode 100644 index 00000000000..cf31a308e77 --- /dev/null +++ b/src/test/compile-fail/regions-ret.rs @@ -0,0 +1,9 @@ +// error-pattern: mismatched types + +fn f(x : &a.int) -> &a.int { + ret &3; +} + +fn main() { +} +