Skip to content

Commit 97fd421

Browse files
committed
librustc: Remove fn@, fn~, and fn& from librustc. rs=defun
1 parent a3f7282 commit 97fd421

File tree

20 files changed

+58
-52
lines changed

20 files changed

+58
-52
lines changed

src/libcore/core.rc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,8 @@ pub mod core {
253253

254254
pub use cmp;
255255
pub use condition;
256-
pub use kinds;
257-
pub use ops;
258256
pub use option;
257+
pub use kinds;
259258
pub use sys;
260259
pub use pipes;
261260
}

src/librustc/front/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use syntax::{ast, fold, attr};
1515
use core::option;
1616
use core::vec;
1717

18-
type in_cfg_pred = fn@(+attrs: ~[ast::attribute]) -> bool;
18+
type in_cfg_pred = @fn(+attrs: ~[ast::attribute]) -> bool;
1919

2020
struct Context {
2121
in_cfg: in_cfg_pred

src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use syntax::fold;
2929
use syntax::print::pprust;
3030
use syntax::{ast, ast_util};
3131

32-
type node_id_gen = fn@() -> ast::node_id;
32+
type node_id_gen = @fn() -> ast::node_id;
3333

3434
struct Test {
3535
span: span,

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ use writer = std::ebml::writer;
5757
// used by astencode:
5858
type abbrev_map = oldmap::HashMap<ty::t, tyencode::ty_abbrev>;
5959

60-
pub type encode_inlined_item = fn@(ecx: @EncodeContext,
60+
pub type encode_inlined_item = @fn(ecx: @EncodeContext,
6161
ebml_w: writer::Encoder,
6262
path: &[ast_map::path_elt],
6363
ii: ast::inlined_item);

src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn parse_ident(st: @mut PState, last: char) -> ast::ident {
8181
return parse_ident_(st, |a| is_last(last, a) );
8282
}
8383

84-
fn parse_ident_(st: @mut PState, is_last: fn@(char) -> bool) ->
84+
fn parse_ident_(st: @mut PState, is_last: @fn(char) -> bool) ->
8585
ast::ident {
8686
let mut rslt = ~"";
8787
while !is_last(peek(st)) {

src/librustc/metadata/tyencode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ use middle::ty::Vid;
2929
pub struct ctxt {
3030
diag: span_handler,
3131
// Def -> str Callback:
32-
ds: fn@(def_id) -> ~str,
32+
ds: @fn(def_id) -> ~str,
3333
// The type context.
3434
tcx: ty::ctxt,
35-
reachable: fn@(node_id) -> bool,
35+
reachable: @fn(node_id) -> bool,
3636
abbrevs: abbrev_ctxt
3737
}
3838

src/librustc/middle/astencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ fn encode_side_tables_for_ii(ecx: @e::EncodeContext,
843843
let ebml_w = copy ebml_w;
844844
ast_util::visit_ids_for_inlined_item(
845845
ii,
846-
fn@(id: ast::node_id) {
846+
|id: ast::node_id| {
847847
// Note: this will cause a copy of ebml_w, which is bad as
848848
// it has mut fields. But I believe it's harmless since
849849
// we generate balanced EBML.

src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ fn req_loans_in_expr(ex: @ast::expr,
251251
// Receivers in method calls are always passed by ref.
252252
//
253253
// Here, the field a.b is in fact a closure. Eventually, this
254-
// should be an fn&, but for now it's an fn@. In any case,
254+
// should be an &fn, but for now it's an @fn. In any case,
255255
// the enclosing scope is either the call where it is a rcvr
256256
// (if used like `a.b(...)`), the call where it's an argument
257257
// (if used like `x(a.b)`), or the block (if used like `let x

src/librustc/middle/freevars.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ fn collect_freevars(def_map: resolve::DefMap, blk: &ast::blk)
4646

4747
fn ignore_item(_i: @ast::item, &&_depth: int, _v: visit::vt<int>) { }
4848

49-
let walk_expr = fn@(expr: @ast::expr, &&depth: int, v: visit::vt<int>) {
49+
let walk_expr: @fn(expr: @ast::expr, &&depth: int, v: visit::vt<int>) =
50+
|expr, depth, v| {
5051
match expr.node {
5152
ast::expr_fn(_, _, _, _) => {
5253
visit::visit_expr(expr, depth + 1, v);
@@ -100,8 +101,11 @@ pub fn annotate_freevars(def_map: resolve::DefMap, crate: @ast::crate) ->
100101
freevar_map {
101102
let freevars = HashMap();
102103
103-
let walk_fn = fn@(_fk: &visit::fn_kind, _decl: &ast::fn_decl,
104-
blk: &ast::blk, _sp: span, nid: ast::node_id) {
104+
let walk_fn: @fn(&visit::fn_kind,
105+
&ast::fn_decl,
106+
&ast::blk,
107+
span,
108+
ast::node_id) = |_, _, blk, _, nid| {
105109
let vars = collect_freevars(def_map, blk);
106110
freevars.insert(nid, vars);
107111
};

src/librustc/middle/kind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn check_crate(tcx: ty::ctxt,
8484
visit_expr: check_expr,
8585
visit_fn: check_fn,
8686
visit_ty: check_ty,
87-
visit_item: fn@(i: @item, cx: Context, v: visit::vt<Context>) {
87+
visit_item: |i, cx, v| {
8888
visit::visit_item(i, Context { current_item: i.id,.. cx }, v);
8989
},
9090
.. *visit::default_visitor()
@@ -93,7 +93,7 @@ pub fn check_crate(tcx: ty::ctxt,
9393
tcx.sess.abort_if_errors();
9494
}
9595

96-
type check_fn = fn@(Context, @freevar_entry);
96+
type check_fn = @fn(Context, @freevar_entry);
9797

9898
// Yields the appropriate function to check the kind of closed over
9999
// variables. `id` is the node_id for some expression that creates the

0 commit comments

Comments
 (0)