Skip to content

Commit 38d1efd

Browse files
committed
DeclKind
1 parent 55a4664 commit 38d1efd

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

clippy_lints/src/utils/author.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
599599
let current = format!("{}.node", decl_pat);
600600
match decl.node {
601601
// A local (let) binding:
602-
Decl_::DeclLocal(ref local) => {
602+
DeclKind::Local(ref local) => {
603603
let local_pat = self.next("local");
604604
println!("DeclLocal(ref {}) = {};", local_pat, current);
605605
if let Some(ref init) = local.init {
@@ -612,7 +612,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
612612
self.visit_pat(&local.pat);
613613
},
614614
// An item binding:
615-
Decl_::DeclItem(_) => {
615+
DeclKind::Item(_) => {
616616
println!("DeclItem(item_id) = {};", current);
617617
},
618618
}

tests/ui/author.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if_chain! {
22
if let StmtKind::Decl(ref decl, _) = stmt.node
3-
if let Decl_::DeclLocal(ref local) = decl.node;
3+
if let DeclKind::Local(ref local) = decl.node;
44
if let Some(ref init) = local.init
55
if let ExprKind::Cast(ref expr, ref cast_ty) = init.node;
66
if let TyKind::Path(ref qp) = cast_ty.node;

tests/ui/author/call.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if_chain! {
22
if let StmtKind::Decl(ref decl, _) = stmt.node
3-
if let Decl_::DeclLocal(ref local) = decl.node;
3+
if let DeclKind::Local(ref local) = decl.node;
44
if let Some(ref init) = local.init
55
if let ExprKind::Call(ref func, ref args) = init.node;
66
if let ExprKind::Path(ref path) = func.node;

tests/ui/author/for_loop.stdout

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if_chain! {
22
if let ExprKind::Block(ref block) = expr.node;
33
if let StmtKind::Decl(ref decl, _) = block.node
4-
if let Decl_::DeclLocal(ref local) = decl.node;
4+
if let DeclKind::Local(ref local) = decl.node;
55
if let Some(ref init) = local.init
66
if let ExprKind::Match(ref expr, ref arms, MatchSource::ForLoopDesugar) = init.node;
77
if let ExprKind::Call(ref func, ref args) = expr.node;
@@ -15,7 +15,7 @@ if_chain! {
1515
if arms.len() == 1;
1616
if let ExprKind::Loop(ref body, ref label, LoopSource::ForLoop) = arms[0].body.node;
1717
if let StmtKind::Decl(ref decl1, _) = body.node
18-
if let Decl_::DeclLocal(ref local1) = decl1.node;
18+
if let DeclKind::Local(ref local1) = decl1.node;
1919
if let PatKind::Binding(BindingAnnotation::Mutable, _, name, None) = local1.pat.node;
2020
if name.node.as_str() == "__next";
2121
if let StmtKind::Expr(ref e, _) = local1.pat.node
@@ -43,7 +43,7 @@ if_chain! {
4343
if let PatKind::Path(ref path7) = arms1[1].pats[0].node;
4444
if match_qpath(path7, &["{{root}}", "std", "option", "Option", "None"]);
4545
if let StmtKind::Decl(ref decl2, _) = path7.node
46-
if let Decl_::DeclLocal(ref local2) = decl2.node;
46+
if let DeclKind::Local(ref local2) = decl2.node;
4747
if let Some(ref init1) = local2.init
4848
if let ExprKind::Path(ref path8) = init1.node;
4949
if match_qpath(path8, &["__next"]);
@@ -52,7 +52,7 @@ if_chain! {
5252
if let StmtKind::Expr(ref e1, _) = local2.pat.node
5353
if let ExprKind::Block(ref block1) = e1.node;
5454
if let StmtKind::Decl(ref decl3, _) = block1.node
55-
if let Decl_::DeclLocal(ref local3) = decl3.node;
55+
if let DeclKind::Local(ref local3) = decl3.node;
5656
if let Some(ref init2) = local3.init
5757
if let ExprKind::Path(ref path9) = init2.node;
5858
if match_qpath(path9, &["y"]);

tests/ui/author/matches.stout

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if_chain! {
22
if let StmtKind::Decl(ref decl, _) = stmt.node
3-
if let Decl_::DeclLocal(ref local) = decl.node;
3+
if let DeclKind::Local(ref local) = decl.node;
44
if let Some(ref init) = local.init
55
if let ExprKind::Match(ref expr, ref arms, MatchSource::Normal) = init.node;
66
if let ExprKind::Lit(ref lit) = expr.node;
@@ -14,7 +14,7 @@ if_chain! {
1414
if let LitKind::Int(16, _) = lit2.node;
1515
if let ExprKind::Block(ref block) = arms[1].body.node;
1616
if let StmtKind::Decl(ref decl1, _) = block.node
17-
if let Decl_::DeclLocal(ref local1) = decl1.node;
17+
if let DeclKind::Local(ref local1) = decl1.node;
1818
if let Some(ref init1) = local1.init
1919
if let ExprKind::Lit(ref lit3) = init1.node;
2020
if let LitKind::Int(3, _) = lit3.node;

0 commit comments

Comments
 (0)