Skip to content

Commit 9cd5005

Browse files
committed
---
yaml --- r: 50571 b: refs/heads/try c: d18f785 h: refs/heads/master i: 50569: 6019695 50567: a86e4c6 v: v3
1 parent 0800ccc commit 9cd5005

File tree

199 files changed

+814
-813
lines changed

Some content is hidden

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

199 files changed

+814
-813
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5-
refs/heads/try: 51cdca0bf0d3efc554c1815df9306ea10e881a14
5+
refs/heads/try: d18f7854578e8c2e1d7dce90db6e3b5cf9befba9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub fn is_test_ignored(config: config, testfile: &Path) -> bool {
103103
}
104104
}
105105
106-
fn iter_header(testfile: &Path, it: fn(~str) -> bool) -> bool {
106+
fn iter_header(testfile: &Path, it: &fn(~str) -> bool) -> bool {
107107
let rdr = io::file_reader(testfile).get();
108108
while !rdr.eof() {
109109
let ln = rdr.read_line();

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ fn compose_and_run(config: config, testfile: &Path,
530530
}
531531

532532
fn make_compile_args(config: config, props: TestProps, extras: ~[~str],
533-
xform: fn(config, (&Path)) -> Path,
533+
xform: &fn(config, (&Path)) -> Path,
534534
testfile: &Path) -> ProcArgs {
535535
let prog = config.rustc_path;
536536
let mut args = ~[testfile.to_str(),

branches/try/src/libcore/at_vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub pure fn capacity<T>(v: @[const T]) -> uint {
6161
*/
6262
#[inline(always)]
6363
pub pure fn build_sized<A>(size: uint,
64-
builder: &fn(push: pure fn(v: A))) -> @[A] {
64+
builder: &fn(push: &pure fn(v: A))) -> @[A] {
6565
let mut vec: @[const A] = @[];
6666
unsafe { raw::reserve(&mut vec, size); }
6767
builder(|+x| unsafe { raw::push(&mut vec, x) });
@@ -79,7 +79,7 @@ pub pure fn build_sized<A>(size: uint,
7979
* onto the vector being constructed.
8080
*/
8181
#[inline(always)]
82-
pub pure fn build<A>(builder: &fn(push: pure fn(v: A))) -> @[A] {
82+
pub pure fn build<A>(builder: &fn(push: &pure fn(v: A))) -> @[A] {
8383
build_sized(4, builder)
8484
}
8585

@@ -97,7 +97,7 @@ pub pure fn build<A>(builder: &fn(push: pure fn(v: A))) -> @[A] {
9797
*/
9898
#[inline(always)]
9999
pub pure fn build_sized_opt<A>(size: Option<uint>,
100-
builder: &fn(push: pure fn(v: A))) -> @[A] {
100+
builder: &fn(push: &pure fn(v: A))) -> @[A] {
101101
build_sized(size.get_or_default(4), builder)
102102
}
103103

branches/try/src/libcore/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub pure fn to_str(v: bool) -> ~str { if v { ~"true" } else { ~"false" } }
6767
* Iterates over all truth values by passing them to `blk` in an unspecified
6868
* order
6969
*/
70-
pub fn all_values(blk: fn(v: bool)) {
70+
pub fn all_values(blk: &fn(v: bool)) {
7171
blk(true);
7272
blk(false);
7373
}

branches/try/src/libcore/cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub impl<T> Cell<T> {
5454
}
5555

5656
// Calls a closure with a reference to the value.
57-
fn with_ref<R>(&self, op: fn(v: &T) -> R) -> R {
57+
fn with_ref<R>(&self, op: &fn(v: &T) -> R) -> R {
5858
let v = self.take();
5959
let r = op(&v);
6060
self.put_back(v);

branches/try/src/libcore/cleanup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct AnnihilateStats {
124124
n_bytes_freed: uint
125125
}
126126

127-
unsafe fn each_live_alloc(f: fn(box: *mut BoxRepr, uniq: bool) -> bool) {
127+
unsafe fn each_live_alloc(f: &fn(box: *mut BoxRepr, uniq: bool) -> bool) {
128128
use managed;
129129

130130
let task: *Task = transmute(rustrt::rust_get_task());

branches/try/src/libcore/container.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ pub trait Map<K, V>: Mutable {
3030
pure fn contains_key(&self, key: &K) -> bool;
3131

3232
/// Visit all keys
33-
pure fn each_key(&self, f: fn(&K) -> bool);
33+
pure fn each_key(&self, f: &fn(&K) -> bool);
3434

3535
/// Visit all values
36-
pure fn each_value(&self, f: fn(&V) -> bool);
36+
pure fn each_value(&self, f: &fn(&V) -> bool);
3737

3838
/// Return the value corresponding to the key in the map
3939
pure fn find(&self, key: &K) -> Option<&self/V>;
@@ -71,14 +71,14 @@ pub trait Set<T>: Mutable {
7171
pure fn is_superset(&self, other: &Self) -> bool;
7272

7373
/// Visit the values representing the difference
74-
pure fn difference(&self, other: &Self, f: fn(&T) -> bool);
74+
pure fn difference(&self, other: &Self, f: &fn(&T) -> bool);
7575

7676
/// Visit the values representing the symmetric difference
77-
pure fn symmetric_difference(&self, other: &Self, f: fn(&T) -> bool);
77+
pure fn symmetric_difference(&self, other: &Self, f: &fn(&T) -> bool);
7878

7979
/// Visit the values representing the intersection
80-
pure fn intersection(&self, other: &Self, f: fn(&T) -> bool);
80+
pure fn intersection(&self, other: &Self, f: &fn(&T) -> bool);
8181

8282
/// Visit the values representing the union
83-
pure fn union(&self, other: &Self, f: fn(&T) -> bool);
83+
pure fn union(&self, other: &Self, f: &fn(&T) -> bool);
8484
}

branches/try/src/libcore/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ pub impl<T> DList<T> {
399399
}
400400
401401
/// Iterate over nodes.
402-
pure fn each_node(@mut self, f: fn(@mut DListNode<T>) -> bool) {
402+
pure fn each_node(@mut self, f: &fn(@mut DListNode<T>) -> bool) {
403403
let mut link = self.peek_n();
404404
while link.is_some() {
405405
let nobe = link.get();

branches/try/src/libcore/either.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ pub enum Either<T, U> {
2424
}
2525

2626
#[inline(always)]
27-
pub fn either<T, U, V>(f_left: fn(&T) -> V,
28-
f_right: fn(&U) -> V, value: &Either<T, U>) -> V {
27+
pub fn either<T, U, V>(f_left: &fn(&T) -> V,
28+
f_right: &fn(&U) -> V, value: &Either<T, U>) -> V {
2929
/*!
3030
* Applies a function based on the given either value
3131
*
@@ -148,7 +148,7 @@ pub pure fn unwrap_right<T,U>(eith: Either<T,U>) -> U {
148148

149149
pub impl<T, U> Either<T, U> {
150150
#[inline(always)]
151-
fn either<V>(&self, f_left: fn(&T) -> V, f_right: fn(&U) -> V) -> V {
151+
fn either<V>(&self, f_left: &fn(&T) -> V, f_right: &fn(&U) -> V) -> V {
152152
either(f_left, f_right, self)
153153
}
154154

branches/try/src/libcore/hashmap.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub mod linear {
8686

8787
#[inline(always)]
8888
pure fn bucket_sequence(&self, hash: uint,
89-
op: fn(uint) -> bool) -> uint {
89+
op: &fn(uint) -> bool) -> uint {
9090
let start_idx = self.to_bucket(hash);
9191
let len_buckets = self.buckets.len();
9292
let mut idx = start_idx;
@@ -263,7 +263,7 @@ pub mod linear {
263263
}
264264
265265
fn search(&self, hash: uint,
266-
op: fn(x: &Option<Bucket<K, V>>) -> bool) {
266+
op: &fn(x: &Option<Bucket<K, V>>) -> bool) {
267267
let _ = self.bucket_sequence(hash, |i| op(&self.buckets[i]));
268268
}
269269
}
@@ -272,7 +272,7 @@ pub mod linear {
272272
BaseIter<(&self/K, &self/V)> for LinearMap<K, V>
273273
{
274274
/// Visit all key-value pairs
275-
pure fn each(&self, blk: fn(&(&self/K, &self/V)) -> bool) {
275+
pure fn each(&self, blk: &fn(&(&self/K, &self/V)) -> bool) {
276276
for uint::range(0, self.buckets.len()) |i| {
277277
let mut broke = false;
278278
do self.buckets[i].map |bucket| {
@@ -315,12 +315,12 @@ pub mod linear {
315315
}
316316
317317
/// Visit all keys
318-
pure fn each_key(&self, blk: fn(k: &K) -> bool) {
318+
pure fn each_key(&self, blk: &fn(k: &K) -> bool) {
319319
self.each(|&(k, _)| blk(k))
320320
}
321321
322322
/// Visit all values
323-
pure fn each_value(&self, blk: fn(v: &V) -> bool) {
323+
pure fn each_value(&self, blk: &fn(v: &V) -> bool) {
324324
self.each(|&(_, v)| blk(v))
325325
}
326326
@@ -428,7 +428,7 @@ pub mod linear {
428428
429429
/// Return the value corresponding to the key in the map, or create,
430430
/// insert, and return a new value if it doesn't exist.
431-
fn find_or_insert_with(&mut self, k: K, f: fn(&K) -> V) -> &self/V {
431+
fn find_or_insert_with(&mut self, k: K, f: &fn(&K) -> V) -> &self/V {
432432
if self.size >= self.resize_at {
433433
// n.b.: We could also do this after searching, so
434434
// that we do not resize if this call to insert is
@@ -457,7 +457,7 @@ pub mod linear {
457457
}
458458
}
459459
460-
fn consume(&mut self, f: fn(K, V)) {
460+
fn consume(&mut self, f: &fn(K, V)) {
461461
let mut buckets = ~[];
462462
self.buckets <-> buckets;
463463
self.size = 0;
@@ -526,7 +526,7 @@ pub mod linear {
526526

527527
impl<T:Hash + IterBytes + Eq> BaseIter<T> for LinearSet<T> {
528528
/// Visit all values in order
529-
pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) }
529+
pure fn each(&self, f: &fn(&T) -> bool) { self.map.each_key(f) }
530530
pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
531531
}
532532

@@ -583,7 +583,7 @@ pub mod linear {
583583
}
584584

585585
/// Visit the values representing the difference
586-
pure fn difference(&self, other: &LinearSet<T>, f: fn(&T) -> bool) {
586+
pure fn difference(&self, other: &LinearSet<T>, f: &fn(&T) -> bool) {
587587
for self.each |v| {
588588
if !other.contains(v) {
589589
if !f(v) { return }
@@ -593,13 +593,13 @@ pub mod linear {
593593

594594
/// Visit the values representing the symmetric difference
595595
pure fn symmetric_difference(&self, other: &LinearSet<T>,
596-
f: fn(&T) -> bool) {
596+
f: &fn(&T) -> bool) {
597597
self.difference(other, f);
598598
other.difference(self, f);
599599
}
600600

601601
/// Visit the values representing the intersection
602-
pure fn intersection(&self, other: &LinearSet<T>, f: fn(&T) -> bool) {
602+
pure fn intersection(&self, other: &LinearSet<T>, f: &fn(&T) -> bool) {
603603
for self.each |v| {
604604
if other.contains(v) {
605605
if !f(v) { return }
@@ -608,7 +608,7 @@ pub mod linear {
608608
}
609609

610610
/// Visit the values representing the union
611-
pure fn union(&self, other: &LinearSet<T>, f: fn(&T) -> bool) {
611+
pure fn union(&self, other: &LinearSet<T>, f: &fn(&T) -> bool) {
612612
for self.each |v| {
613613
if !f(v) { return }
614614
}

branches/try/src/libcore/io.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ pub trait ReaderUtil {
118118
fn read_whole_stream(&self) -> ~[u8];
119119

120120
/// Iterate over every byte until the iterator breaks or EOF.
121-
fn each_byte(&self, it: fn(int) -> bool);
121+
fn each_byte(&self, it: &fn(int) -> bool);
122122

123123
/// Iterate over every char until the iterator breaks or EOF.
124-
fn each_char(&self, it: fn(char) -> bool);
124+
fn each_char(&self, it: &fn(char) -> bool);
125125

126126
/// Iterate over every line until the iterator breaks or EOF.
127-
fn each_line(&self, it: fn(&str) -> bool);
127+
fn each_line(&self, it: &fn(&str) -> bool);
128128

129129
/// Read n (between 1 and 8) little-endian unsigned integer bytes.
130130
fn read_le_uint_n(&self, nbytes: uint) -> u64;
@@ -315,19 +315,19 @@ impl<T:Reader> ReaderUtil for T {
315315
bytes
316316
}
317317

318-
fn each_byte(&self, it: fn(int) -> bool) {
318+
fn each_byte(&self, it: &fn(int) -> bool) {
319319
while !self.eof() {
320320
if !it(self.read_byte()) { break; }
321321
}
322322
}
323323

324-
fn each_char(&self, it: fn(char) -> bool) {
324+
fn each_char(&self, it: &fn(char) -> bool) {
325325
while !self.eof() {
326326
if !it(self.read_char()) { break; }
327327
}
328328
}
329329

330-
fn each_line(&self, it: fn(s: &str) -> bool) {
330+
fn each_line(&self, it: &fn(s: &str) -> bool) {
331331
while !self.eof() {
332332
if !it(self.read_line()) { break; }
333333
}
@@ -618,11 +618,11 @@ impl Reader for BytesReader/&self {
618618
fn tell(&self) -> uint { self.pos }
619619
}
620620
621-
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(@Reader) -> t) -> t {
621+
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: &fn(@Reader) -> t) -> t {
622622
f(@BytesReader { bytes: bytes, pos: 0u } as @Reader)
623623
}
624624
625-
pub pure fn with_str_reader<T>(s: &str, f: fn(@Reader) -> T) -> T {
625+
pub pure fn with_str_reader<T>(s: &str, f: &fn(@Reader) -> T) -> T {
626626
str::byte_slice(s, |bytes| with_bytes_reader(bytes, f))
627627
}
628628
@@ -819,7 +819,7 @@ pub fn mk_file_writer(path: &Path, flags: &[FileFlag])
819819
}
820820

821821
pub fn u64_to_le_bytes<T>(n: u64, size: uint,
822-
f: fn(v: &[u8]) -> T) -> T {
822+
f: &fn(v: &[u8]) -> T) -> T {
823823
fail_unless!(size <= 8u);
824824
match size {
825825
1u => f(&[n as u8]),
@@ -851,7 +851,7 @@ pub fn u64_to_le_bytes<T>(n: u64, size: uint,
851851
}
852852

853853
pub fn u64_to_be_bytes<T>(n: u64, size: uint,
854-
f: fn(v: &[u8]) -> T) -> T {
854+
f: &fn(v: &[u8]) -> T) -> T {
855855
fail_unless!(size <= 8u);
856856
match size {
857857
1u => f(&[n as u8]),
@@ -1142,14 +1142,14 @@ pub pure fn BytesWriter() -> BytesWriter {
11421142
BytesWriter { bytes: ~[], mut pos: 0u }
11431143
}
11441144
1145-
pub pure fn with_bytes_writer(f: fn(Writer)) -> ~[u8] {
1145+
pub pure fn with_bytes_writer(f: &fn(Writer)) -> ~[u8] {
11461146
let wr = @BytesWriter();
11471147
f(wr as Writer);
11481148
let @BytesWriter{bytes, _} = wr;
11491149
return bytes;
11501150
}
11511151
1152-
pub pure fn with_str_writer(f: fn(Writer)) -> ~str {
1152+
pub pure fn with_str_writer(f: &fn(Writer)) -> ~str {
11531153
let mut v = with_bytes_writer(f);
11541154
11551155
// FIXME (#3758): This should not be needed.
@@ -1251,7 +1251,7 @@ pub mod fsync {
12511251
// FIXME (#2004) find better way to create resources within lifetime of
12521252
// outer res
12531253
pub fn FILE_res_sync(file: &FILERes, opt_level: Option<Level>,
1254-
blk: fn(v: Res<*libc::FILE>)) {
1254+
blk: &fn(v: Res<*libc::FILE>)) {
12551255
unsafe {
12561256
blk(Res(Arg {
12571257
val: file.f, opt_level: opt_level,
@@ -1266,7 +1266,7 @@ pub mod fsync {
12661266

12671267
// fsync fd after executing blk
12681268
pub fn fd_res_sync(fd: &FdRes, opt_level: Option<Level>,
1269-
blk: fn(v: Res<fd_t>)) {
1269+
blk: &fn(v: Res<fd_t>)) {
12701270
blk(Res(Arg {
12711271
val: fd.fd, opt_level: opt_level,
12721272
fsync_fn: |fd, l| os::fsync_fd(fd, l) as int
@@ -1278,7 +1278,7 @@ pub mod fsync {
12781278

12791279
// Call o.fsync after executing blk
12801280
pub fn obj_sync(o: FSyncable, opt_level: Option<Level>,
1281-
blk: fn(v: Res<FSyncable>)) {
1281+
blk: &fn(v: Res<FSyncable>)) {
12821282
blk(Res(Arg {
12831283
val: o, opt_level: opt_level,
12841284
fsync_fn: |o, l| o.fsync(l)

0 commit comments

Comments
 (0)