remove all kind annotations from closures
This commit is contained in:
@@ -63,7 +63,7 @@ fn cs_clone(
|
||||
cx.ident_of("Clone"),
|
||||
cx.ident_of("clone"),
|
||||
];
|
||||
let subcall = |&: field: &FieldInfo| {
|
||||
let subcall = |field: &FieldInfo| {
|
||||
let args = vec![cx.expr_addr_of(field.span, field.self_.clone())];
|
||||
|
||||
cx.expr_call_global(field.span, fn_path.clone(), args)
|
||||
|
||||
@@ -57,7 +57,7 @@ fn default_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructur
|
||||
cx.ident_of("Default"),
|
||||
cx.ident_of("default")
|
||||
);
|
||||
let default_call = |&: span| cx.expr_call_global(span, default_ident.clone(), Vec::new());
|
||||
let default_call = |span| cx.expr_call_global(span, default_ident.clone(), Vec::new());
|
||||
|
||||
return match *substr.fields {
|
||||
StaticStruct(_, ref summary) => {
|
||||
|
||||
@@ -957,7 +957,7 @@ impl<'a> MethodDef<'a> {
|
||||
// where each tuple has length = self_args.len()
|
||||
let mut match_arms: Vec<ast::Arm> = variants.iter().enumerate()
|
||||
.map(|(index, variant)| {
|
||||
let mk_self_pat = |&: cx: &mut ExtCtxt, self_arg_name: &str| {
|
||||
let mk_self_pat = |cx: &mut ExtCtxt, self_arg_name: &str| {
|
||||
let (p, idents) = trait_.create_enum_variant_pattern(cx, type_ident,
|
||||
&**variant,
|
||||
self_arg_name,
|
||||
|
||||
@@ -66,7 +66,7 @@ fn hash_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
|
||||
[ref state_expr] => state_expr,
|
||||
_ => cx.span_bug(trait_span, "incorrect number of arguments in `derive(Hash)`")
|
||||
};
|
||||
let call_hash = |&: span, thing_expr| {
|
||||
let call_hash = |span, thing_expr| {
|
||||
let hash_path = {
|
||||
let strs = vec![
|
||||
cx.ident_of("std"),
|
||||
|
||||
@@ -70,7 +70,7 @@ fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
|
||||
cx.ident_of("Rand"),
|
||||
cx.ident_of("rand")
|
||||
);
|
||||
let rand_call = |&: cx: &mut ExtCtxt, span| {
|
||||
let rand_call = |cx: &mut ExtCtxt, span| {
|
||||
cx.expr_call_global(span,
|
||||
rand_ident.clone(),
|
||||
vec!(rng.clone()))
|
||||
|
||||
@@ -1089,7 +1089,7 @@ fn expand_annotatable(a: Annotatable,
|
||||
// but that double-mut-borrows fld
|
||||
let mut items: SmallVector<P<ast::Item>> = SmallVector::zero();
|
||||
dec.expand(fld.cx, attr.span, &*attr.node.value, &**it,
|
||||
box |&mut: item| items.push(item));
|
||||
box |item| items.push(item));
|
||||
decorator_items.extend(items.into_iter()
|
||||
.flat_map(|item| expand_item(item, fld).into_iter()));
|
||||
|
||||
@@ -1850,7 +1850,7 @@ mod test {
|
||||
assert!((shouldmatch.len() == 0) ||
|
||||
(varrefs.len() > *shouldmatch.iter().max().unwrap()));
|
||||
for (idx,varref) in varrefs.iter().enumerate() {
|
||||
let print_hygiene_debug_info = |&:| {
|
||||
let print_hygiene_debug_info = || {
|
||||
// good lord, you can't make a path with 0 segments, can you?
|
||||
let final_varref_ident = match varref.segments.last() {
|
||||
Some(pathsegment) => pathsegment.identifier,
|
||||
|
||||
@@ -307,7 +307,7 @@ impl<'a, 'b> Context<'a, 'b> {
|
||||
|
||||
fn trans_count(&self, c: parse::Count) -> P<ast::Expr> {
|
||||
let sp = self.fmtsp;
|
||||
let count = |: c, arg| {
|
||||
let count = |c, arg| {
|
||||
let mut path = Context::rtpath(self.ecx, "Count");
|
||||
path.push(self.ecx.ident_of(c));
|
||||
match arg {
|
||||
@@ -353,7 +353,7 @@ impl<'a, 'b> Context<'a, 'b> {
|
||||
parse::NextArgument(ref arg) => {
|
||||
// Translate the position
|
||||
let pos = {
|
||||
let pos = |: c, arg| {
|
||||
let pos = |c, arg| {
|
||||
let mut path = Context::rtpath(self.ecx, "Position");
|
||||
path.push(self.ecx.ident_of(c));
|
||||
match arg {
|
||||
@@ -404,7 +404,7 @@ impl<'a, 'b> Context<'a, 'b> {
|
||||
|
||||
// Translate the format
|
||||
let fill = self.ecx.expr_lit(sp, ast::LitChar(fill));
|
||||
let align = |:name| {
|
||||
let align = |name| {
|
||||
let mut p = Context::rtpath(self.ecx, "Alignment");
|
||||
p.push(self.ecx.ident_of(name));
|
||||
self.ecx.path_global(sp, p)
|
||||
|
||||
@@ -791,11 +791,11 @@ fn expand_parse_call(cx: &ExtCtxt,
|
||||
tts: &[ast::TokenTree]) -> P<ast::Expr> {
|
||||
let (cx_expr, tts_expr) = expand_tts(cx, sp, tts);
|
||||
|
||||
let cfg_call = |&:| cx.expr_method_call(
|
||||
let cfg_call = || cx.expr_method_call(
|
||||
sp, cx.expr_ident(sp, id_ext("ext_cx")),
|
||||
id_ext("cfg"), Vec::new());
|
||||
|
||||
let parse_sess_call = |&:| cx.expr_method_call(
|
||||
let parse_sess_call = || cx.expr_method_call(
|
||||
sp, cx.expr_ident(sp, id_ext("ext_cx")),
|
||||
id_ext("parse_sess"), Vec::new());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user