aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/bad-env-capture.rs1
-rw-r--r--src/test/compile-fail/bad-env-capture2.rs11
-rw-r--r--src/test/compile-fail/bad-env-capture3.rs14
3 files changed, 25 insertions, 1 deletions
diff --git a/src/test/compile-fail/bad-env-capture.rs b/src/test/compile-fail/bad-env-capture.rs
index 55fa7473..fa1e1d08 100644
--- a/src/test/compile-fail/bad-env-capture.rs
+++ b/src/test/compile-fail/bad-env-capture.rs
@@ -1,6 +1,5 @@
// xfail-stage0
// xfail-stage1
-// xfail-stage2
// error-pattern: attempted dynamic environment-capture
fn foo() {
let int x;
diff --git a/src/test/compile-fail/bad-env-capture2.rs b/src/test/compile-fail/bad-env-capture2.rs
new file mode 100644
index 00000000..ccec3310
--- /dev/null
+++ b/src/test/compile-fail/bad-env-capture2.rs
@@ -0,0 +1,11 @@
+// xfail-stage0
+// xfail-stage1
+// error-pattern: attempted dynamic environment-capture
+fn foo(int x) {
+ fn bar() {
+ log x;
+ }
+}
+fn main() {
+ foo(2);
+} \ No newline at end of file
diff --git a/src/test/compile-fail/bad-env-capture3.rs b/src/test/compile-fail/bad-env-capture3.rs
new file mode 100644
index 00000000..77f7881d
--- /dev/null
+++ b/src/test/compile-fail/bad-env-capture3.rs
@@ -0,0 +1,14 @@
+// xfail-stage0
+// xfail-stage1
+// error-pattern: attempted dynamic environment-capture
+obj foo(int x) {
+ fn mth() {
+ fn bar() {
+ log x;
+ }
+ }
+}
+
+fn main() {
+ foo(2);
+}