From 8e929946fdf1151736fbad530d96aeb624f8e884 Mon Sep 17 00:00:00 2001 From: csmoe <35686186+csmoe@users.noreply.github.com> Date: Thu, 12 Jul 2018 16:55:41 +0800 Subject: [PATCH] DeclKind --- clippy_lints/src/utils/author.rs | 4 ++-- tests/ui/author.stdout | 2 +- tests/ui/author/call.stdout | 2 +- tests/ui/author/for_loop.stdout | 8 ++++---- tests/ui/author/matches.stout | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index eccb8e53583..e61367fb0b6 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -599,7 +599,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor { let current = format!("{}.node", decl_pat); match decl.node { // A local (let) binding: - Decl_::DeclLocal(ref local) => { + DeclKind::Local(ref local) => { let local_pat = self.next("local"); println!("DeclLocal(ref {}) = {};", local_pat, current); if let Some(ref init) = local.init { @@ -612,7 +612,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor { self.visit_pat(&local.pat); }, // An item binding: - Decl_::DeclItem(_) => { + DeclKind::Item(_) => { println!("DeclItem(item_id) = {};", current); }, } diff --git a/tests/ui/author.stdout b/tests/ui/author.stdout index 4b97e546ad3..b06fb1d21e3 100644 --- a/tests/ui/author.stdout +++ b/tests/ui/author.stdout @@ -1,6 +1,6 @@ if_chain! { if let StmtKind::Decl(ref decl, _) = stmt.node - if let Decl_::DeclLocal(ref local) = decl.node; + if let DeclKind::Local(ref local) = decl.node; if let Some(ref init) = local.init if let ExprKind::Cast(ref expr, ref cast_ty) = init.node; if let TyKind::Path(ref qp) = cast_ty.node; diff --git a/tests/ui/author/call.stdout b/tests/ui/author/call.stdout index c04909c78dd..1c25708fb48 100644 --- a/tests/ui/author/call.stdout +++ b/tests/ui/author/call.stdout @@ -1,6 +1,6 @@ if_chain! { if let StmtKind::Decl(ref decl, _) = stmt.node - if let Decl_::DeclLocal(ref local) = decl.node; + if let DeclKind::Local(ref local) = decl.node; if let Some(ref init) = local.init if let ExprKind::Call(ref func, ref args) = init.node; if let ExprKind::Path(ref path) = func.node; diff --git a/tests/ui/author/for_loop.stdout b/tests/ui/author/for_loop.stdout index 7c2213b9c49..b99e8e0ade5 100644 --- a/tests/ui/author/for_loop.stdout +++ b/tests/ui/author/for_loop.stdout @@ -1,7 +1,7 @@ if_chain! { if let ExprKind::Block(ref block) = expr.node; if let StmtKind::Decl(ref decl, _) = block.node - if let Decl_::DeclLocal(ref local) = decl.node; + if let DeclKind::Local(ref local) = decl.node; if let Some(ref init) = local.init if let ExprKind::Match(ref expr, ref arms, MatchSource::ForLoopDesugar) = init.node; if let ExprKind::Call(ref func, ref args) = expr.node; @@ -15,7 +15,7 @@ if_chain! { if arms.len() == 1; if let ExprKind::Loop(ref body, ref label, LoopSource::ForLoop) = arms[0].body.node; if let StmtKind::Decl(ref decl1, _) = body.node - if let Decl_::DeclLocal(ref local1) = decl1.node; + if let DeclKind::Local(ref local1) = decl1.node; if let PatKind::Binding(BindingAnnotation::Mutable, _, name, None) = local1.pat.node; if name.node.as_str() == "__next"; if let StmtKind::Expr(ref e, _) = local1.pat.node @@ -43,7 +43,7 @@ if_chain! { if let PatKind::Path(ref path7) = arms1[1].pats[0].node; if match_qpath(path7, &["{{root}}", "std", "option", "Option", "None"]); if let StmtKind::Decl(ref decl2, _) = path7.node - if let Decl_::DeclLocal(ref local2) = decl2.node; + if let DeclKind::Local(ref local2) = decl2.node; if let Some(ref init1) = local2.init if let ExprKind::Path(ref path8) = init1.node; if match_qpath(path8, &["__next"]); @@ -52,7 +52,7 @@ if_chain! { if let StmtKind::Expr(ref e1, _) = local2.pat.node if let ExprKind::Block(ref block1) = e1.node; if let StmtKind::Decl(ref decl3, _) = block1.node - if let Decl_::DeclLocal(ref local3) = decl3.node; + if let DeclKind::Local(ref local3) = decl3.node; if let Some(ref init2) = local3.init if let ExprKind::Path(ref path9) = init2.node; if match_qpath(path9, &["y"]); diff --git a/tests/ui/author/matches.stout b/tests/ui/author/matches.stout index 63d669d4a7d..94b25aefabe 100644 --- a/tests/ui/author/matches.stout +++ b/tests/ui/author/matches.stout @@ -1,6 +1,6 @@ if_chain! { if let StmtKind::Decl(ref decl, _) = stmt.node - if let Decl_::DeclLocal(ref local) = decl.node; + if let DeclKind::Local(ref local) = decl.node; if let Some(ref init) = local.init if let ExprKind::Match(ref expr, ref arms, MatchSource::Normal) = init.node; if let ExprKind::Lit(ref lit) = expr.node; @@ -14,7 +14,7 @@ if_chain! { if let LitKind::Int(16, _) = lit2.node; if let ExprKind::Block(ref block) = arms[1].body.node; if let StmtKind::Decl(ref decl1, _) = block.node - if let Decl_::DeclLocal(ref local1) = decl1.node; + if let DeclKind::Local(ref local1) = decl1.node; if let Some(ref init1) = local1.init if let ExprKind::Lit(ref lit3) = init1.node; if let LitKind::Int(3, _) = lit3.node;