Skip to content

Commit b603fce

Browse files
committed
---
yaml --- r: 55726 b: refs/heads/master c: 8942099 h: refs/heads/master v: v3
1 parent 06c5f84 commit b603fce

36 files changed

+240
-351
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 01eb5e8ad39a57e9fc31569983c1b9d5905a7e58
2+
refs/heads/master: 8942099614dba3a52e3fc0805ed6c0c37cb371a4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a

trunk/doc/rust.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,10 +1467,10 @@ A complete list of the built-in language items follows:
14671467
: Elements can be subtracted.
14681468
`mul`
14691469
: Elements can be multiplied.
1470-
`quot`
1471-
: Elements have a quotient operation.
1472-
`rem`
1473-
: Elements have a remainder operation.
1470+
`div`
1471+
: Elements can be divided.
1472+
`mod`
1473+
: Elements have a modulo operation.
14741474
`neg`
14751475
: Elements can be negated arithmetically.
14761476
`not`
@@ -1856,11 +1856,11 @@ The default meaning of the operators on standard types is given here.
18561856
: Multiplication.
18571857
Calls the `mul` method on the `core::ops::Mul` trait.
18581858
`/`
1859-
: Quotient.
1860-
Calls the `quot` method on the `core::ops::Quot` trait.
1859+
: Division.
1860+
Calls the `div` method on the `core::ops::Div` trait.
18611861
`%`
1862-
: Remainder.
1863-
Calls the `rem` method on the `core::ops::Rem` trait.
1862+
: Modulo (a.k.a. "remainder").
1863+
Calls the `modulo` method on the `core::ops::Modulo` trait.
18641864

18651865
#### Bitwise operators
18661866

trunk/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ The nil type, written `()`, has a single value, also written `()`.
362362
## Operators
363363

364364
Rust's set of operators contains very few surprises. Arithmetic is done with
365-
`*`, `/`, `%`, `+`, and `-` (multiply, quotient, remainder, add, and subtract). `-` is
365+
`*`, `/`, `%`, `+`, and `-` (multiply, divide, take remainder, add, and subtract). `-` is
366366
also a unary prefix operator that negates numbers. As in C, the bitwise operators
367367
`>>`, `<<`, `&`, `|`, and `^` are also supported.
368368

trunk/src/etc/kate/rust.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
<item> Add </item>
5858
<item> Sub </item>
5959
<item> Mul </item>
60-
<item> Quot </item>
61-
<item> Rem </item>
60+
<item> Div </item>
61+
<item> Modulo </item>
6262
<item> Neg </item>
6363
<item> BitAnd </item>
6464
<item> BitOr </item>

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ syn keyword rustType off_t dev_t ino_t pid_t mode_t ssize_t
4646

4747
syn keyword rustTrait Const Copy Send Owned " inherent traits
4848
syn keyword rustTrait Eq Ord Num Ptr
49-
syn keyword rustTrait Drop Add Sub Mul Quot Rem Neg BitAnd BitOr
49+
syn keyword rustTrait Drop Add Sub Mul Div Modulo Neg BitAnd BitOr
5050
syn keyword rustTrait BitXor Shl Shr Index
5151

5252
syn keyword rustSelf self

trunk/src/libcore/core.rc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,7 @@ they contained the following prologue:
7575

7676
pub use kinds::{Const, Copy, Owned, Durable};
7777
pub use ops::{Drop};
78-
#[cfg(stage0)]
7978
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
80-
#[cfg(stage1)]
81-
#[cfg(stage2)]
82-
#[cfg(stage3)]
83-
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
8479
pub use ops::{BitAnd, BitOr, BitXor};
8580
pub use ops::{Shl, Shr, Index};
8681

trunk/src/libcore/num/f32.rs

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@ use option::Option;
1616
use from_str;
1717
use to_str;
1818

19-
#[cfg(notest)] use cmp::{Eq, Ord};
20-
#[cfg(stage0,notest)]
21-
use ops::{Add, Sub, Mul, Div, Modulo, Neg};
22-
#[cfg(stage1,notest)]
23-
#[cfg(stage2,notest)]
24-
#[cfg(stage3,notest)]
25-
use ops::{Add, Sub, Mul, Quot, Rem, Neg};
19+
#[cfg(notest)] use cmp;
20+
#[cfg(notest)] use ops;
2621

2722
pub use cmath::c_float_targ_consts::*;
2823

@@ -136,7 +131,7 @@ pub fn sub(x: f32, y: f32) -> f32 { return x - y; }
136131
pub fn mul(x: f32, y: f32) -> f32 { return x * y; }
137132

138133
#[inline(always)]
139-
pub fn quot(x: f32, y: f32) -> f32 { return x / y; }
134+
pub fn div(x: f32, y: f32) -> f32 { return x / y; }
140135

141136
#[inline(always)]
142137
pub fn rem(x: f32, y: f32) -> f32 { return x % y; }
@@ -270,15 +265,15 @@ pub fn logarithm(n: f32, b: f32) -> f32 {
270265
}
271266

