Skip to content

Commit d70f5b2

Browse files
committed
---
yaml --- r: 64125 b: refs/heads/snap-stage3 c: 2ed1cfc h: refs/heads/master i: 64123: a13962d v: v3
1 parent 5bf70d2 commit d70f5b2

File tree

116 files changed

+1055
-1780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+1055
-1780
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0c6d02f391aa668b2ead91e8a4ed545475ac2c90
4+
refs/heads/snap-stage3: 2ed1cfc91224810254ac54ab6245c5edcc73c647
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# The names of crates that must be tested
1717
TEST_TARGET_CRATES = std extra
18-
TEST_HOST_CRATES = syntax rustc rustdoc rust rustpkg rusti
18+
TEST_HOST_CRATES = syntax rustc rustdoc rust rustpkg
1919
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2020

2121
# Markdown files under doc/ that should have their code extracted and run
@@ -157,7 +157,6 @@ check-test: cleantestlibs cleantmptestlogs all check-stage2-rfail
157157

158158
check-lite: cleantestlibs cleantmptestlogs \
159159
check-stage2-std check-stage2-extra check-stage2-rpass \
160-
check-stage2-rustpkg check-stage2-rusti \
161160
check-stage2-rfail check-stage2-cfail
162161
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
163162

branches/snap-stage3/src/libextra/arena.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ use list::{MutList, MutCons, MutNil};
4040
use std::at_vec;
4141
use std::cast::{transmute, transmute_mut, transmute_mut_region};
4242
use std::cast;
43+
use std::num;
4344
use std::ptr;
4445
use std::sys;
4546
use std::uint;
@@ -175,7 +176,7 @@ impl Arena {
175176
fn alloc_pod_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
176177
// Allocate a new chunk.
177178
let chunk_size = at_vec::capacity(self.pod_head.data);
178-
let new_min_chunk_size = uint::max(n_bytes, chunk_size);
179+
let new_min_chunk_size = num::max(n_bytes, chunk_size);
179180
self.chunks = @mut MutCons(copy self.pod_head, self.chunks);
180181
self.pod_head =
181182
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), true);
@@ -217,7 +218,7 @@ impl Arena {
217218
-> (*u8, *u8) {
218219
// Allocate a new chunk.
219220
let chunk_size = at_vec::capacity(self.head.data);
220-
let new_min_chunk_size = uint::max(n_bytes, chunk_size);
221+
let new_min_chunk_size = num::max(n_bytes, chunk_size);
221222
self.chunks = @mut MutCons(copy self.head, self.chunks);
222223
self.head =
223224
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), false);

