Skip to content

Commit

Permalink
FnFnBlock -> FkClosure
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Aug 16, 2015
1 parent 27db6e1 commit c03bf18
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/librustc/ast_map/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl<'a> FnLikeNode<'a> {
visit::FkItemFn(p.ident, p.generics, p.unsafety, p.constness, p.abi, p.vis)
};
let closure = |_: ClosureParts| {
visit::FkFnBlock
visit::FkClosure
};
let method = |_, ident, sig: &'a ast::MethodSig, vis, _, _| {
visit::FkMethod(ident, sig, vis)
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ fn check_fn(cx: &mut MatchCheckCtxt,
sp: Span,
fn_id: NodeId) {
match kind {
visit::FkFnBlock => {}
visit::FkClosure => {}
_ => cx.param_env = ParameterEnvironment::for_item(cx.tcx, fn_id),
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/intrinsicck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for IntrinsicCheckingVisitor<'a, 'tcx> {
visit::walk_fn(self, fk, fd, b, s);
self.param_envs.pop();
}
visit::FkFnBlock(..) => {
visit::FkClosure(..) => {
visit::walk_fn(self, fk, fd, b, s);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
this.walk_fn(fk, fd, b, s)
})
}
visit::FkFnBlock(..) => {
visit::FkClosure(..) => {
self.walk_fn(fk, fd, b, s)
}
}
Expand Down Expand Up @@ -484,7 +484,7 @@ impl<'a> LifetimeContext<'a> {
self.visit_generics(&sig.generics);
self.visit_explicit_self(&sig.explicit_self);
}
visit::FkFnBlock(..) => {
visit::FkClosure(..) => {
visit::walk_fn_decl(self, fd);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/borrowck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for BorrowckCtxt<'a, 'tcx> {
self.free_region_map = old_free_region_map;
}

visit::FkFnBlock => {
visit::FkClosure => {
borrowck_fn(self, fk, fd, b, s, id);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,7 @@ impl LintPass for UnconditionalRecursion {
cx.tcx.impl_or_trait_item(local_def(id)).as_opt_method()
}
// closures can't recur, so they don't matter.
visit::FkFnBlock => return
visit::FkClosure => return
};

// Walk through this function (say `f`) looking to see if
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Resolver<'a, 'tcx> {
self.visit_explicit_self(&sig.explicit_self);
MethodRibKind
}
visit::FkFnBlock(..) => ClosureRibKind(node_id)
visit::FkClosure(..) => ClosureRibKind(node_id)
};
self.resolve_function(rib_kind, declaration, block);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/wf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ impl<'ccx, 'tcx, 'v> Visitor<'v> for CheckTypeWellFormedVisitor<'ccx, 'tcx> {
fk: visit::FnKind<'v>, fd: &'v ast::FnDecl,
b: &'v ast::Block, span: Span, id: ast::NodeId) {
match fk {
visit::FkFnBlock | visit::FkItemFn(..) => {}
visit::FkClosure | visit::FkItemFn(..) => {}
visit::FkMethod(..) => {
match self.tcx().impl_or_trait_item(local_def(id)) {
ty::ImplOrTraitItem::MethodTraitItem(ty_method) => {
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 @@ -444,7 +444,7 @@ impl<'a, 'v, O: IdVisitingOperation> Visitor<'v> for IdVisitor<'a, O> {
visit::FkMethod(_, sig, _) => {
self.visit_generics_helper(&sig.generics)
}
visit::FkFnBlock => {}
visit::FkClosure => {}
}

for argument in &function_declaration.inputs {
Expand Down
8 changes: 4 additions & 4 deletions src/libsyntax/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub enum FnKind<'a> {
/// fn foo(&self)
FkMethod(Ident, &'a MethodSig, Option<Visibility>),

/// Closures (|x, y| {})
FkFnBlock,
/// |x, y| {}
FkClosure,
}

/// Each method of the Visitor trait is a hook to be potentially
Expand Down Expand Up @@ -615,7 +615,7 @@ pub fn walk_fn<'v, V: Visitor<'v>>(visitor: &mut V,
visitor.visit_generics(&sig.generics);
visitor.visit_explicit_self(&sig.explicit_self);
}
FkFnBlock(..) => {}
FkClosure(..) => {}
}

visitor.visit_block(function_body)
Expand Down Expand Up @@ -816,7 +816,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
}
}
ExprClosure(_, ref function_declaration, ref body) => {
visitor.visit_fn(FkFnBlock,
visitor.visit_fn(FkClosure,
&**function_declaration,
&**body,
expression.span,
Expand Down

0 comments on commit c03bf18

Please sign in to comment.