272267
#[cfg(notest)]
273-
impl Eq for f32 {
268+
impl cmp::Eq for f32 {
274269
#[inline(always)]
275270
fn eq(&self, other: &f32) -> bool { (*self) == (*other) }
276271
#[inline(always)]
277272
fn ne(&self, other: &f32) -> bool { (*self) != (*other) }
278273
}
279274

280275
#[cfg(notest)]
281-
impl Ord for f32 {
276+
impl cmp::Ord for f32 {
282277
#[inline(always)]
283278
fn lt(&self, other: &f32) -> bool { (*self) < (*other) }
284279
#[inline(always)]
@@ -300,41 +295,33 @@ impl num::One for f32 {
300295
}
301296

302297
#[cfg(notest)]
303-
impl Add<f32,f32> for f32 {
298+
impl ops::Add<f32,f32> for f32 {
299+
#[inline(always)]
304300
fn add(&self, other: &f32) -> f32 { *self + *other }
305301
}
306302
#[cfg(notest)]
307-
impl Sub<f32,f32> for f32 {
303+
impl ops::Sub<f32,f32> for f32 {
304+
#[inline(always)]
308305
fn sub(&self, other: &f32) -> f32 { *self - *other }
309306
}
310307
#[cfg(notest)]
311-
impl Mul<f32,f32> for f32 {
308+
impl ops::Mul<f32,f32> for f32 {
309+
#[inline(always)]
312310
fn mul(&self, other: &f32) -> f32 { *self * *other }
313311
}
314-
#[cfg(stage0,notest)]
315-
impl Div<f32,f32> for f32 {
312+
#[cfg(notest)]
313+
impl ops::Div<f32,f32> for f32 {
314+
#[inline(always)]
316315
fn div(&self, other: &f32) -> f32 { *self / *other }
317316
}
318-
#[cfg(stage1,notest)]
319-
#[cfg(stage2,notest)]
320-
#[cfg(stage3,notest)]
321-
impl Quot<f32,f32> for f32 {
317+
#[cfg(notest)]
318+
impl ops::Modulo<f32,f32> for f32 {
322319
#[inline(always)]
323-
fn quot(&self, other: &f32) -> f32 { *self / *other }
324-
}
325-
#[cfg(stage0,notest)]
326-
impl Modulo<f32,f32> for f32 {
327320
fn modulo(&self, other: &f32) -> f32 { *self % *other }
328321
}
329-
#[cfg(stage1,notest)]
330-
#[cfg(stage2,notest)]
331-
#[cfg(stage3,notest)]
332-
impl Rem<f32,f32> for f32 {
333-
#[inline(always)]
334-
fn rem(&self, other: &f32) -> f32 { *self % *other }
335-
}
336322
#[cfg(notest)]
337-
impl Neg<f32> for f32 {
323+
impl ops::Neg<f32> for f32 {
324+
#[inline(always)]
338325
fn neg(&self) -> f32 { -*self }
339326
}
340327

trunk/src/libcore/num/f64.rs

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@ use option::Option;
1616
use to_str;
1717
use from_str;
1818

19-
#[cfg(notest)] use cmp::{Eq, Ord};
20-
#[cfg(stage0,notest)]
21-
use ops::{Add, Sub, Mul, Div, Modulo, Neg};
22-
#[cfg(stage1,notest)]
23-
#[cfg(stage2,notest)]
24-
#[cfg(stage3,notest)]
25-
use ops::{Add, Sub, Mul, Quot, Rem, Neg};
19+
#[cfg(notest)] use cmp;
20+
#[cfg(notest)] use ops;
2621

2722
pub use cmath::c_double_targ_consts::*;
2823
pub use cmp::{min, max};
@@ -160,7 +155,7 @@ pub fn sub(x: f64, y: f64) -> f64 { return x - y; }
160155
pub fn mul(x: f64, y: f64) -> f64 { return x * y; }
161156

162157
#[inline(always)]
163-
pub fn quot(x: f64, y: f64) -> f64 { return x / y; }
158+
pub fn div(x: f64, y: f64) -> f64 { return x / y; }
164159

165160
#[inline(always)]
166161
pub fn rem(x: f64, y: f64) -> f64 { return x % y; }
@@ -289,15 +284,15 @@ pub fn logarithm(n: f64, b: f64) -> f64 {
289284
}
290285

291286
#[cfg(notest)]
292-
impl Eq for f64 {
287+
impl cmp::Eq for f64 {
293288
#[inline(always)]
294289
fn eq(&self, other: &f64) -> bool { (*self) == (*other) }
295290
#[inline(always)]
296291
fn ne(&self, other: &f64) -> bool { (*self) != (*other) }
297292
}
298293

299294
#[cfg(notest)]
300-
impl Ord for f64 {
295+
impl cmp::Ord for f64 {
301296
#[inline(always)]
302297
fn lt(&self, other: &f64) -> bool { (*self) < (*other) }
303298
#[inline(always)]
@@ -319,41 +314,33 @@ impl num::One for f64 {
319314
}
320315

321316
#[cfg(notest)]
322-
impl Add<f64,f64> for f64 {
317+
impl ops::Add<f64,f64> for f64 {
318+
#[inline(always)]
323319
fn add(&self, other: &f64) -> f64 { *self + *other }
324320
}
325321
#[cfg(notest)]
326-
impl Sub<f64,f64> for f64 {
322+
impl ops::Sub<f64,f64> for f64 {
323+
#[inline(always)]
327324
fn sub(&self, other: &f64) -> f64 { *self - *other }
328325
}
329326
#[cfg(notest)]
330-
impl Mul<f64,f64> for f64 {
327+
impl ops::Mul<f64,f64> for f64 {
328+
#[inline(always)]
331329
fn mul(&self, other: &f64) -> f64 { *self * *other }
332330
}
333-
#[cfg(stage0,notest)]
334-
impl Div<f64,f64> for f64 {
331+
#[cfg(notest)]
332+
impl ops::Div<f64,f64> for f64 {
333+
#[inline(always)]
335334
fn div(&self, other: &f64) -> f64 { *self / *other }
336335
}
337-
#[cfg(stage1,notest)]
338-
#[cfg(stage2,notest)]
339-
#[cfg(stage3,notest)]
340-
impl Quot<f64,f64> for f64 {
336+
#[cfg(notest)]
337+
impl ops::Modulo<f64,f64> for f64 {
341338
#[inline(always)]
342-
fn quot(&self, other: &f64) -> f64 { *self / *other }
343-
}
344-
#[cfg(stage0,notest)]
345-
impl Modulo<f64,f64> for f64 {
346339
fn modulo(&self, other: &f64) -> f64 { *self % *other }
347340
}
348-
#[cfg(stage1,notest)]
349-
#[cfg(stage2,notest)]
350-
#[cfg(stage3,notest)]
351-
impl Rem<f64,f64> for f64 {
352-
#[inline(always)]
353-
fn rem(&self, other: &f64) -> f64 { *self % *other }
354-
}
355341
#[cfg(notest)]
356-
impl Neg<f64> for f64 {
342+
impl ops::Neg<f64> for f64 {
343+
#[inline(always)]
357344
fn neg(&self) -> f64 { -*self }
358345
}
359346

trunk/src/libcore/num/float.rs

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,9 @@ use to_str;
2828
use from_str;
2929

3030
#[cfg(notest)] use cmp::{Eq, Ord};
31-
#[cfg(stage0,notest)]
32-
use ops::{Add, Sub, Mul, Div, Modulo, Neg};
33-
#[cfg(stage1,notest)]
34-
#[cfg(stage2,notest)]
35-
#[cfg(stage3,notest)]
36-
use ops::{Add, Sub, Mul, Quot, Rem, Neg};
37-
38-
pub use f64::{add, sub, mul, quot, rem, lt, le, eq, ne, ge, gt};
31+
#[cfg(notest)] use ops;
32+
33+
pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
3934
pub use f64::logarithm;
4035
pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
4136
pub use f64::{erf, erfc, exp, expm1, exp2, abs_sub};
@@ -454,41 +449,33 @@ impl num::Round for float {
454449
}
455450
456451
#[cfg(notest)]
457-
impl Add<float,float> for float {
452+
impl ops::Add<float,float> for float {
453+
#[inline(always)]
458454
fn add(&self, other: &float) -> float { *self + *other }
459455
}
460456
#[cfg(notest)]
461-
impl Sub<float,float> for float {
457+
impl ops::Sub<float,float> for float {
458+
#[inline(always)]
462459
fn sub(&self, other: &float) -> float { *self - *other }
463460
}
464461
#[cfg(notest)]
465-
impl Mul<float,float> for float {
462+
impl ops::Mul<float,float> for float {
463+
#[inline(always)]
466464
fn mul(&self, other: &float) -> float { *self * *other }
467465
}
468-
#[cfg(stage0,notest)]
469-
impl Div<float,float> for float {
466+
#[cfg(notest)]
467+
impl ops::Div<float,float> for float {
468+
#[inline(always)]
470469
fn div(&self, other: &float) -> float { *self / *other }
471470
}
472-
#[cfg(stage1,notest)]
473-
#[cfg(stage2,notest)]
474-
#[cfg(stage3,notest)]
475-
impl Quot<float,float> for float {
471+
#[cfg(notest)]
472+
impl ops::Modulo<float,float> for float {
476473
#[inline(always)]
477-
fn quot(&self, other: &float) -> float { *self / *other }
478-
}
479-
#[cfg(stage0,notest)]
480-
impl Modulo<float,float> for float {
481474
fn modulo(&self, other: &float) -> float { *self % *other }
482475
}
483-
#[cfg(stage1,notest)]
484-
#[cfg(stage2,notest)]
485-
#[cfg(stage3,notest)]
486-
impl Rem<float,float> for float {
487-
#[inline(always)]
488-
fn rem(&self, other: &float) -> float { *self % *other }
489-
}
490476
#[cfg(notest)]
491-
impl Neg<float> for float {
477+
impl ops::Neg<float> for float {
478+
#[inline(always)]
492479
fn neg(&self) -> float { -*self }
493480
}
494481

0 commit comments

Comments
 (0)