]> git.lizzy.rs Git - rust.git/commitdiff
review comment
authorEsteban Küber <esteban@kuber.com.ar>
Thu, 21 Jun 2018 22:52:48 +0000 (15:52 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Thu, 21 Jun 2018 22:52:48 +0000 (15:52 -0700)
src/librustc_typeck/check/method/suggest.rs

index 92a96a997bbae1565f2401eef4a878855c60286b..546ce34fe12ae864a7e8300565513e796ab8f323 100644 (file)
@@ -265,10 +265,6 @@ pub fn report_method_error(&self,
                                         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 @@ pub fn report_method_error(&self,
                                             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,
                                                 ..