diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index 1900837d87e..0f67520d8d3 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -144,7 +144,7 @@ fn borrowck_fn(this: &mut BorrowckCtxt, check_loans::check_loans(this, &loan_dfcx, flowed_moves, all_loans.as_slice(), body); - visit::walk_fn(this, fk, decl, body, sp, id, ()); + visit::walk_fn(this, fk, decl, body, sp, ()); } // ---------------------------------------------------------------------- @@ -830,4 +830,3 @@ impl Repr for LoanPath { } } } - diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index b48fddac1a4..1017f4cfe2f 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -37,8 +37,8 @@ impl<'a> Visitor<()> for MatchCheckCtxt<'a> { fn visit_local(&mut self, l: &Local, _: ()) { check_local(self, l); } - fn visit_fn(&mut self, fk: &FnKind, fd: &FnDecl, b: &Block, s: Span, n: NodeId, _: ()) { - check_fn(self, fk, fd, b, s, n); + fn visit_fn(&mut self, fk: &FnKind, fd: &FnDecl, b: &Block, s: Span, _: NodeId, _: ()) { + check_fn(self, fk, fd, b, s); } } @@ -866,9 +866,8 @@ fn check_fn(cx: &mut MatchCheckCtxt, kind: &FnKind, decl: &FnDecl, body: &Block, - sp: Span, - id: NodeId) { - visit::walk_fn(cx, kind, decl, body, sp, id, ()); + sp: Span) { + visit::walk_fn(cx, kind, decl, body, sp, ()); for input in decl.inputs.iter() { if is_refutable(cx, input.pat) { cx.tcx.sess.span_err(input.pat.span, diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index 21fd963c21f..2819d7493a6 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -86,7 +86,7 @@ impl<'a> EffectCheckVisitor<'a> { impl<'a> Visitor<()> for EffectCheckVisitor<'a> { fn visit_fn(&mut self, fn_kind: &visit::FnKind, fn_decl: &ast::FnDecl, - block: &ast::Block, span: Span, node_id: ast::NodeId, _:()) { + block: &ast::Block, span: Span, _: ast::NodeId, _:()) { let (is_item_fn, is_unsafe_fn) = match *fn_kind { visit::FkItemFn(_, _, fn_style, _) => @@ -103,7 +103,7 @@ impl<'a> Visitor<()> for EffectCheckVisitor<'a> { self.unsafe_context = SafeContext } - visit::walk_fn(self, fn_kind, fn_decl, block, span, node_id, ()); + visit::walk_fn(self, fn_kind, fn_decl, block, span, ()); self.unsafe_context = old_unsafe_context } diff --git a/src/librustc/middle/freevars.rs b/src/librustc/middle/freevars.rs index 8839164434a..47523f4f750 100644 --- a/src/librustc/middle/freevars.rs +++ b/src/librustc/middle/freevars.rs @@ -115,7 +115,7 @@ impl<'a> Visitor<()> for AnnotateFreevarsVisitor<'a> { blk: &ast::Block, s: Span, nid: ast::NodeId, _: ()) { let vars = collect_freevars(self.def_map, blk); self.freevars.insert(nid, vars); - visit::walk_fn(self, fk, fd, blk, s, nid, ()); + visit::walk_fn(self, fk, fd, blk, s, ()); } } diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index 2604884350b..81d6fc87a91 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -235,7 +235,7 @@ fn check_fn( }); }); - visit::walk_fn(cx, fk, decl, body, sp, fn_id, ()); + visit::walk_fn(cx, fk, decl, body, sp, ()); } pub fn check_expr(cx: &mut Context, e: &Expr) { diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 1bf4d0a02fa..062a7418287 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -1775,7 +1775,7 @@ impl<'a> Visitor<()> for Context<'a> { fn visit_fn(&mut self, fk: &visit::FnKind, decl: &ast::FnDecl, body: &ast::Block, span: Span, id: ast::NodeId, _: ()) { let recurse = |this: &mut Context| { - visit::walk_fn(this, fk, decl, body, span, id, ()); + visit::walk_fn(this, fk, decl, body, span, ()); }; for a in decl.inputs.iter(){ @@ -1810,15 +1810,15 @@ impl<'a> Visitor<()> for Context<'a> { fn visit_struct_def(&mut self, s: &ast::StructDef, - i: ast::Ident, - g: &ast::Generics, + _: ast::Ident, + _: &ast::Generics, id: ast::NodeId, _: ()) { check_struct_uppercase_variable(self, s); let old_id = self.cur_struct_def_id; self.cur_struct_def_id = id; - visit::walk_struct_def(self, s, i, g, id, ()); + visit::walk_struct_def(self, s, ()); self.cur_struct_def_id = old_id; } diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index f80940a17e2..02599d7a368 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -383,7 +383,7 @@ fn visit_fn(ir: &mut IrMaps, // gather up the various local variables, significant expressions, // and so forth: - visit::walk_fn(&mut fn_maps, fk, decl, body, sp, id, ()); + visit::walk_fn(&mut fn_maps, fk, decl, body, sp, ()); // Special nodes and variables: // - exit_ln represents the end of the fn, either by return or fail diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index 5be9226ef74..d7aba420864 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -107,11 +107,11 @@ impl Visitor<()> for ParentVisitor { if !self.parents.contains_key(&id) { self.parents.insert(id, self.curparent); } - visit::walk_fn(self, a, b, c, d, id, ()); + visit::walk_fn(self, a, b, c, d, ()); } - fn visit_struct_def(&mut self, s: &ast::StructDef, i: ast::Ident, - g: &ast::Generics, n: ast::NodeId, _: ()) { + fn visit_struct_def(&mut self, s: &ast::StructDef, _: ast::Ident, + _: &ast::Generics, n: ast::NodeId, _: ()) { // Struct constructors are parented to their struct definitions because // they essentially are the struct definitions. match s.ctor_id { @@ -124,7 +124,7 @@ impl Visitor<()> for ParentVisitor { for field in s.fields.iter() { self.parents.insert(field.node.id, self.curparent); } - visit::walk_struct_def(self, s, i, g, n, ()) + visit::walk_struct_def(self, s, ()) } } @@ -1006,10 +1006,10 @@ impl<'a> Visitor<()> for SanePrivacyVisitor<'a> { } fn visit_fn(&mut self, fk: &visit::FnKind, fd: &ast::FnDecl, - b: &ast::Block, s: Span, n: ast::NodeId, _: ()) { + b: &ast::Block, s: Span, _: ast::NodeId, _: ()) { // This catches both functions and methods let orig_in_fn = replace(&mut self.in_fn, true); - visit::walk_fn(self, fk, fd, b, s, n, ()); + visit::walk_fn(self, fk, fd, b, s, ()); self.in_fn = orig_in_fn; } @@ -1363,7 +1363,7 @@ impl<'a> Visitor<()> for VisiblePrivateTypesVisitor<'a> { _: ()) { // needs special handling for methods. if self.exported_items.contains(&id) { - visit::walk_fn(self, fk, fd, b, s, id, ()); + visit::walk_fn(self, fk, fd, b, s, ()); } } diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 88989f7ce08..048bbb7d4cd 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -102,10 +102,10 @@ impl<'a, 'b> Visitor> for LifetimeContext<'b> { visit::FkMethod(_, generics, _) => { self.visit_fn_decl( n, generics, scope, - |this, scope1| visit::walk_fn(this, fk, fd, b, s, n, scope1)) + |this, scope1| visit::walk_fn(this, fk, fd, b, s, scope1)) } visit::FkFnBlock(..) => { - visit::walk_fn(self, fk, fd, b, s, n, scope) + visit::walk_fn(self, fk, fd, b, s, scope) } } } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index fb69e440b2f..ffb18e17bda 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -546,7 +546,6 @@ impl<'a, O: IdVisitingOperation> Visitor<()> for IdVisitor<'a, O> { function_declaration, block, span, - node_id, env); if !self.pass_through_items { @@ -564,13 +563,13 @@ impl<'a, O: IdVisitingOperation> Visitor<()> for IdVisitor<'a, O> { fn visit_struct_def(&mut self, struct_def: &StructDef, - ident: ast::Ident, - generics: &ast::Generics, + _: ast::Ident, + _: &ast::Generics, id: NodeId, _: ()) { self.operation.visit_id(id); struct_def.ctor_id.map(|ctor_id| self.operation.visit_id(ctor_id)); - visit::walk_struct_def(self, struct_def, ident, generics, id, ()); + visit::walk_struct_def(self, struct_def, ()); } fn visit_trait_method(&mut self, tm: &ast::TraitMethod, _: ()) { diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index f715b3a68ae..f820fbd784a 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -79,13 +79,13 @@ pub trait Visitor { fn visit_expr_post(&mut self, _ex: &Expr, _e: E) { } fn visit_ty(&mut self, t: &Ty, e: E) { walk_ty(self, t, e) } fn visit_generics(&mut self, g: &Generics, e: E) { walk_generics(self, g, e) } - fn visit_fn(&mut self, fk: &FnKind, fd: &FnDecl, b: &Block, s: Span, n: NodeId, e: E) { - walk_fn(self, fk, fd, b, s, n , e) + fn visit_fn(&mut self, fk: &FnKind, fd: &FnDecl, b: &Block, s: Span, _: NodeId, e: E) { + walk_fn(self, fk, fd, b, s, e) } fn visit_ty_method(&mut self, t: &TypeMethod, e: E) { walk_ty_method(self, t, e) } fn visit_trait_method(&mut self, t: &TraitMethod, e: E) { walk_trait_method(self, t, e) } - fn visit_struct_def(&mut self, s: &StructDef, i: Ident, g: &Generics, n: NodeId, e: E) { - walk_struct_def(self, s, i, g, n, e) + fn visit_struct_def(&mut self, s: &StructDef, _: Ident, _: &Generics, _: NodeId, e: E) { + walk_struct_def(self, s, e) } fn visit_struct_field(&mut self, s: &StructField, e: E) { walk_struct_field(self, s, e) } fn visit_variant(&mut self, v: &Variant, g: &Generics, e: E) { walk_variant(self, v, g, e) } @@ -522,7 +522,6 @@ pub fn walk_fn>(visitor: &mut V, function_declaration: &FnDecl, function_body: &Block, _span: Span, - _: NodeId, env: E) { walk_fn_decl(visitor, function_declaration, env.clone()); @@ -566,9 +565,6 @@ pub fn walk_trait_method>(visitor: &mut V, pub fn walk_struct_def>(visitor: &mut V, struct_definition: &StructDef, - _: Ident, - _: &Generics, - _: NodeId, env: E) { match struct_definition.super_struct { Some(t) => visitor.visit_ty(t, env.clone()),