Skip to content

Commit aa072aa

Browse files
committed
---
yaml --- r: 31437 b: refs/heads/dist-snap c: 1dd8acd h: refs/heads/master i: 31435: ed8ba21 v: v3
1 parent ab84ccd commit aa072aa

File tree

9 files changed

+83
-83
lines changed

9 files changed

+83
-83
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: d19b915bc40d36cdf9866bfd3cf160ddabc7cc9d
10+
refs/heads/dist-snap: 1dd8acd56acc189db2c0bb3266536d35646380b4
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/libcore/cmp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// Interfaces used for comparison.
22
3-
iface ord {
4-
fn lt(&&other: self) -> bool;
3+
trait ord {
4+
pure fn lt(&&other: self) -> bool;
55
}
66

7-
iface eq {
8-
fn eq(&&other: self) -> bool;
7+
trait eq {
8+
pure fn eq(&&other: self) -> bool;
99
}
1010

branches/dist-snap/src/libcore/f32.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,15 @@ pure fn log2(n: f32) -> f32 {
168168
}
169169

170170
impl num of num::num for f32 {
171-
fn add(&&other: f32) -> f32 { ret self + other; }
172-
fn sub(&&other: f32) -> f32 { ret self - other; }
173-
fn mul(&&other: f32) -> f32 { ret self * other; }
174-
fn div(&&other: f32) -> f32 { ret self / other; }
175-
fn modulo(&&other: f32) -> f32 { ret self % other; }
176-
fn neg() -> f32 { ret -self; }
177-
178-
fn to_int() -> int { ret self as int; }
179-
fn from_int(n: int) -> f32 { ret n as f32; }
171+
pure fn add(&&other: f32) -> f32 { ret self + other; }
172+
pure fn sub(&&other: f32) -> f32 { ret self - other; }
173+
pure fn mul(&&other: f32) -> f32 { ret self * other; }
174+
pure fn div(&&other: f32) -> f32 { ret self / other; }
175+
pure fn modulo(&&other: f32) -> f32 { ret self % other; }
176+
pure fn neg() -> f32 { ret -self; }
177+
178+
pure fn to_int() -> int { ret self as int; }
179+
pure fn from_int(n: int) -> f32 { ret n as f32; }
180180
}
181181

182182
//

branches/dist-snap/src/libcore/f64.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ pure fn log2(n: f64) -> f64 {
195195
}
196196

197197
impl num of num::num for f64 {
198-
fn add(&&other: f64) -> f64 { ret self + other; }
199-
fn sub(&&other: f64) -> f64 { ret self - other; }
200-
fn mul(&&other: f64) -> f64 { ret self * other; }
201-
fn div(&&other: f64) -> f64 { ret self / other; }
202-
fn modulo(&&other: f64) -> f64 { ret self % other; }
203-
fn neg() -> f64 { ret -self; }
204-
205-
fn to_int() -> int { ret self as int; }
206-
fn from_int(n: int) -> f64 { ret n as f64; }
198+
pure fn add(&&other: f64) -> f64 { ret self + other; }
199+
pure fn sub(&&other: f64) -> f64 { ret self - other; }
200+
pure fn mul(&&other: f64) -> f64 { ret self * other; }
201+
pure fn div(&&other: f64) -> f64 { ret self / other; }
202+
pure fn modulo(&&other: f64) -> f64 { ret self % other; }
203+
pure fn neg() -> f64 { ret -self; }
204+
205+
pure fn to_int() -> int { ret self as int; }
206+
pure fn from_int(n: int) -> f64 { ret n as f64; }
207207
}
208208

209209
//

branches/dist-snap/src/libcore/float.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -403,32 +403,32 @@ fn pow_with_uint(base: uint, pow: uint) -> float {
403403
ret total;
404404
}
405405

406-
fn is_positive(x: float) -> bool { f64::is_positive(x as f64) }
407-
fn is_negative(x: float) -> bool { f64::is_negative(x as f64) }
408-
fn is_nonpositive(x: float) -> bool { f64::is_nonpositive(x as f64) }
409-
fn is_nonnegative(x: float) -> bool { f64::is_nonnegative(x as f64) }
410-
fn is_zero(x: float) -> bool { f64::is_zero(x as f64) }
411-
fn is_infinite(x: float) -> bool { f64::is_infinite(x as f64) }
412-
fn is_finite(x: float) -> bool { f64::is_finite(x as f64) }
413-
fn is_NaN(x: float) -> bool { f64::is_NaN(x as f64) }
414-
415-
fn abs(x: float) -> float { f64::abs(x as f64) as float }
416-
fn sqrt(x: float) -> float { f64::sqrt(x as f64) as float }
417-
fn atan(x: float) -> float { f64::atan(x as f64) as float }
418-
fn sin(x: float) -> float { f64::sin(x as f64) as float }
419-
fn cos(x: float) -> float { f64::cos(x as f64) as float }
420-
fn tan(x: float) -> float { f64::tan(x as f64) as float }
406+
pure fn is_positive(x: float) -> bool { f64::is_positive(x as f64) }
407+
pure fn is_negative(x: float) -> bool { f64::is_negative(x as f64) }
408+
pure fn is_nonpositive(x: float) -> bool { f64::is_nonpositive(x as f64) }
409+
pure fn is_nonnegative(x: float) -> bool { f64::is_nonnegative(x as f64) }
410+
pure fn is_zero(x: float) -> bool { f64::is_zero(x as f64) }
411+
pure fn is_infinite(x: float) -> bool { f64::is_infinite(x as f64) }
412+
pure fn is_finite(x: float) -> bool { f64::is_finite(x as f64) }
413+
pure fn is_NaN(x: float) -> bool { f64::is_NaN(x as f64) }
414+
415+
pure fn abs(x: float) -> float { f64::abs(x as f64) as float }
416+
pure fn sqrt(x: float) -> float { f64::sqrt(x as f64) as float }
417+
pure fn atan(x: float) -> float { f64::atan(x as f64) as float }
418+
pure fn sin(x: float) -> float { f64::sin(x as f64) as float }
419+
pure fn cos(x: float) -> float { f64::cos(x as f64) as float }
420+
pure fn tan(x: float) -> float { f64::tan(x as f64) as float }
421421

422422
impl num of num::num for float {
423-
fn add(&&other: float) -> float { ret self + other; }
424-
fn sub(&&other: float) -> float { ret self - other; }
425-
fn mul(&&other: float) -> float { ret self * other; }
426-
fn div(&&other: float) -> float { ret self / other; }
427-
fn modulo(&&other: float) -> float { ret self % other; }
428-
fn neg() -> float { ret -self; }
429-
430-
fn to_int() -> int { ret self as int; }
431-
fn from_int(n: int) -> float { ret n as float; }
423+
pure fn add(&&other: float) -> float { ret self + other; }
424+
pure fn sub(&&other: float) -> float { ret self - other; }
425+
pure fn mul(&&other: float) -> float { ret self * other; }
426+
pure fn div(&&other: float) -> float { ret self / other; }
427+
pure fn modulo(&&other: float) -> float { ret self % other; }
428+
pure fn neg() -> float { ret -self; }
429+
430+
pure fn to_int() -> int { ret self as int; }
431+
pure fn from_int(n: int) -> float { ret n as float; }
432432
}
433433

434434
#[test]

branches/dist-snap/src/libcore/int-template.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,27 +112,27 @@ fn to_str_bytes<U>(n: T, radix: uint, f: fn(v: &[u8]) -> U) -> U {
112112
fn str(i: T) -> ~str { ret to_str(i, 10u); }
113113

114114
impl ord of ord for T {
115-
fn lt(&&other: T) -> bool {
115+
pure fn lt(&&other: T) -> bool {
116116
ret self < other;
117117
}
118118
}
119119

120120
impl eq of eq for T {
121-
fn eq(&&other: T) -> bool {
121+
pure fn eq(&&other: T) -> bool {
122122
ret self == other;
123123
}
124124
}
125125

126126
impl num of num::num for T {
127-
fn add(&&other: T) -> T { ret self + other; }
128-
fn sub(&&other: T) -> T { ret self - other; }
129-
fn mul(&&other: T) -> T { ret self * other; }
130-
fn div(&&other: T) -> T { ret self / other; }
131-
fn modulo(&&other: T) -> T { ret self % other; }
132-
fn neg() -> T { ret -self; }
133-
134-
fn to_int() -> int { ret self as int; }
135-
fn from_int(n: int) -> T { ret n as T; }
127+
pure fn add(&&other: T) -> T { ret self + other; }
128+
pure fn sub(&&other: T) -> T { ret self - other; }
129+
pure fn mul(&&other: T) -> T { ret self * other; }
130+
pure fn div(&&other: T) -> T { ret self / other; }
131+
pure fn modulo(&&other: T) -> T { ret self % other; }
132+
pure fn neg() -> T { ret -self; }
133+
134+
pure fn to_int() -> int { ret self as int; }
135+
pure fn from_int(n: int) -> T { ret n as T; }
136136
}
137137

138138
impl times of iter::times for T {

branches/dist-snap/src/libcore/num.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/// An interface for numbers.
22
3-
iface num {
3+
trait num {
44
// FIXME: Cross-crate overloading doesn't work yet. (#2615)
55
// FIXME: Interface inheritance. (#2616)
6-
fn add(&&other: self) -> self;
7-
fn sub(&&other: self) -> self;
8-
fn mul(&&other: self) -> self;
9-
fn div(&&other: self) -> self;
10-
fn modulo(&&other: self) -> self;
11-
fn neg() -> self;
6+
pure fn add(&&other: self) -> self;
7+
pure fn sub(&&other: self) -> self;
8+
pure fn mul(&&other: self) -> self;
9+
pure fn div(&&other: self) -> self;
10+
pure fn modulo(&&other: self) -> self;
11+
pure fn neg() -> self;
1212

13-
fn to_int() -> int;
14-
fn from_int(n: int) -> self; // FIXME (#2376) Static functions.
13+
pure fn to_int() -> int;
14+
pure fn from_int(n: int) -> self; // FIXME (#2376) Static functions.
1515
// n.b. #2376 is for classes, not ifaces, but it could be generalized...
1616
}
1717

branches/dist-snap/src/libcore/uint-template.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,27 @@ pure fn compl(i: T) -> T {
5353
}
5454

5555
impl ord of ord for T {
56-
fn lt(&&other: T) -> bool {
56+
pure fn lt(&&other: T) -> bool {
5757
ret self < other;
5858
}
5959
}
6060

6161
impl eq of eq for T {
62-
fn eq(&&other: T) -> bool {
62+
pure fn eq(&&other: T) -> bool {
6363
ret self == other;
6464
}
6565
}
6666

6767
impl num of num::num for T {
68-
fn add(&&other: T) -> T { ret self + other; }
69-
fn sub(&&other: T) -> T { ret self - other; }
70-
fn mul(&&other: T) -> T { ret self * other; }
71-
fn div(&&other: T) -> T { ret self / other; }
72-
fn modulo(&&other: T) -> T { ret self % other; }
73-
fn neg() -> T { ret -self; }
74-
75-
fn to_int() -> int { ret self as int; }
76-
fn from_int(n: int) -> T { ret n as T; }
68+
pure fn add(&&other: T) -> T { ret self + other; }
69+
pure fn sub(&&other: T) -> T { ret self - other; }
70+
pure fn mul(&&other: T) -> T { ret self * other; }
71+
pure fn div(&&other: T) -> T { ret self / other; }
72+
pure fn modulo(&&other: T) -> T { ret self % other; }
73+
pure fn neg() -> T { ret -self; }
74+
75+
pure fn to_int() -> int { ret self as int; }
76+
pure fn from_int(n: int) -> T { ret n as T; }
7777
}
7878

7979
/**

branches/dist-snap/src/libstd/cmp.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
33
const fuzzy_epsilon: float = 1.0e-6;
44

5-
iface fuzzy_eq {
6-
fn fuzzy_eq(&&other: self) -> bool;
5+
trait fuzzy_eq {
6+
pure fn fuzzy_eq(&&other: self) -> bool;
77
}
88

99
impl fuzzy_eq of fuzzy_eq for float {
10-
fn fuzzy_eq(&&other: float) -> bool {
10+
pure fn fuzzy_eq(&&other: float) -> bool {
1111
ret float::abs(self - other) < fuzzy_epsilon;
1212
}
1313
}
1414

1515
impl fuzzy_eq of fuzzy_eq for f32 {
16-
fn fuzzy_eq(&&other: f32) -> bool {
16+
pure fn fuzzy_eq(&&other: f32) -> bool {
1717
ret f32::abs(self - other) < (fuzzy_epsilon as f32);
1818
}
1919
}
2020

2121
impl fuzzy_eq of fuzzy_eq for f64 {
22-
fn fuzzy_eq(&&other: f64) -> bool {
22+
pure fn fuzzy_eq(&&other: f64) -> bool {
2323
ret f64::abs(self - other) < (fuzzy_epsilon as f64);
2424
}
2525
}

0 commit comments

Comments
 (0)