From f82705403f133bbff8d8ab72f34a3a3e522c7c98 Mon Sep 17 00:00:00 2001 From: GAJaloyan Date: Thu, 30 Mar 2017 16:31:16 +0200 Subject: [PATCH 1/2] adding debug in consume_body function When in debug_assertions=true mode, the function consume_body lacks some debug output, which makes it harder to follow the control flow. This commit adds this needed debug. --- src/librustc/middle/expr_use_visitor.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index a44679b0b3e..57b96dba753 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -288,6 +288,8 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> { } pub fn consume_body(&mut self, body: &hir::Body) { + debug!("consume_body(body={:?})", body); + for arg in &body.arguments { let arg_ty = return_if_err!(self.mc.infcx.node_ty(arg.pat.id)); From ea281962149cd188edf384cb120852369b669c50 Mon Sep 17 00:00:00 2001 From: GAJaloyan Date: Thu, 30 Mar 2017 17:02:51 +0200 Subject: [PATCH 2/2] removing trailing whitespaces --- src/librustc/middle/expr_use_visitor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 57b96dba753..dc40d0bc649 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -289,7 +289,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> { pub fn consume_body(&mut self, body: &hir::Body) { debug!("consume_body(body={:?})", body); - + for arg in &body.arguments { let arg_ty = return_if_err!(self.mc.infcx.node_ty(arg.pat.id));