From 44a0c7225d5aa13769c4531b25fd524976c7f7a0 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 19 Nov 2010 14:59:58 -0800 Subject: Isolate while-header bug to minimal testcase, fix in rustboot, remove workaround in rustc. --- src/test/run-pass/while-prelude-drop.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/run-pass/while-prelude-drop.rs (limited to 'src/test') diff --git a/src/test/run-pass/while-prelude-drop.rs b/src/test/run-pass/while-prelude-drop.rs new file mode 100644 index 00000000..18f259a7 --- /dev/null +++ b/src/test/run-pass/while-prelude-drop.rs @@ -0,0 +1,22 @@ +tag t { + a; + b(str); +} + +fn make(int i) -> t { + if (i > 10) { + ret a; + } + auto s = "hello"; + // Ensure s is non-const. + s += "there"; + ret b(s); +} + +fn main() { + auto i = 0; + // The auto slot for the result of make(i) should not leak. + while (make(i) != a) { + i += 1; + } +} \ No newline at end of file -- cgit v1.2.3