File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 1e3e7d4bc577460cfab90fcdf1e20ba9f4906eea
2
+ refs/heads/master: 994beca00d21af69a6ae70a3aae2e829a65fdaff
Original file line number Diff line number Diff line change 1
1
2
+ pure fn id < @T > ( x : T ) -> T { x }
2
3
3
- fn id < @T > ( x : T ) -> T { ret x; }
4
-
4
+ fn unreachable ( ) -> ! {
5
+ fail "Internal error: entered unreachable code" ;
6
+ }
5
7
6
8
/* FIXME (issue #141): See test/run-pass/constrained-type.rs. Uncomment
7
9
* the constraint once fixed. */
8
- type rational = { num : int , den : int } ;
9
-
10
+ type rational = { num : int , den : int } ; // : int::positive(*.den);
10
11
11
12
// : int::positive(*.den);
12
- fn rational_leq ( x : rational , y : rational ) -> bool {
13
+ pure fn rational_leq ( x : rational , y : rational ) -> bool {
13
14
// NB: Uses the fact that rationals have positive denominators WLOG:
14
15
15
- ret x. num * y. den <= y. num * x. den ;
16
+ x. num * y. den <= y. num * x. den
16
17
}
17
18
18
- fn orb ( a : bool , b : bool ) -> bool { ret a || b; }
19
+ pure fn orb ( a : bool , b : bool ) -> bool { a || b }
19
20
// Local Variables:
20
21
// mode: rust;
21
22
// fill-column: 78;
You can’t perform that action at this time.
0 commit comments