Remove fk_anon

This commit is contained in:
Seo Sanghyeon 2013-12-12 23:01:47 +09:00
parent 1b12dca7f9
commit 5499b45323
8 changed files with 8 additions and 13 deletions

@ -699,7 +699,6 @@ fn check_loans_in_fn<'a>(this: &mut CheckLoanCtxt<'a>,
return;
}
visit::fk_anon(..) |
visit::fk_fn_block(..) => {
check_captured_variables(this, id, sp);
}

@ -140,7 +140,7 @@ fn gather_loans_in_fn(this: &mut GatherLoanCtxt,
}
// Visit closures as part of the containing item.
&visit::fk_anon(..) | &visit::fk_fn_block(..) => {
&visit::fk_fn_block(..) => {
this.push_repeating_id(body.id);
visit::walk_fn(this, fk, decl, body, sp, id, ());
this.pop_repeating_id(body.id);

@ -127,7 +127,6 @@ fn borrowck_fn(this: &mut BorrowckCtxt,
sp: Span,
id: ast::NodeId) {
match fk {
&visit::fk_anon(..) |
&visit::fk_fn_block(..) => {
// Closures are checked as part of their containing fn item.
}

@ -401,7 +401,7 @@ fn visit_fn(v: &mut LivenessVisitor,
sty_static => {}
}
}
visit::fk_item_fn(..) | visit::fk_anon(..) | visit::fk_fn_block(..) => {}
visit::fk_item_fn(..) | visit::fk_fn_block(..) => {}
}
// gather up the various local variables, significant expressions,

@ -456,7 +456,6 @@ fn resolve_fn(visitor: &mut RegionResolutionVisitor,
visit::fk_method(..) => {
Context {parent: None, var_parent: None, ..cx}
}
visit::fk_anon(..) |
visit::fk_fn_block(..) => {
cx
}

@ -97,7 +97,7 @@ impl<'a> Visitor<&'a ScopeChain<'a>> for LifetimeContext {
visit::walk_fn(self, fk, fd, b, s, n, &scope1);
debug!("popping fn scope id={} due to item/method", n);
}
visit::fk_anon(..) | visit::fk_fn_block(..) => {
visit::fk_fn_block(..) => {
visit::walk_fn(self, fk, fd, b, s, n, scope);
}
}

@ -542,7 +542,7 @@ impl<'a, O: IdVisitingOperation> Visitor<()> for IdVisitor<'a, O> {
self.operation.visit_id(method.self_id);
self.visit_generics_helper(generics)
}
visit::fk_anon(_) | visit::fk_fn_block => {}
visit::fk_fn_block => {}
}
for argument in function_declaration.inputs.iter() {

@ -35,10 +35,8 @@ pub enum fn_kind<'a> {
// fn foo(&self)
fk_method(Ident, &'a Generics, &'a method),
// @fn(x, y) { ... }
fk_anon(ast::Sigil),
// |x, y| ...
// proc(x, y) ...
fk_fn_block,
}
@ -47,7 +45,7 @@ pub fn name_of_fn(fk: &fn_kind) -> Ident {
fk_item_fn(name, _, _, _) | fk_method(name, _, _) => {
name
}
fk_anon(..) | fk_fn_block(..) => parse::token::special_idents::anon,
fk_fn_block(..) => parse::token::special_idents::anon,
}
}
@ -57,7 +55,7 @@ pub fn generics_of_fn(fk: &fn_kind) -> Generics {
fk_method(_, generics, _) => {
(*generics).clone()
}
fk_anon(..) | fk_fn_block(..) => {
fk_fn_block(..) => {
Generics {
lifetimes: opt_vec::Empty,
ty_params: opt_vec::Empty,
@ -507,7 +505,7 @@ pub fn walk_fn<E:Clone, V:Visitor<E>>(visitor: &mut V,
visitor.visit_explicit_self(&method.explicit_self, env.clone());
}
fk_anon(..) | fk_fn_block(..) => {
fk_fn_block(..) => {
}
}