Skip to content

Commit f4a3ba1

Browse files
committed
---
yaml --- r: 64103 b: refs/heads/snap-stage3 c: 2a8ae0e h: refs/heads/master i: 64101: 36846c2 64099: 9554e98 64095: 845d771 v: v3
1 parent bb464d9 commit f4a3ba1

Some content is hidden

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

63 files changed

+709
-366
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: 59e6a4d44c329ddf37d9ff33df874e7800647ec2
4+
refs/heads/snap-stage3: 2a8ae0eb4ae91d8695ea7e95e024f51ec19ef56a
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: 2 additions & 1 deletion
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
18+
TEST_HOST_CRATES = syntax rustc rustdoc rust rustpkg rusti
1919
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2020

2121
# Markdown files under doc/ that should have their code extracted and run
@@ -157,6 +157,7 @@ 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 \
160161
check-stage2-rfail check-stage2-cfail
161162
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
162163

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ 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;
4443
use std::ptr;
4544
use std::sys;
4645
use std::uint;
@@ -176,7 +175,7 @@ impl Arena {
176175
fn alloc_pod_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
177176
// Allocate a new chunk.
178177
let chunk_size = at_vec::capacity(self.pod_head.data);
179-
let new_min_chunk_size = num::max(n_bytes, chunk_size);
178+
let new_min_chunk_size = uint::max(n_bytes, chunk_size);
180179
self.chunks = @mut MutCons(copy self.pod_head, self.chunks);
181180
self.pod_head =
182181
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), true);
@@ -218,7 +217,7 @@ impl Arena {
218217
-> (*u8, *u8) {
219218
// Allocate a new chunk.
220219
let chunk_size = at_vec::capacity(self.head.data);
221-
let new_min_chunk_size = num::max(n_bytes, chunk_size);
220+
let new_min_chunk_size = uint::max(n_bytes, chunk_size);
222221
self.chunks = @mut MutCons(copy self.head, self.chunks);
223222
self.head =
224223
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), false);

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

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

1313

