librustc: Make the default sigil for block lambdas & instead of @.

This commit is contained in:
Graydon Hoare
2013-01-15 16:33:20 -08:00
parent bd6536f868
commit 84825ee310
23 changed files with 70 additions and 72 deletions

View File

@@ -213,7 +213,9 @@ fn print_diagnostic(topic: ~str, lvl: level, msg: &str) {
fn collect(messages: @DVec<~str>)
-> fn@(Option<(@codemap::CodeMap, span)>, &str, level)
{
|_o, msg: &str, _l| { messages.push(msg.to_str()); }
let f: @fn(Option<(@codemap::CodeMap, span)>, &str, level) =
|_o, msg: &str, _l| { messages.push(msg.to_str()); };
f
}
fn emit(cmsp: Option<(@codemap::CodeMap, span)>, msg: &str, lvl: level) {

View File

@@ -136,8 +136,8 @@ fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
cx.span_fatal(best_fail_spot, best_fail_msg);
}
let exp = |cx, sp, arg| generic_extension(cx, sp, name,
arg, lhses, rhses);
let exp: @fn(ext_ctxt, span, ~[ast::token_tree]) -> mac_result =
|cx, sp, arg| generic_extension(cx, sp, name, arg, lhses, rhses);
return mr_def({
name: *cx.parse_sess().interner.get(name),

View File

@@ -641,7 +641,8 @@ fn mk_simple_visitor(v: simple_visitor) -> vt<()> {
f(fk, decl, body, sp, id);
visit_fn(fk, decl, body, sp, id, e, v);
}
let visit_ty = |a,b,c| v_ty(v.visit_ty, a, b, c);
let visit_ty: @fn(@Ty, &&x: (), vt<()>) =
|a,b,c| v_ty(v.visit_ty, a, b, c);
fn v_struct_field(f: fn@(@struct_field), sf: @struct_field, &&e: (),
v: vt<()>) {
f(sf);