Skip to content

Remove fk_anon #10935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/librustc/middle/borrowck/check_loans.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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