1414
use std::cmp;
15-
use std::num;
1615
use std::ops;
1716
use std::uint;
1817
use std::vec;
@@ -727,7 +726,7 @@ impl Set<uint> for BitvSet {
727726
}
728727
let nbits = self.capacity();
729728
if value >= nbits {
730-
let newsize = num::max(value, nbits * 2) / uint::bits + 1;
729+
let newsize = uint::max(value, nbits * 2) / uint::bits + 1;
731730
assert!(newsize > self.bitv.storage.len());
732731
self.bitv.storage.grow(newsize, &0);
733732
}
@@ -826,7 +825,7 @@ impl BitvSet {
826825
/// and w1/w2 are the words coming from the two vectors self, other.
827826
fn each_common(&self, other: &BitvSet,
828827
f: &fn(uint, uint, uint) -> bool) -> bool {
829-
let min = num::min(self.bitv.storage.len(),
828+
let min = uint::min(self.bitv.storage.len(),
830829
other.bitv.storage.len());
831830
self.bitv.storage.slice(0, min).iter().enumerate().advance(|(i, &w)| {
832831
f(i * uint::bits, w, other.bitv.storage[i])
@@ -844,7 +843,7 @@ impl BitvSet {
844843
f: &fn(bool, uint, uint) -> bool) -> bool {
845844
let len1 = self.bitv.storage.len();
846845
let len2 = other.bitv.storage.len();
847-
let min = num::min(len1, len2);
846+
let min = uint::min(len1, len2);
848847

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

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

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

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

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

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::num;
31+
use std::uint;
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 = num::min(nbuffered, needed);
883+
let ncopy = uint::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: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ 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;
2524
use std::num::{IntConvertible, Zero, One, ToStrRadix, FromStrRadix, Orderable};
2625
use std::str;
2726
use std::uint;
@@ -205,7 +204,7 @@ impl Unsigned for BigUint {}
205204
impl Add<BigUint, BigUint> for BigUint {
206205

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

210209
let mut carry = 0;
211210
let mut sum = do vec::from_fn(new_len) |i| {
@@ -225,7 +224,7 @@ impl Add<BigUint, BigUint> for BigUint {
225224
impl Sub<BigUint, BigUint> for BigUint {
226225

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

230229
let mut borrow = 0;
231230
let diff = do vec::from_fn(new_len) |i| {
@@ -261,7 +260,7 @@ impl Mul<BigUint, BigUint> for BigUint {
261260
// = a1*b1 * base^2 +
262261
// (a1*b1 + a0*b0 - (a1-b0)*(b1-a0)) * base +
263262
// a0*b0
264-
let half_len = num::max(s_len, o_len) / 2;
263+
let half_len = uint::max(s_len, o_len) / 2;
265264
let (sHi, sLo) = cut_at(self, half_len);
266265
let (oHi, oLo) = cut_at(other, half_len);
267266

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

299298

300299
fn cut_at(a: &BigUint, n: uint) -> (BigUint, BigUint) {
301-
let mid = num::min(a.data.len(), n);
300+
let mid = uint::min(a.data.len(), n);
302301
return (BigUint::from_slice(a.data.slice(mid, a.data.len())),
303302
BigUint::from_slice(a.data.slice(0, mid)));
304303
}
@@ -483,7 +482,7 @@ impl Integer for BigUint {
483482
impl IntConvertible for BigUint {
484483

485484
fn to_int(&self) -> int {
486-
num::min(self.to_uint(), int::max_value as uint) as int
485+
uint::min(self.to_uint(), int::max_value as uint) as int
487486
}
488487

489488

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

10571056
fn to_int(&self) -> int {
10581057
match self.sign {
1059-
Plus => num::min(self.to_uint(), int::max_value as uint) as int,
1058+
Plus => uint::min(self.to_uint(), int::max_value as uint) as int,
10601059
Zero => 0,
1061-
Minus => num::min((-self).to_uint(),
1060+
Minus => uint::min((-self).to_uint(),
10621061
(int::max_value as uint) + 1) as int
10631062
}
10641063
}

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;
1413
use std::ptr;
1514
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 = num::min(MAX_TASKS, len / MIN_GRANULARITY);
47+
let num_tasks = uint::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 = num::min(len, base + items_per_task);
55+
let end = uint::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/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| { *x < *y };
843+
do quick_sort(names) |x, y| { int::le(*x, *y) };
844844

845845
let immut_names = names;
846846

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use sort;
1212
use std::cmp;
1313
use std::io;
1414
use std::num;
15+
use std::f64;
1516
use std::vec;
1617

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

179180
fn std_dev(self) -> f64 {
180-
self.var().sqrt()
181+
f64::sqrt(self.var())
181182
}
182183

183184
fn std_dev_pct(self) -> f64 {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#[allow(missing_doc)];
1212

1313

14+
use std::i32;
1415
use std::int;
1516
use std::io;
16-
use std::num;
1717
use std::str;
1818

1919
static NSEC_PER_SEC: i32 = 1_000_000_000_i32;
@@ -249,7 +249,7 @@ impl Tm {
249249
} else {
250250
let s = self.strftime("%Y-%m-%dT%H:%M:%S");
251251
let sign = if self.tm_gmtoff > 0_i32 { '+' } else { '-' };
252-
let mut m = num::abs(self.tm_gmtoff) / 60_i32;
252+
let mut m = i32::abs(self.tm_gmtoff) / 60_i32;
253253
let h = m / 60_i32;
254254
m -= h * 60_i32;
255255
s + fmt!("%c%02d:%02d", sign, h as int, m as int)
@@ -832,7 +832,7 @@ priv fn do_strftime(format: &str, tm: &Tm) -> ~str {
832832
'Z' => copy tm.tm_zone,
833833
'z' => {
834834
let sign = if tm.tm_gmtoff > 0_i32 { '+' } else { '-' };
835-
let mut m = num::abs(tm.tm_gmtoff) / 60_i32;
835+
let mut m = i32::abs(tm.tm_gmtoff) / 60_i32;
836836
let h = m / 60_i32;
837837
m -= h * 60_i32;
838838
fmt!("%c%02d%02d", sign, h as int, m as int)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! `TotalOrd`.
1414
1515

16-
use std::num;
16+
use std::uint;
1717
use std::util::{swap, replace};
1818

1919
// This is implemented as an AA tree, which is a simplified variation of
@@ -63,7 +63,7 @@ fn lt<K: Ord + TotalOrd, V: Ord>(a: &TreeMap<K, V>,
6363
let mut y = b.iter();
6464

6565
let (a_len, b_len) = (a.len(), b.len());
66-
for num::min(a_len, b_len).times {
66+
for uint::min(a_len, b_len).times {
6767
let (key_a, value_a) = x.next().unwrap();
6868
let (key_b, value_b) = y.next().unwrap();
6969
if *key_a < *key_b { return true; }

branches/snap-stage3/src/librustc/back/rpath.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use metadata::cstore;
1414
use metadata::filesearch;
1515

1616
use std::hashmap::HashSet;
17-
use std::num;
1817
use std::os;
1918
use std::uint;
2019
use std::util;
@@ -142,7 +141,7 @@ pub fn get_relative_to(abs1: &Path, abs2: &Path) -> Path {
142141
assert!(len1 > 0);
143142
assert!(len2 > 0);
144143

145-
let max_common_path = num::min(len1, len2) - 1;
144+
let max_common_path = uint::min(len1, len2) - 1;
146145
let mut start_idx = 0;
147146
while start_idx < max_common_path
148147
&& split1[start_idx] == split2[start_idx] {

branches/snap-stage3/src/librustc/metadata/loader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ use syntax::{ast, attr};
2525

2626
use std::cast;
2727
use std::io;
28-
use std::num;
2928
use std::option;
3029
use std::os::consts::{macos, freebsd, linux, android, win32};
3130
use std::ptr;
3231
use std::str;
32+
use std::uint;
3333
use std::vec;
3434
use extra::flate;
3535

@@ -211,7 +211,7 @@ fn get_metadata_section(os: os,
211211
let vlen = encoder::metadata_encoding_version.len();
212212
debug!("checking %u bytes of metadata-version stamp",
213213
vlen);
214-
let minsz = num::min(vlen, csz);
214+
let minsz = uint::min(vlen, csz);
215215
let mut version_ok = false;
216216
do vec::raw::buf_as_slice(cvbuf, minsz) |buf0| {
217217
version_ok = (buf0 ==

branches/snap-stage3/src/librustc/middle/check_match.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use middle::typeck::method_map;
1818
use middle::moves;
1919
use util::ppaux::ty_to_str;
2020

21-
use std::num;
2221
use std::uint;
2322
use std::vec;
2423
use extra::sort;
@@ -245,7 +244,7 @@ pub fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@pat]) -> useful {
245244
let max_len = do m.rev_iter().fold(0) |max_len, r| {
246245
match r[0].node {
247246
pat_vec(ref before, _, ref after) => {
248-
num::max(before.len() + after.len(), max_len)
247+
uint::max(before.len() + after.len(), max_len)
249248
}
250249
_ => max_len
251250
}

0 commit comments

Comments
 (0)