Skip to content

Commit 957374e

Browse files
committed
---
yaml --- r: 57315 b: refs/heads/incoming c: 621d45b h: refs/heads/master i: 57313: 5cf6898 57311: aa197e1 v: v3
1 parent 8b131fd commit 957374e

File tree

4 files changed

+12
-51
lines changed

4 files changed

+12
-51
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: bf67eb2362b7d0f37012f2d6dac604c3bbacd2c6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 89676d6a5960aa51ee1e6975c423e979819a407c
9+
refs/heads/incoming: 621d45b341c8c4ed0708b47b5a046278dda0c5be
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ fn area(sh: Shape) -> float {
747747

748748
Tuples in Rust behave exactly like structs, except that their fields
749749
do not have names. Thus, you cannot access their fields with dot notation.
750-
Tuples can have any arity except for 0 or 1 (though you may consider
750+
Tuples can have any arity except for 0 (though you may consider
751751
unit, `()`, as the empty tuple if you like).
752752

753753
~~~~

branches/incoming/src/libcore/num/int-template.rs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,11 @@ pub fn range_step(start: T, stop: T, step: T, it: &fn(T) -> bool) {
107107
} else if step > 0 { // ascending
108108
while i < stop {
109109
if !it(i) { break }
110-
// avoiding overflow. break if i + step > max_value
111-
if i > max_value - step { break; }
112110
i += step;
113111
}
114112
} else { // descending
115113
while i > stop {
116114
if !it(i) { break }
117-
// avoiding underflow. break if i + step < min_value
118-
if i < min_value - step { break; }
119115
i += step;
120116
}
121117
}
@@ -425,26 +421,10 @@ pub fn test_ranges() {
425421
for range_step(36,30,-2) |i| {
426422
l.push(i);
427423
}
428-
for range_step(max_value - 2, max_value, 2) |i| {
429-
l.push(i);
430-
}
431-
for range_step(max_value - 3, max_value, 2) |i| {
432-
l.push(i);
433-
}
434-
for range_step(min_value + 2, min_value, -2) |i| {
435-
l.push(i);
436-
}
437-
for range_step(min_value + 3, min_value, -2) |i| {
438-
l.push(i);
439-
}
440-
assert_eq!(l, ~[0,1,2,
441-
13,12,11,
442-
20,22,24,
443-
36,34,32,
444-
max_value-2,
445-
max_value-3,max_value-1,
446-
min_value+2,
447-
min_value+3,min_value+1]);
424+
assert!(l == ~[0,1,2,
425+
13,12,11,
426+
20,22,24,
427+
36,34,32]);
448428
449429
// None of the `fail`s should execute.
450430
for range(10,0) |_i| {

branches/incoming/src/libcore/num/uint-template.rs

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,12 @@ pub fn range_step(start: T,
7878
if step >= 0 {
7979
while i < stop {
8080
if !it(i) { break }
81-
// avoiding overflow. break if i + step > max_value
82-
if i > max_value - (step as T) { break; }
8381
i += step as T;
8482
}
85-
} else {
83+
}
84+
else {
8685
while i > stop {
8786
if !it(i) { break }
88-
// avoiding underflow. break if i + step < min_value
89-
if i < min_value + ((-step) as T) { break; }
9087
i -= -step as T;
9188
}
9289
}
@@ -374,27 +371,11 @@ pub fn test_ranges() {
374371
for range_step(36,30,-2) |i| {
375372
l.push(i);
376373
}
377-
for range_step(max_value - 2, max_value, 2) |i| {
378-
l.push(i);
379-
}
380-
for range_step(max_value - 3, max_value, 2) |i| {
381-
l.push(i);
382-
}
383-
for range_step(min_value + 2, min_value, -2) |i| {
384-
l.push(i);
385-
}
386-
for range_step(min_value + 3, min_value, -2) |i| {
387-
l.push(i);
388-
}
389374
390-
assert_eq!(l, ~[0,1,2,
391-
13,12,11,
392-
20,22,24,
393-
36,34,32,
394-
max_value-2,
395-
max_value-3,max_value-1,
396-
min_value+2,
397-
min_value+3,min_value+1]);
375+
assert!(l == ~[0,1,2,
376+
13,12,11,
377+
20,22,24,
378+
36,34,32]);
398379
399380
// None of the `fail`s should execute.
400381
for range(0,0) |_i| {

0 commit comments

Comments
 (0)