From cc0ab820912f24770f13985a6bc6474e547acf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 21 Jun 2018 15:52:48 -0700 Subject: [PATCH] review comment --- src/librustc_typeck/check/method/suggest.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 92a96a997bbae..546ce34fe12ae 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -265,10 +265,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let snippet = tcx.sess.codemap().span_to_snippet(span) .unwrap(); let filename = tcx.sess.codemap().span_to_filename(span); - let is_real_filename = match filename { - FileName::Real(_) => true, - _ => false, - }; let parent_node = self.tcx.hir.get( self.tcx.hir.get_parent_node(node_id), @@ -278,8 +274,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { concrete_type, ); - match (is_real_filename, parent_node) { - (true, hir_map::NodeLocal(hir::Local { + match (filename, parent_node) { + (FileName::Real(_), hir_map::NodeLocal(hir::Local { source: hir::LocalSource::Normal, ty, ..