aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/impure-pred.rs
diff options
context:
space:
mode:
authorTim Chevalier <[email protected]>2011-05-04 11:32:06 -0700
committerGraydon Hoare <[email protected]>2011-05-05 11:26:07 -0700
commitacf9bd7909a4f6a68d974cabff96c4b72791c201 (patch)
tree6b1e5761e7dcdb8625941cf7d02387a554f534ed /src/test/compile-fail/impure-pred.rs
parentBring back "pred" syntax for writing predicates for check (diff)
downloadrust-acf9bd7909a4f6a68d974cabff96c4b72791c201.tar.xz
rust-acf9bd7909a4f6a68d974cabff96c4b72791c201.zip
Test cases for pred / check stuff
Diffstat (limited to 'src/test/compile-fail/impure-pred.rs')
-rw-r--r--src/test/compile-fail/impure-pred.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/compile-fail/impure-pred.rs b/src/test/compile-fail/impure-pred.rs
new file mode 100644
index 00000000..b5ebc10e
--- /dev/null
+++ b/src/test/compile-fail/impure-pred.rs
@@ -0,0 +1,17 @@
+// -*- rust -*-
+// xfail-boot
+// xfail-stage0
+// error-pattern: impure function
+
+fn g() -> () {}
+
+pred f(int q) -> bool {
+ g();
+ ret true;
+}
+
+fn main() {
+ auto x = 0;
+
+ check f(x);
+}