branches/snap-stage3/src/libextra/bitv.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
use std::cmp;
15+
use std::num;
1516
use std::ops;
1617
use std::uint;
1718
use std::vec;
@@ -726,7 +727,7 @@ impl Set<uint> for BitvSet {
726727
}
727728
let nbits = self.capacity();
728729
if value >= nbits {
729-
let newsize = uint::max(value, nbits * 2) / uint::bits + 1;
730+
let newsize = num::max(value, nbits * 2) / uint::bits + 1;
730731
assert!(newsize > self.bitv.storage.len());
731732
self.bitv.storage.grow(newsize, &0);
732733
}
@@ -825,7 +826,7 @@ impl BitvSet {
825826
/// and w1/w2 are the words coming from the two vectors self, other.
826827
fn each_common(&self, other: &BitvSet,
827828
f: &fn(uint, uint, uint) -> bool) -> bool {
828-
let min = uint::min(self.bitv.storage.len(),
829+
let min = num::min(self.bitv.storage.len(),
829830
other.bitv.storage.len());
830831
self.bitv.storage.slice(0, min).iter().enumerate().advance(|(i, &w)| {
831832
f(i * uint::bits, w, other.bitv.storage[i])
@@ -843,7 +844,7 @@ impl BitvSet {
843844
f: &fn(bool, uint, uint) -> bool) -> bool {
844845
let len1 = self.bitv.storage.len();
845846
let len2 = other.bitv.storage.len();
846-
let min = uint::min(len1, len2);
847+
let min = num::min(len1, len2);
847848

848849
/* only one of these loops will execute and that's the point */
849850
for self.bitv.storage.slice(min, len1).iter().enumerate().advance |(i, &w)| {

branches/snap-stage3/src/libextra/deque.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! A double-ended queue implemented as a circular buffer
1212
13+
use std::num;
1314
use std::uint;
1415
use std::vec;
1516
use std::iterator::FromIterator;
@@ -51,7 +52,7 @@ impl<T> Deque<T> {
5152
/// Create an empty Deque with space for at least `n` elements.
5253
pub fn with_capacity(n: uint) -> Deque<T> {
5354
Deque{nelts: 0, lo: 0,
54-
elts: vec::from_fn(uint::max(MINIMUM_CAPACITY, n), |_| None)}
55+
elts: vec::from_fn(num::max(MINIMUM_CAPACITY, n), |_| None)}
5556
}
5657

5758
/// Return a reference to the first element in the deque

branches/snap-stage3/src/libextra/fileinput.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ mod test {
418418
fn make_file(path : &Path, contents: &[~str]) {
419419
let file = io::file_writer(path, [io::Create, io::Truncate]).get();
420420

421-
for contents.iter().advance |str| {
422-
file.write_str(*str);
421+
for contents.iter().advance |&str| {
422+
file.write_str(str);
423423
file.write_char('\n');
424424
}
425425
}
@@ -445,7 +445,7 @@ mod test {
445445
|i| fmt!("tmp/lib-fileinput-test-fileinput-read-byte-%u.tmp", i)), true);
446446
447447
// 3 files containing 0\n, 1\n, and 2\n respectively
448-
for filenames.iter().enumerate().advance |(i, filename)| {
448+
for filenames.iter().enumerate().advance |(i, &filename)| {
449449
make_file(filename.get_ref(), [fmt!("%u", i)]);
450450
}
451451
@@ -475,7 +475,7 @@ mod test {
475475
|i| fmt!("tmp/lib-fileinput-test-fileinput-read-%u.tmp", i)), true);
476476
477477
// 3 files containing 1\n, 2\n, and 3\n respectively
478-
for filenames.iter().enumerate().advance |(i, filename)| {
478+
for filenames.iter().enumerate().advance |(i, &filename)| {
479479
make_file(filename.get_ref(), [fmt!("%u", i)]);
480480
}
481481
@@ -495,11 +495,10 @@ mod test {
495495
3,
496496
|i| fmt!("tmp/lib-fileinput-test-input-vec-%u.tmp", i)), true);
497497

498-
for filenames.iter().enumerate().advance |(i, filename)| {
498+
for filenames.iter().enumerate().advance |(i, &filename)| {
499499
let contents =
500500
vec::from_fn(3, |j| fmt!("%u %u", i, j));
501501
make_file(filename.get_ref(), contents);
502-
debug!("contents=%?", contents);
503502
all_lines.push_all(contents);
504503
}
505504

@@ -516,7 +515,7 @@ mod test {
516515
3,
517516
|i| fmt!("tmp/lib-fileinput-test-input-vec-state-%u.tmp", i)),true);
518517

519-
for filenames.iter().enumerate().advance |(i, filename)| {
518+
for filenames.iter().enumerate().advance |(i, &filename)| {
520519
let contents =
521520
vec::from_fn(3, |j| fmt!("%u %u", i, j + 1));
522521
make_file(filename.get_ref(), contents);
@@ -580,10 +579,10 @@ mod test {
580579
3,
581580
|i| fmt!("tmp/lib-fileinput-test-next-file-%u.tmp", i)),true);
582581
583-
for filenames.iter().enumerate().advance |(i, filename)| {
582+
for filenames.iter().enumerate().advance |(i, &filename)| {
584583
let contents =
585584
vec::from_fn(3, |j| fmt!("%u %u", i, j + 1));
586-
make_file(filename.get_ref(), contents);
585+
make_file(&filename.get(), contents);
587586
}
588587
589588
let in = FileInput::from_vec(filenames);

branches/snap-stage3/src/libextra/net/tcp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use std::comm::{stream, Port, SharedChan};
2828
use std::ptr;
2929
use std::result::{Result};
3030
use std::result;
31-
use std::uint;
31+
use std::num;
3232
use std::vec;
3333

3434
pub mod rustrt {
@@ -880,7 +880,7 @@ impl io::Reader for TcpSocketBuf {
880880
let needed = len - count;
881881
if nbuffered > 0 {
882882
unsafe {
883-
let ncopy = uint::min(nbuffered, needed);
883+
let ncopy = num::min(nbuffered, needed);
884884
let dst = ptr::mut_offset(
885885
vec::raw::to_mut_ptr(buf), count);
886886
let src = ptr::offset(

branches/snap-stage3/src/libextra/num/bigint.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ A BigInt is a combination of BigUint and Sign.
2121

2222
use std::cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
2323
use std::int;
24+
use std::num;
2425
use std::num::{IntConvertible, Zero, One, ToStrRadix, FromStrRadix, Orderable};
2526
use std::str;
2627
use std::uint;
@@ -204,7 +205,7 @@ impl Unsigned for BigUint {}
204205
impl Add<BigUint, BigUint> for BigUint {
205206

206207
fn add(&self, other: &BigUint) -> BigUint {
207-
let new_len = uint::max(self.data.len(), other.data.len());
208+
let new_len = num::max(self.data.len(), other.data.len());
208209

209210
let mut carry = 0;
210211
let mut sum = do vec::from_fn(new_len) |i| {
@@ -224,7 +225,7 @@ impl Add<BigUint, BigUint> for BigUint {
224225
impl Sub<BigUint, BigUint> for BigUint {
225226

226227
fn sub(&self, other: &BigUint) -> BigUint {
227-
let new_len = uint::max(self.data.len(), other.data.len());
228+
let new_len = num::max(self.data.len(), other.data.len());
228229

229230
let mut borrow = 0;
230231
let diff = do vec::from_fn(new_len) |i| {
@@ -260,7 +261,7 @@ impl Mul<BigUint, BigUint> for BigUint {
260261
// = a1*b1 * base^2 +
261262
// (a1*b1 + a0*b0 - (a1-b0)*(b1-a0)) * base +
262263
// a0*b0
263-
let half_len = uint::max(s_len, o_len) / 2;
264+
let half_len = num::max(s_len, o_len) / 2;
264265
let (sHi, sLo) = cut_at(self, half_len);
265266
let (oHi, oLo) = cut_at(other, half_len);
266267

@@ -297,7 +298,7 @@ impl Mul<BigUint, BigUint> for BigUint {
297298

298299

299300
fn cut_at(a: &BigUint, n: uint) -> (BigUint, BigUint) {
300-
let mid = uint::min(a.data.len(), n);
301+
let mid = num::min(a.data.len(), n);
301302
return (BigUint::from_slice(a.data.slice(mid, a.data.len())),
302303
BigUint::from_slice(a.data.slice(0, mid)));
303304
}
@@ -482,7 +483,7 @@ impl Integer for BigUint {
482483
impl IntConvertible for BigUint {
483484

484485
fn to_int(&self) -> int {
485-
uint::min(self.to_uint(), int::max_value as uint) as int
486+
num::min(self.to_uint(), int::max_value as uint) as int
486487
}
487488

488489

@@ -580,7 +581,7 @@ impl BigUint {
580581
let mut n: BigUint = Zero::zero();
581582
let mut power: BigUint = One::one();
582583
loop {
583-
let start = uint::max(end, unit_len) - unit_len;
584+
let start = num::max(end, unit_len) - unit_len;
584585
match uint::parse_bytes(buf.slice(start, end), radix) {
585586
// FIXME(#6102): Assignment operator for BigInt causes ICE
586587
// Some(d) => n += BigUint::from_uint(d) * power,
@@ -1055,9 +1056,9 @@ impl IntConvertible for BigInt {
10551056

10561057
fn to_int(&self) -> int {
10571058
match self.sign {
1058-
Plus => uint::min(self.to_uint(), int::max_value as uint) as int,
1059+
Plus => num::min(self.to_uint(), int::max_value as uint) as int,
10591060
Zero => 0,
1060-
Minus => uint::min((-self).to_uint(),
1061+
Minus => num::min((-self).to_uint(),
10611062
(int::max_value as uint) + 1) as int
10621063
}
10631064
}
@@ -1571,10 +1572,10 @@ mod biguint_tests {
15711572
fn test_to_str_radix() {
15721573
let r = to_str_pairs();
15731574
for r.iter().advance |num_pair| {
1574-
let &(ref n, ref rs) = num_pair;
1575+
let &(n, rs) = num_pair;
15751576
for rs.iter().advance |str_pair| {
1576-
let &(ref radix, ref str) = str_pair;
1577-
assert_eq!(&n.to_str_radix(*radix), str);
1577+
let &(radix, str) = str_pair;
1578+
assert_eq!(n.to_str_radix(radix), str);
15781579
}
15791580
}
15801581
}
@@ -1583,10 +1584,10 @@ mod biguint_tests {
15831584
fn test_from_str_radix() {
15841585
let r = to_str_pairs();
15851586
for r.iter().advance |num_pair| {
1586-
let &(ref n, ref rs) = num_pair;
1587+
let &(n, rs) = num_pair;
15871588
for rs.iter().advance |str_pair| {
1588-
let &(ref radix, ref str) = str_pair;
1589-
assert_eq!(n, &FromStrRadix::from_str_radix(*str, *radix).get());
1589+
let &(radix, str) = str_pair;
1590+
assert_eq!(&n, &FromStrRadix::from_str_radix(str, radix).get());
15901591
}
15911592
}
15921593

branches/snap-stage3/src/libextra/par.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111

1212
use std::cast;
13+
use std::num;
1314
use std::ptr;
1415
use std::sys;
15-
use std::uint;
1616
use std::vec;
1717
use future_spawn = future::spawn;
1818

@@ -44,15 +44,15 @@ fn map_slices<A:Copy + Send,B:Copy + Send>(
4444
~[f()(0u, xs)]
4545
}
4646
else {
47-
let num_tasks = uint::min(MAX_TASKS, len / MIN_GRANULARITY);
47+
let num_tasks = num::min(MAX_TASKS, len / MIN_GRANULARITY);
4848

4949
let items_per_task = len / num_tasks;
5050

5151
let mut futures = ~[];
5252
let mut base = 0u;
5353
info!("spawning tasks");
5454
while base < len {
55-
let end = uint::min(len, base + items_per_task);
55+
let end = num::min(len, base + items_per_task);
5656
do xs.as_imm_buf |p, _len| {
5757
let f = f();
5858
let base = base;

branches/snap-stage3/src/libextra/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<T> Drop for Rc<T> {
7373
if self.ptr.is_not_null() {
7474
(*self.ptr).count -= 1;
7575
if (*self.ptr).count == 0 {
76-
ptr::read_ptr(self.ptr);
76+
ptr::replace_ptr(self.ptr, intrinsics::uninit());
7777
free(self.ptr as *c_void)
7878
}
7979
}

branches/snap-stage3/src/libextra/sort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ mod test_qsort {
840840

841841
let expected = ~[1, 2, 3];
842842

843-
do quick_sort(names) |x, y| { int::le(*x, *y) };
843+
do quick_sort(names) |x, y| { *x < *y };
844844

845845
let immut_names = names;
846846

branches/snap-stage3/src/libextra/stats.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use sort;
1212
use std::cmp;
1313
use std::io;
1414
use std::num;
15-
use std::f64;
1615
use std::vec;
1716

1817
// NB: this can probably be rewritten in terms of num::Num
@@ -178,7 +177,7 @@ impl<'self> Stats for &'self [f64] {
178177
}
179178

180179
fn std_dev(self) -> f64 {
181-
f64::sqrt(self.var())
180+
self.var().sqrt()
182181
}
183182

184183
fn std_dev_pct(self) -> f64 {

branches/snap-stage3/src/libextra/term.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ impl Terminal {
119119
pub fn reset(&self) {
120120
let mut vars = Variables::new();
121121
let s = do self.ti.strings.find_equiv(&("op"))
122-
.map_consume_default(Err(~"can't find terminfo capability `op`")) |op| {
123-
expand(copy *op, [], &mut vars)
122+
.map_consume_default(Err(~"can't find terminfo capability `op`")) |&op| {
123+
expand(op, [], &mut vars)
124124
};
125125
if s.is_ok() {
126126
self.out.write(s.unwrap());

branches/snap-stage3/src/libextra/terminfo/parm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
8181

8282
// Copy parameters into a local vector for mutability
8383
let mut mparams = [Number(0), ..9];
84-
for mparams.mut_iter().zip(params.iter()).advance |(dst, src)| {
85-
*dst = copy *src;
84+
for mparams.mut_iter().zip(params.iter()).advance |(dst, &src)| {
85+
*dst = src;
8686
}
8787

8888
for cap.iter().transform(|&x| x).advance |c| {

0 commit comments

Comments
 (0)