Skip to content

Commit

Permalink
Remove fk_anon
Browse files Browse the repository at this point in the history
  • Loading branch information
sanxiyn committed Dec 12, 2013
1 parent 1b12dca commit 5499b45
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/librustc/middle/borrowck/check_loans.rs
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/borrowck/gather_loans/mod.rs
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/librustc/middle/borrowck/mod.rs
Expand Up @@ -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.
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/liveness.rs
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/librustc/middle/region.rs
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve_lifetime.rs
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast_util.rs
Expand Up @@ -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() {
Expand Down
10 changes: 4 additions & 6 deletions src/libsyntax/visit.rs
Expand Up @@ -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,
}

Expand All @@ -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,
}
}

Expand All @@ -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,
Expand Down Expand Up @@ -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(..) => {
}
}

Expand Down

5 comments on commit 5499b45

@bors
Copy link
Contributor

@bors bors commented on 5499b45 Dec 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at sanxiyn@5499b45

@bors
Copy link
Contributor

@bors bors commented on 5499b45 Dec 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging sanxiyn/rust/fk-anon = 5499b45 into auto

@bors
Copy link
Contributor

@bors bors commented on 5499b45 Dec 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanxiyn/rust/fk-anon = 5499b45 merged ok, testing candidate = 00b1adf

@bors
Copy link
Contributor

@bors bors commented on 5499b45 Dec 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 5499b45 Dec 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 00b1adf

Please sign in to comment.