Skip to content

Commit e748318

Browse files
catamorphismgraydon
authored andcommitted
---
yaml --- r: 2376 b: refs/heads/master c: acf9bd7 h: refs/heads/master v: v3
1 parent 72095a1 commit e748318

File tree

9 files changed

+58
-4
lines changed

9 files changed

+58
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e3a68e235cd077c35654f79013ad54da46d72fee
2+
refs/heads/master: acf9bd7909a4f6a68d974cabff96c4b72791c201
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// -*- rust -*-
2+
// xfail-boot
3+
// xfail-stage0
4+
// error-pattern: impure function
5+
6+
fn g() -> () {}
7+
8+
pred f(int q) -> bool {
9+
g();
10+
ret true;
11+
}
12+
13+
fn main() {
14+
auto x = 0;
15+
16+
check f(x);
17+
}

trunk/src/test/compile-fail/not-a-pred-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// -*- rust -*-
22
// xfail-boot
3+
// xfail-stage0
34

45
// error-pattern: non-predicate
56

trunk/src/test/compile-fail/not-a-pred-3.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// -*- rust -*-
22
// xfail-boot
3+
// xfail-stage0
34

45
// error-pattern: expected the constraint name
56

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// -*- rust -*-
2+
// xfail-boot
3+
// xfail-stage0
4+
// error-pattern: non-predicate
5+
6+
fn f(int q) -> bool { ret true; }
7+
8+
fn main() {
9+
auto x = 0;
10+
11+
check f(x);
12+
}

trunk/src/test/compile-fail/not-pred-args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// -*- rust -*-
22
// xfail-boot
3+
// xfail-stage0
34

45
// error-pattern: Constraint args must be
56

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// -*- rust -*-
2+
3+
// error-pattern: mismatched types
4+
5+
// this checks that a pred with a non-bool return
6+
// type is rejected, even if the pred is never used
7+
8+
pred bad(int a) -> int {
9+
ret 37;
10+
}
11+
12+
fn main() {
13+
}

trunk/src/test/run-pass/pred-check.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// -*- rust -*-
2+
// xfail-boot
3+
// xfail-stage0
4+
5+
pred f(int q) -> bool { ret true; }
6+
7+
fn main() {
8+
auto x = 0;
9+
10+
check f(x);
11+
}

trunk/src/test/run-pass/pred.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// xfail-stage0
2-
// xfail-stage1
3-
// xfail-stage2
42
// -*- rust -*-
53

64
fn f(int a, int b) : lt(a,b) {
75
}
86

9-
fn lt(int a, int b) -> bool {
7+
pred lt(int a, int b) -> bool {
108
ret a < b;
119
}
1210

0 commit comments

Comments
 (0)