This commit is contained in:
csmoe 2018-07-12 16:55:41 +08:00 committed by Oliver Schneider
parent 8cf463fe93
commit 8e929946fd
5 changed files with 10 additions and 10 deletions

View file

@ -599,7 +599,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
let current = format!("{}.node", decl_pat); let current = format!("{}.node", decl_pat);
match decl.node { match decl.node {
// A local (let) binding: // A local (let) binding:
Decl_::DeclLocal(ref local) => { DeclKind::Local(ref local) => {
let local_pat = self.next("local"); let local_pat = self.next("local");
println!("DeclLocal(ref {}) = {};", local_pat, current); println!("DeclLocal(ref {}) = {};", local_pat, current);
if let Some(ref init) = local.init { if let Some(ref init) = local.init {
@ -612,7 +612,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
self.visit_pat(&local.pat); self.visit_pat(&local.pat);
}, },
// An item binding: // An item binding:
Decl_::DeclItem(_) => { DeclKind::Item(_) => {
println!("DeclItem(item_id) = {};", current); println!("DeclItem(item_id) = {};", current);
}, },
} }

View file

@ -1,6 +1,6 @@
if_chain! { if_chain! {
if let StmtKind::Decl(ref decl, _) = stmt.node 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 Some(ref init) = local.init
if let ExprKind::Cast(ref expr, ref cast_ty) = init.node; if let ExprKind::Cast(ref expr, ref cast_ty) = init.node;
if let TyKind::Path(ref qp) = cast_ty.node; if let TyKind::Path(ref qp) = cast_ty.node;

View file

@ -1,6 +1,6 @@
if_chain! { if_chain! {
if let StmtKind::Decl(ref decl, _) = stmt.node 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 Some(ref init) = local.init
if let ExprKind::Call(ref func, ref args) = init.node; if let ExprKind::Call(ref func, ref args) = init.node;
if let ExprKind::Path(ref path) = func.node; if let ExprKind::Path(ref path) = func.node;

View file

@ -1,7 +1,7 @@
if_chain! { if_chain! {
if let ExprKind::Block(ref block) = expr.node; if let ExprKind::Block(ref block) = expr.node;
if let StmtKind::Decl(ref decl, _) = block.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 Some(ref init) = local.init
if let ExprKind::Match(ref expr, ref arms, MatchSource::ForLoopDesugar) = init.node; if let ExprKind::Match(ref expr, ref arms, MatchSource::ForLoopDesugar) = init.node;
if let ExprKind::Call(ref func, ref args) = expr.node; if let ExprKind::Call(ref func, ref args) = expr.node;
@ -15,7 +15,7 @@ if_chain! {
if arms.len() == 1; if arms.len() == 1;
if let ExprKind::Loop(ref body, ref label, LoopSource::ForLoop) = arms[0].body.node; if let ExprKind::Loop(ref body, ref label, LoopSource::ForLoop) = arms[0].body.node;
if let StmtKind::Decl(ref decl1, _) = 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 let PatKind::Binding(BindingAnnotation::Mutable, _, name, None) = local1.pat.node;
if name.node.as_str() == "__next"; if name.node.as_str() == "__next";
if let StmtKind::Expr(ref e, _) = local1.pat.node 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 let PatKind::Path(ref path7) = arms1[1].pats[0].node;
if match_qpath(path7, &["{{root}}", "std", "option", "Option", "None"]); if match_qpath(path7, &["{{root}}", "std", "option", "Option", "None"]);
if let StmtKind::Decl(ref decl2, _) = path7.node 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 Some(ref init1) = local2.init
if let ExprKind::Path(ref path8) = init1.node; if let ExprKind::Path(ref path8) = init1.node;
if match_qpath(path8, &["__next"]); if match_qpath(path8, &["__next"]);
@ -52,7 +52,7 @@ if_chain! {
if let StmtKind::Expr(ref e1, _) = local2.pat.node if let StmtKind::Expr(ref e1, _) = local2.pat.node
if let ExprKind::Block(ref block1) = e1.node; if let ExprKind::Block(ref block1) = e1.node;
if let StmtKind::Decl(ref decl3, _) = block1.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 Some(ref init2) = local3.init
if let ExprKind::Path(ref path9) = init2.node; if let ExprKind::Path(ref path9) = init2.node;
if match_qpath(path9, &["y"]); if match_qpath(path9, &["y"]);

View file

@ -1,6 +1,6 @@
if_chain! { if_chain! {
if let StmtKind::Decl(ref decl, _) = stmt.node 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 Some(ref init) = local.init
if let ExprKind::Match(ref expr, ref arms, MatchSource::Normal) = init.node; if let ExprKind::Match(ref expr, ref arms, MatchSource::Normal) = init.node;
if let ExprKind::Lit(ref lit) = expr.node; if let ExprKind::Lit(ref lit) = expr.node;
@ -14,7 +14,7 @@ if_chain! {
if let LitKind::Int(16, _) = lit2.node; if let LitKind::Int(16, _) = lit2.node;
if let ExprKind::Block(ref block) = arms[1].body.node; if let ExprKind::Block(ref block) = arms[1].body.node;
if let StmtKind::Decl(ref decl1, _) = block.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 Some(ref init1) = local1.init
if let ExprKind::Lit(ref lit3) = init1.node; if let ExprKind::Lit(ref lit3) = init1.node;
if let LitKind::Int(3, _) = lit3.node; if let LitKind::Int(3, _) = lit3.node;