Skip to content

Commit 62f6c60

Browse files
committed
---
yaml --- r: 32312 b: refs/heads/dist-snap c: 4128cc4 h: refs/heads/master v: v3
1 parent b859d1c commit 62f6c60

File tree

24 files changed

+104
-103
lines changed

24 files changed

+104
-103
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: 638db28c472c1edadc3c37f900df28f14cca7665
10+
refs/heads/dist-snap: 4128cc4cb44acb415be3cfdfa008fd6c95ceee74
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/fuzzer/fuzzer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,18 +249,18 @@ fn check_variants_T<T: copy>(
249249
cx: context
250250
) {
251251
error!("%s contains %u %s objects", filename.to_str(),
252-
vec::len(things), thing_label);
252+
things.len(), thing_label);
253253

254254
// Assuming we're not generating any token_trees
255255
let intr = syntax::parse::token::mk_fake_ident_interner();
256256

257-
let L = vec::len(things);
257+
let L = things.len();
258258

259-
if L < 100u {
260-
do under(uint::min(&L, &20u)) |i| {
259+
if L < 100 {
260+
do under(uint::min(L, 20)) |i| {
261261
log(error, ~"Replacing... #" + uint::str(i));
262262
let fname = str::from_slice(filename.to_str());
263-
do under(uint::min(&L, &30u)) |j| {
263+
do under(uint::min(L, 30)) |j| {
264264
log(error, ~"With... " + stringifier(@things[j], intr));
265265
let crate2 = @replacer(crate, i, things[j], cx.mode);
266266
// It would be best to test the *crate* for stability, but

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ const bytes : uint = (inst::bits / 8);
2525
const min_value: T = (-1 as T) << (bits - 1);
2626
const max_value: T = min_value - 1 as T;
2727

28-
pure fn min(x: &T, y: &T) -> T { if *x < *y { *x } else { *y } }
29-
pure fn max(x: &T, y: &T) -> T { if *x > *y { *x } else { *y } }
30-
31-
pure fn add(x: &T, y: &T) -> T { *x + *y }
32-
pure fn sub(x: &T, y: &T) -> T { *x - *y }
33-
pure fn mul(x: &T, y: &T) -> T { *x * *y }
34-
pure fn div(x: &T, y: &T) -> T { *x / *y }
35-
pure fn rem(x: &T, y: &T) -> T { *x % *y }
36-
37-
pure fn lt(x: &T, y: &T) -> bool { *x < *y }
38-
pure fn le(x: &T, y: &T) -> bool { *x <= *y }
39-
pure fn eq(x: &T, y: &T) -> bool { *x == *y }
40-
pure fn ne(x: &T, y: &T) -> bool { *x != *y }
41-
pure fn ge(x: &T, y: &T) -> bool { *x >= *y }
42-
pure fn gt(x: &T, y: &T) -> bool { *x > *y }
28+
pure fn min(x: T, y: T) -> T { if x < y { x } else { y } }
29+
pure fn max(x: T, y: T) -> T { if x > y { x } else { y } }
30+
31+
pure fn add(x: T, y: T) -> T { x + y }
32+
pure fn sub(x: T, y: T) -> T { x - y }
33+
pure fn mul(x: T, y: T) -> T { x * y }
34+
pure fn div(x: T, y: T) -> T { x / y }
35+
pure fn rem(x: T, y: T) -> T { x % y }
36+
37+
pure fn lt(x: T, y: T) -> bool { x < y }
38+
pure fn le(x: T, y: T) -> bool { x <= y }
39+
pure fn eq(x: T, y: T) -> bool { x == y }
40+
pure fn ne(x: T, y: T) -> bool { x != y }
41+
pure fn ge(x: T, y: T) -> bool { x >= y }
42+
pure fn gt(x: T, y: T) -> bool { x > y }
4343

4444
pure fn is_positive(x: T) -> bool { x > 0 as T }
4545
pure fn is_negative(x: T) -> bool { x < 0 as T }

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ type T = int;
22
const bits: uint = uint::bits;
33

44
/// Produce a uint suitable for use in a hash table
5-
pure fn hash(x: &int) -> uint {
6-
let u : uint = *x as uint;
7-
uint::hash(&u)
5+
pure fn hash(x: int) -> uint {
6+
let u : uint = x as uint;
7+
uint::hash(u)
88
}
99

1010
/// Returns `base` raised to the power of `exponent`

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ type ByteBuf = {buf: &[const u8], mut pos: uint};
285285
286286
impl ByteBuf: Reader {
287287
fn read(buf: &[mut u8], len: uint) -> uint {
288-
let count = uint::min(&len, &(self.buf.len() - self.pos));
288+
let count = uint::min(len, self.buf.len() - self.pos);
289289
290290
vec::u8::memcpy(buf,
291291
vec::const_view(self.buf, self.pos, self.buf.len()),
@@ -668,7 +668,7 @@ impl MemBuffer: Writer {
668668
let v_len = v.len();
669669
let buf_len = buf.len();
670670
671-
let count = uint::max(&buf_len, &(self.pos + v_len));
671+
let count = uint::max(buf_len, self.pos + v_len);
672672
vec::reserve(buf, count);
673673
unsafe { vec::unsafe::set_len(buf, count); }
674674

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ pure fn eq(a: &~str, b: &~str) -> bool {
682682
/// Bytewise slice less than
683683
pure fn lt(a: &str, b: &str) -> bool {
684684
let (a_len, b_len) = (a.len(), b.len());
685-
let mut end = uint::min(&a_len, &b_len);
685+
let mut end = uint::min(a_len, b_len);
686686

687687
let mut i = 0;
688688
while i < end {
@@ -698,7 +698,7 @@ pure fn lt(a: &str, b: &str) -> bool {
698698
/// Bytewise less than or equal
699699
pure fn le(a: &str, b: &str) -> bool {
700700
let (a_len, b_len) = (a.len(), b.len());
701-
let mut end = uint::min(&a_len, &b_len);
701+
let mut end = uint::min(a_len, b_len);
702702

703703
let mut i = 0;
704704
while i < end {

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ const bytes : uint = (inst::bits / 8);
2424
const min_value: T = 0 as T;
2525
const max_value: T = 0 as T - 1 as T;
2626

27-
pure fn min(x: &T, y: &T) -> T { if *x < *y { *x } else { *y } }
28-
pure fn max(x: &T, y: &T) -> T { if *x > *y { *x } else { *y } }
29-
30-
pure fn add(x: &T, y: &T) -> T { *x + *y }
31-
pure fn sub(x: &T, y: &T) -> T { *x - *y }
32-
pure fn mul(x: &T, y: &T) -> T { *x * *y }
33-
pure fn div(x: &T, y: &T) -> T { *x / *y }
34-
pure fn rem(x: &T, y: &T) -> T { *x % *y }
35-
36-
pure fn lt(x: &T, y: &T) -> bool { *x < *y }
37-
pure fn le(x: &T, y: &T) -> bool { *x <= *y }
38-
pure fn eq(x: &T, y: &T) -> bool { *x == *y }
39-
pure fn ne(x: &T, y: &T) -> bool { *x != *y }
40-
pure fn ge(x: &T, y: &T) -> bool { *x >= *y }
41-
pure fn gt(x: &T, y: &T) -> bool { *x > *y }
27+
pure fn min(x: T, y: T) -> T { if x < y { x } else { y } }
28+
pure fn max(x: T, y: T) -> T { if x > y { x } else { y } }
29+
30+
pure fn add(x: T, y: T) -> T { x + y }
31+
pure fn sub(x: T, y: T) -> T { x - y }
32+
pure fn mul(x: T, y: T) -> T { x * y }
33+
pure fn div(x: T, y: T) -> T { x / y }
34+
pure fn rem(x: T, y: T) -> T { x % y }
35+
36+
pure fn lt(x: T, y: T) -> bool { x < y }
37+
pure fn le(x: T, y: T) -> bool { x <= y }
38+
pure fn eq(x: T, y: T) -> bool { x == y }
39+
pure fn ne(x: T, y: T) -> bool { x != y }
40+
pure fn ge(x: T, y: T) -> bool { x >= y }
41+
pure fn gt(x: T, y: T) -> bool { x > y }
4242

4343
pure fn is_positive(x: T) -> bool { x > 0 as T }
4444
pure fn is_negative(x: T) -> bool { x < 0 as T }

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ pure fn div_round(x: uint, y: uint) -> uint {
6161
pure fn div_floor(x: uint, y: uint) -> uint { return x / y; }
6262

6363
/// Produce a uint suitable for use in a hash table
64-
pure fn hash(x: &uint) -> uint {
65-
hash::hash_uint(*x) as uint
64+
pure fn hash(x: uint) -> uint {
65+
hash::hash_uint(x) as uint
6666
}
6767

6868
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ impl<T: Eq> @[T]: Eq {
14271427

14281428
pure fn lt<T: Ord>(a: &[T], b: &[T]) -> bool {
14291429
let (a_len, b_len) = (a.len(), b.len());
1430-
let mut end = uint::min(&a_len, &b_len);
1430+
let mut end = uint::min(a_len, b_len);
14311431

14321432
let mut i = 0;
14331433
while i < end {
@@ -1841,7 +1841,7 @@ mod u8 {
18411841
pure fn cmp(a: &~[u8], b: &~[u8]) -> int {
18421842
let a_len = len(*a);
18431843
let b_len = len(*b);
1844-
let n = uint::min(&a_len, &b_len) as libc::size_t;
1844+
let n = uint::min(a_len, b_len) as libc::size_t;
18451845
let r = unsafe {
18461846
libc::memcmp(unsafe::to_ptr(*a) as *libc::c_void,
18471847
unsafe::to_ptr(*b) as *libc::c_void, n) as int

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl &Arena {
135135
fn alloc_pod_grow(n_bytes: uint, align: uint) -> *u8 {
136136
// Allocate a new chunk.
137137
let chunk_size = at_vec::capacity(self.pod_head.data);
138-
let new_min_chunk_size = uint::max(&n_bytes, &chunk_size);
138+
let new_min_chunk_size = uint::max(n_bytes, chunk_size);
139139
self.chunks = @cons(copy self.pod_head, self.chunks);
140140
self.pod_head =
141141
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), true);
@@ -177,7 +177,7 @@ impl &Arena {
177177
fn alloc_nonpod_grow(n_bytes: uint, align: uint) -> (*u8, *u8) {
178178
// Allocate a new chunk.
179179
let chunk_size = at_vec::capacity(self.head.data);
180-
let new_min_chunk_size = uint::max(&n_bytes, &chunk_size);
180+
let new_min_chunk_size = uint::max(n_bytes, chunk_size);
181181
self.chunks = @cons(copy self.head, self.chunks);
182182
self.head =
183183
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), false);

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,12 @@ fn bytes_hash<V: copy>() -> hashmap<~[u8], V> {
426426

427427
/// Construct a hashmap for int keys
428428
fn int_hash<V: copy>() -> hashmap<int, V> {
429-
return hashmap(int::hash, int::eq);
429+
return hashmap(|x| { int::hash(*x) }, |x, y| { int::eq(*x, *y)});
430430
}
431431

432432
/// Construct a hashmap for uint keys
433433
fn uint_hash<V: copy>() -> hashmap<uint, V> {
434-
return hashmap(uint::hash, uint::eq);
434+
return hashmap(|x| { uint::hash(*x) }, |x, y| { uint::eq(*x, *y) } );
435435
}
436436

437437
/// Convenience function for adding keys to a hashmap with nil type keys
@@ -473,15 +473,15 @@ fn hash_from_bytes<V: copy>(items: &[(~[u8], V)]) -> hashmap<~[u8], V> {
473473

474474
/// Construct a hashmap from a vector with int keys
475475
fn hash_from_ints<V: copy>(items: &[(int, V)]) -> hashmap<int, V> {
476-
hash_from_vec(int::hash, int::eq, items)
476+
hash_from_vec(|x| { int::hash(*x) }, |x, y| { int::eq(*x, *y) }, items)
477477
}
478478

479479
/// Construct a hashmap from a vector with uint keys
480480
fn hash_from_uints<V: copy>(items: &[(uint, V)]) -> hashmap<uint, V> {
481-
hash_from_vec(uint::hash, uint::eq, items)
481+
hash_from_vec(|x| { uint::hash(*x) }, |x, y| { uint::eq(*x, *y) } , items)
482482
}
483483

484-
// XXX Transitionary
484+
// XXX Transitional
485485
impl<K: Eq IterBytes Hash copy, V: copy> Managed<LinearMap<K, V>>:
486486
map<K, V> {
487487
pure fn size() -> uint {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ impl TcpSocketBuf: io::Reader {
772772
}
773773
}
774774

775-
let count = uint::min(&len, &self.data.buf.len());
775+
let count = uint::min(len, self.data.buf.len());
776776

777777
let mut data = ~[];
778778
self.data.buf <-> data;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ fn map_slices<A: copy send, B: copy send>(
3030
~[f()(0u, xs)]
3131
}
3232
else {
33-
let num_tasks = uint::min(&max_tasks, &(len / min_granularity));
33+
let num_tasks = uint::min(max_tasks, len / min_granularity);
3434

3535
let items_per_task = len / num_tasks;
3636

3737
let mut futures = ~[];
3838
let mut base = 0u;
3939
log(info, ~"spawning tasks");
4040
while base < len {
41-
let end = uint::min(&len, &(base + items_per_task));
41+
let end = uint::min(len, base + items_per_task);
4242
// FIXME: why is the ::<A, ()> annotation required here? (#2617)
4343
do vec::as_buf::<A, ()>(xs) |p, _len| {
4444
let f = f();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ mod node {
10041004
right : right,
10051005
char_len: char_len(left) + char_len(right),
10061006
byte_len: byte_len(left) + byte_len(right),
1007-
height: uint::max(&height(left), &height(right)) + 1u
1007+
height: uint::max(height(left), height(right)) + 1u
10081008
})
10091009
}
10101010

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

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

243243
let expected = ~[1, 2, 3];
244244

245-
sort::quick_sort(int::le, names);
245+
sort::quick_sort(|x, y| { int::le(*x, *y) }, names);
246246

247247
let immut_names = vec::from_mut(names);
248248

branches/dist-snap/src/libsyntax/ast_util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,8 @@ fn compute_id_range(visit_ids_fn: fn(fn@(node_id))) -> id_range {
568568
let min = @mut int::max_value;
569569
let max = @mut int::min_value;
570570
do visit_ids_fn |id| {
571-
*min = int::min(min, &id);
572-
*max = int::max(max, &(id + 1));
571+
*min = int::min(*min, id);
572+
*max = int::max(*max, id + 1);
573573
}
574574
return {min:*min, max:*max};
575575
}

branches/dist-snap/src/libsyntax/parse/comments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: ~[~str],
182182
s: ~str, col: uint) unsafe {
183183
let mut s1;
184184
let len = str::len(s);
185-
if all_whitespace(s, 0u, uint::min(&len, &col)) {
185+
if all_whitespace(s, 0u, uint::min(len, col)) {
186186
if col < len {
187187
s1 = str::slice(s, col, len);
188188
} else { s1 = ~""; }

branches/dist-snap/src/rustc/back/rpath.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,20 @@ fn get_relative_to(abs1: &Path, abs2: &Path) -> Path {
125125
let split2 = abs2.components;
126126
let len1 = vec::len(split1);
127127
let len2 = vec::len(split2);
128-
assert len1 > 0u;
129-
assert len2 > 0u;
128+
assert len1 > 0;
129+
assert len2 > 0;
130130

131-
let max_common_path = uint::min(&len1, &len2) - 1u;
132-
let mut start_idx = 0u;
131+
let max_common_path = uint::min(len1, len2) - 1;
132+
let mut start_idx = 0;
133133
while start_idx < max_common_path
134134
&& split1[start_idx] == split2[start_idx] {
135-
start_idx += 1u;
135+
start_idx += 1;
136136
}
137137

138138
let mut path = ~[];
139-
for uint::range(start_idx, len1 - 1u) |_i| { vec::push(path, ~".."); };
139+
for uint::range(start_idx, len1 - 1) |_i| { vec::push(path, ~".."); };
140140

141-
vec::push_all(path, vec::view(split2, start_idx, len2 - 1u));
141+
vec::push_all(path, vec::view(split2, start_idx, len2 - 1));
142142

143143
if vec::is_not_empty(path) {
144144
return Path("").push_many(path);

branches/dist-snap/src/rustc/driver/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ Options:
8181
8282
fn describe_warnings() {
8383
let lint_dict = lint::get_lint_dict();
84-
let mut max_key = 0u;
85-
for lint_dict.each_key |k| { max_key = uint::max(&k.len(), &max_key); }
84+
let mut max_key = 0;
85+
for lint_dict.each_key |k| { max_key = uint::max(k.len(), max_key); }
8686
fn padded(max: uint, s: ~str) -> ~str {
8787
str::from_bytes(vec::from_elem(max - s.len(), ' ' as u8)) + s
8888
}

branches/dist-snap/src/rustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fn Atom(n: uint) -> Atom {
304304

305305
/// Creates a hash table of atoms.
306306
fn atom_hashmap<V:copy>() -> hashmap<Atom,V> {
307-
hashmap::<Atom,V>(uint::hash, uint::eq)
307+
hashmap::<Atom,V>(|x| { uint::hash(*x) }, |x, y| { uint::eq(*x, *y) })
308308
}
309309

310310
/// One local scope.

0 commit comments

Comments
 (0)