Skip to content

Commit 30bb09c

Browse files
committed
test: Remove fn@, fn~, and fn& from the test suite. rs=defun
1 parent 542119f commit 30bb09c

File tree

129 files changed

+306
-290
lines changed

Some content is hidden

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

129 files changed

+306
-290
lines changed

doc/tutorial.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,13 +2291,12 @@ be private. But this encapsulation is at the module level, not the
22912291
struct level. Note that fields and methods are _public_ by default.
22922292

22932293
~~~
2294-
mod farm {
2295-
# use farm;
2294+
pub mod farm {
22962295
# pub type Chicken = int;
22972296
# type Cow = int;
22982297
# enum Human = int;
22992298
# impl Human { fn rest(&self) { } }
2300-
# pub fn make_me_a_farm() -> farm::Farm { farm::Farm { chickens: ~[], cows: ~[], farmer: Human(0) } }
2299+
# pub fn make_me_a_farm() -> Farm { Farm { chickens: ~[], cows: ~[], farmer: Human(0) } }
23012300
pub struct Farm {
23022301
priv chickens: ~[Chicken],
23032302
priv cows: ~[Cow],

src/test/auxiliary/cci_nested_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use core::dvec::DVec;
1414

1515
pub struct Entry<A,B> {key: A, value: B}
1616

17-
pub struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> }
17+
pub struct alist<A,B> { eq_fn: @fn(A,A) -> bool, data: DVec<Entry<A,B>> }
1818

1919
pub fn alist_add<A:Copy,B:Copy>(lst: alist<A,B>, k: A, v: B) {
2020
lst.data.push(Entry{key:k, value:v});

src/test/auxiliary/issue4516_ty_param_lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
// except according to those terms.
1010

1111
pub fn to_closure<A:Durable + Copy>(x: A) -> @fn() -> A {
12-
fn@() -> A { copy x }
12+
let result: @fn() -> A = || copy x;
13+
result
1314
}

src/test/bench/core-std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::time::precise_time_s;
1616
use std::oldmap;
1717
use std::oldmap::{Map, HashMap};
1818

19-
use io::{Reader, ReaderUtil};
19+
use core::io::{Reader, ReaderUtil};
2020

2121
macro_rules! bench (
2222
($id:ident) => (maybe_run_test(argv, stringify!($id).to_owned(), $id))

src/test/bench/core-vec-append.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// A raw test of vector appending performance.
1212

1313
extern mod std;
14-
use dvec::DVec;
15-
use io::WriterUtil;
14+
use core::dvec::DVec;
15+
use core::io::WriterUtil;
1616

1717
fn collect_raw(num: uint) -> ~[uint] {
1818
let mut result = ~[];

src/test/bench/graph500-bfs.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
267267
colors = do par::mapi(*color_vec) {
268268
let colors = arc::clone(&color);
269269
let graph = arc::clone(&graph);
270-
fn~(+i: uint, +c: &color) -> color {
270+
let result: ~fn(+x: uint, +y: &color) -> color = |i, c| {
271271
let colors = arc::get(&colors);
272272
let graph = arc::get(&graph);
273273
match *c {
@@ -290,20 +290,22 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
290290
gray(parent) => { black(parent) }
291291
black(parent) => { black(parent) }
292292
}
293-
}
293+
};
294+
result
294295
};
295296
assert(colors.len() == old_len);
296297
}
297298
298299
// Convert the results.
299300
do par::map(colors) {
300-
fn~(c: &color) -> i64 {
301+
let result: ~fn(c: &color) -> i64 = |c| {
301302
match *c {
302303
white => { -1i64 }
303304
black(parent) => { parent }
304305
_ => { fail!(~"Found remaining gray nodes in BFS") }
305306
}
306-
}
307+
};
308+
result
307309
}
308310
}
309311
@@ -387,14 +389,15 @@ fn validate(edges: ~[(node_id, node_id)],
387389
388390
let status = do par::alli(tree) {
389391
let edges = copy edges;
390-
fn~(+u: uint, v: &i64) -> bool {
392+
let result: ~fn(+x: uint, v: &i64) -> bool = |u, v| {
391393
let u = u as node_id;
392394
if *v == -1i64 || u == root {
393395
true
394396
} else {
395397
edges.contains(&(u, *v)) || edges.contains(&(*v, u))
396398
}
397-
}
399+
};
400+
result
398401
};
399402
400403
if !status { return status }

src/test/bench/msgsend-pipes-shared.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#[legacy_modes];
2222

2323
extern mod std;
24-
use io::Writer;
25-
use io::WriterUtil;
24+
use core::io::Writer;
25+
use core::io::WriterUtil;
2626

27-
use comm::{Port, Chan, SharedChan};
27+
use core::comm::{Port, Chan, SharedChan};
2828

2929
macro_rules! move_out (
3030
{ $x:expr } => { unsafe { let y = *ptr::addr_of(&($x)); y } }

src/test/bench/msgsend-pipes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#[legacy_modes];
1818

1919
extern mod std;
20-
use io::Writer;
21-
use io::WriterUtil;
20+
use core::io::Writer;
21+
use core::io::WriterUtil;
2222

23-
use comm::{Port, PortSet, Chan, stream};
23+
use core::comm::{Port, PortSet, Chan, stream};
2424

2525
macro_rules! move_out (
2626
{ $x:expr } => { unsafe { let y = *ptr::addr_of(&($x)); y } }

src/test/bench/shootout-fasta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* http://shootout.alioth.debian.org/
1717
*/
1818
extern mod std;
19-
use io::WriterUtil;
19+
use core::io::WriterUtil;
2020

2121
fn LINE_LENGTH() -> uint { return 60u; }
2222

src/test/bench/shootout-k-nucleotide-pipes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ extern mod std;
1717
use std::oldmap;
1818
use std::oldmap::HashMap;
1919
use std::sort;
20-
use io::ReaderUtil;
21-
use comm::{stream, Port, Chan};
22-
use cmp::Ord;
20+
use core::io::ReaderUtil;
21+
use core::comm::{stream, Port, Chan};
22+
use core::cmp::Ord;
2323

2424
// given a map, print a sorted version of it
2525
fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str {

0 commit comments

Comments
 (0)