Skip to content

Commit de2dfa6

Browse files
committed
---
yaml --- r: 5323 b: refs/heads/master c: 994beca h: refs/heads/master i: 5321: 6fe166a 5319: e8273ed v: v3
1 parent 7588c7b commit de2dfa6

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
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: 1e3e7d4bc577460cfab90fcdf1e20ba9f4906eea
2+
refs/heads/master: 994beca00d21af69a6ae70a3aae2e829a65fdaff

trunk/src/lib/util.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11

2+
pure fn id<@T>(x: T) -> T { x }
23

3-
fn id<@T>(x: T) -> T { ret x; }
4-
4+
fn unreachable() -> ! {
5+
fail "Internal error: entered unreachable code";
6+
}
57

68
/* FIXME (issue #141): See test/run-pass/constrained-type.rs. Uncomment
79
* the constraint once fixed. */
8-
type rational = {num: int, den: int};
9-
10+
type rational = {num: int, den: int}; // : int::positive(*.den);
1011

1112
// : int::positive(*.den);
12-
fn rational_leq(x: rational, y: rational) -> bool {
13+
pure fn rational_leq(x: rational, y: rational) -> bool {
1314
// NB: Uses the fact that rationals have positive denominators WLOG:
1415

15-
ret x.num * y.den <= y.num * x.den;
16+
x.num * y.den <= y.num * x.den
1617
}
1718

18-
fn orb(a: bool, b: bool) -> bool { ret a || b; }
19+
pure fn orb(a: bool, b: bool) -> bool { a || b }
1920
// Local Variables:
2021
// mode: rust;
2122
// fill-column: 78;

0 commit comments

Comments
 (0)