Skip to content

Commit e8d7890

Browse files
committed
---
yaml --- r: 4937 b: refs/heads/master c: d9bc3cb h: refs/heads/master i: 4935: 8fed9ee v: v3
1 parent cbe0194 commit e8d7890

26 files changed

+34
-32
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: 1cb85015c397cefa9de7653a98b7572ef511e0ef
2+
refs/heads/master: d9bc3cb10c4d1e856998c8e35ce7d89e0d74f4d6

trunk/src/lib/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pred is_whitespace(c: char) -> bool {
1+
pure fn is_whitespace(c: char) -> bool {
22
const ch_space: char = '\u0020';
33
const ch_ogham_space_mark: char = '\u1680';
44
const ch_mongolian_vowel_sep: char = '\u180e';

trunk/src/lib/istr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ fn is_ascii(s: &istr) -> bool {
7373
}
7474

7575
/// Returns true if the string has length 0
76-
pred is_empty(s: &istr) -> bool {
76+
pure fn is_empty(s: &istr) -> bool {
7777
for c: u8 in s { ret false; } ret true;
7878
}
7979

8080
/// Returns true if the string has length greater than 0
81-
pred is_not_empty(s: &istr) -> bool {
81+
pure fn is_not_empty(s: &istr) -> bool {
8282
!is_empty(s)
8383
}
8484

trunk/src/lib/uint.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ fn div(x: uint, y: uint) -> uint { ret x / y; }
1010

1111
fn rem(x: uint, y: uint) -> uint { ret x % y; }
1212

13-
pred lt(x: uint, y: uint) -> bool { ret x < y; }
13+
pure fn lt(x: uint, y: uint) -> bool { ret x < y; }
1414

15-
pred le(x: uint, y: uint) -> bool { ret x <= y; }
15+
pure fn le(x: uint, y: uint) -> bool { ret x <= y; }
1616

17-
pred eq(x: uint, y: uint) -> bool { ret x == y; }
17+
pure fn eq(x: uint, y: uint) -> bool { ret x == y; }
1818

19-
pred ne(x: uint, y: uint) -> bool { ret x != y; }
19+
pure fn ne(x: uint, y: uint) -> bool { ret x != y; }
2020

21-
pred ge(x: uint, y: uint) -> bool { ret x >= y; }
21+
pure fn ge(x: uint, y: uint) -> bool { ret x >= y; }
2222

23-
pred gt(x: uint, y: uint) -> bool { ret x > y; }
23+
pure fn gt(x: uint, y: uint) -> bool { ret x > y; }
2424

2525
fn max(x: uint, y: uint) -> uint { if x > y { ret x; } ret y; }
2626

trunk/src/lib/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ fn from_mut<@T>(v: &[mutable T]) -> [T] {
7777
}
7878

7979
// Predicates
80-
pred is_empty<T>(v: &[mutable? T]) -> bool {
80+
pure fn is_empty<T>(v: &[mutable? T]) -> bool {
8181
// FIXME: This would be easier if we could just call len
8282
for t: T in v { ret false; }
8383
ret true;
8484
}
8585

86-
pred is_not_empty<T>(v: &[mutable? T]) -> bool { ret !is_empty(v); }
86+
pure fn is_not_empty<T>(v: &[mutable? T]) -> bool { ret !is_empty(v); }
8787

8888
// Accessors
8989

trunk/src/test/compile-fail/constrained-type-missing-check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tag list { cons(int, @list); nil; }
88

99
type bubu = {x: int, y: int};
1010

11-
pred less_than(x: int, y: int) -> bool { ret x < y; }
11+
pure fn less_than(x: int, y: int) -> bool { ret x < y; }
1212

1313
type ordered_range = {low: int, high: int} : less_than(low, high);
1414

trunk/src/test/compile-fail/do-while-pred-constraints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
fn print_even(y: int) : even(y) { log y; }
44

5-
pred even(y: int) -> bool { true }
5+
pure fn even(y: int) -> bool { true }
66

77
fn main() {
88
let y: int = 42;

trunk/src/test/compile-fail/if-check-precond-fail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// error-pattern:Unsatisfied precondition constraint
2-
pred even(x: uint) -> bool {
2+
pure fn even(x: uint) -> bool {
33
if x < 2u {
44
ret false;
55
} else if x == 2u { ret true; } else { ret even(x - 2u); }

trunk/src/test/compile-fail/impure-pred.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn g() { }
55

6-
pred f(q: int) -> bool { g(); ret true; }
6+
pure fn f(q: int) -> bool { g(); ret true; }
77

88
fn main() {
99
let x = 0;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// error-pattern: Constraint args must be
44

5-
pred f(q: int) -> bool { ret true; }
5+
pure fn f(q: int) -> bool { ret true; }
66

77
fn main() {
88
// should fail to typecheck, as pred args must be slot variables

trunk/src/test/compile-fail/pred-assign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fn f(a: int, b: int) : lt(a, b) { }
66

7-
pred lt(a: int, b: int) -> bool { ret a < b; }
7+
pure fn lt(a: int, b: int) -> bool { ret a < b; }
88

99
fn main() {
1010
let a: int = 10;

trunk/src/test/compile-fail/pred-on-wrong-slots.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fn f(a: int, b: int) : lt(a, b) { }
66

7-
pred lt(a: int, b: int) -> bool { ret a < b; }
7+
pure fn lt(a: int, b: int) -> bool { ret a < b; }
88

99
fn main() {
1010
let a: int = 10;

trunk/src/test/compile-fail/pred-swap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fn f(a: int, b: int) : lt(a, b) { }
66

7-
pred lt(a: int, b: int) -> bool { ret a < b; }
7+
pure fn lt(a: int, b: int) -> bool { ret a < b; }
88

99
fn main() {
1010
let a: int = 10;

trunk/src/test/compile-fail/while-loop-pred-constraints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
fn print_even(y: int) : even(y) { log y; }
44

5-
pred even(y: int) -> bool { true }
5+
pure fn even(y: int) -> bool { true }
66

77
fn main() {
88

trunk/src/test/run-fail/if-check-fail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// error-pattern:Number is odd
2-
pred even(x: uint) -> bool {
2+
pure fn even(x: uint) -> bool {
33
if x < 2u {
44
ret false;
55
} else if x == 2u { ret true; } else { ret even(x - 2u); }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// error-pattern:Predicate lt(b, a) failed
33
fn f(a: int, b: int) { }
44

5-
pred lt(a: int, b: int) -> bool { ret a < b; }
5+
pure fn lt(a: int, b: int) -> bool { ret a < b; }
66

77
fn main() { let a: int = 10; let b: int = 23; check (lt(b, a)); f(b, a); }

trunk/src/test/run-pass/claim-nonterm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ use std;
33
import std::str::*;
44
import std::uint::*;
55

6-
pred fails(a: uint) -> bool { fail; }
6+
pure fn fails(a: uint) -> bool { fail; }
77

88
fn main() { let b: uint = 4u; claim (fails(b)); }

trunk/src/test/run-pass/constrained-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tag list { cons(int, @list); nil; }
44

55
type bubu = {x: int, y: int};
66

7-
pred less_than(x: int, y: int) -> bool { ret x < y; }
7+
pure fn less_than(x: int, y: int) -> bool { ret x < y; }
88

99
type ordered_range = {low: int, high: int} : less_than(*.low, *.high);
1010

trunk/src/test/run-pass/if-check-precond.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pred even(x: uint) -> bool {
1+
pure fn even(x: uint) -> bool {
22
if x < 2u {
33
ret false;
44
} else if x == 2u { ret true; } else { ret even(x - 2u); }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pred even(x: uint) -> bool {
1+
pure fn even(x: uint) -> bool {
22
if x < 2u {
33
ret false;
44
} else if x == 2u { ret true; } else { ret even(x - 2u); }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// -*- rust -*-
2-
pred f(q: int) -> bool { ret true; }
2+
pure fn f(q: int) -> bool { ret true; }
33

44
fn main() { let x = 0; check (f(x)); }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// FIXME should be in run-pass
2+
13
// -*- rust -*-
24

35
// error-pattern: Non-boolean return type

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// -*- rust -*-
22
fn f(a: int, b: int) { }
33

4-
pred lt(a: int, b: int) -> bool { ret a < b; }
4+
pure fn lt(a: int, b: int) -> bool { ret a < b; }
55

66
fn main() {
77
let a: int = 10;

trunk/src/test/run-pass/typestate-transitive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pred p(i: int) -> bool { true }
1+
pure fn p(i: int) -> bool { true }
22

33
fn f(i: int) : p(i) -> int { i }
44

trunk/src/test/run-pass/wierd-exprs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn hammertime() -> int {
4040
}
4141

4242
fn canttouchthis() -> uint {
43-
pred p() -> bool { true }
43+
pure fn p() -> bool { true }
4444
let _a = (assert (true)) == (check (p()));
4545
let _c = (check (p())) == ();
4646
let _b = (log 0) == (ret 0u);

trunk/src/test/stdtest/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn square(n: uint) -> uint { ret n * n; }
1010

1111
fn square_alias(n: &uint) -> uint { ret n * n; }
1212

13-
pred is_three(n: &uint) -> bool { ret n == 3u; }
13+
pure fn is_three(n: &uint) -> bool { ret n == 3u; }
1414

1515
fn square_if_odd(n: &uint) -> option::t<uint> {
1616
ret if n % 2u == 1u { some(n * n) } else { none };

0 commit comments

Comments
 (0)