]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/reachable.rs
rollup merge of #17355 : gamazeps/issue17210
[rust.git] / src / librustc / middle / reachable.rs
index d7cf25e7410e696edfd597cdb2057f468fed32a8..555a033a568d169999f68eb2532e22623fedb228 100644 (file)
@@ -197,11 +197,12 @@ fn def_id_represents_local_inlined_item(&self, def_id: ast::DefId) -> bool {
                 match *trait_method {
                     ast::RequiredMethod(_) => false,
                     ast::ProvidedMethod(_) => true,
+                    ast::TypeTraitItem(_) => false,
                 }
             }
             Some(ast_map::NodeImplItem(impl_item)) => {
                 match *impl_item {
-                    ast::MethodImplItem(method) => {
+                    ast::MethodImplItem(ref method) => {
                         if generics_require_inlining(method.pe_generics()) ||
                                 attributes_specify_inlining(
                                     method.attrs.as_slice()) {
@@ -225,6 +226,7 @@ fn def_id_represents_local_inlined_item(&self, def_id: ast::DefId) -> bool {
                             }
                         }
                     }
+                    ast::TypeImplItem(_) => false,
                 }
             }
             Some(_) => false,
@@ -327,18 +329,20 @@ fn propagate_node(&mut self, node: &ast_map::Node,
                         // Keep going, nothing to get exported
                     }
                     ast::ProvidedMethod(ref method) => {
-                        visit::walk_block(self, &*method.pe_body())
+                        visit::walk_block(self, &*method.pe_body());
                     }
+                    ast::TypeTraitItem(_) => {}
                 }
             }
             ast_map::NodeImplItem(impl_item) => {
                 match *impl_item {
-                    ast::MethodImplItem(method) => {
+                    ast::MethodImplItem(ref method) => {
                         let did = self.tcx.map.get_parent_did(search_item);
-                        if method_might_be_inlined(self.tcx, &*method, did) {
-                            visit::walk_block(self, &*method.pe_body())
+                        if method_might_be_inlined(self.tcx, &**method, did) {
+                            visit::walk_block(self, method.pe_body())
                         }
                     }
+                    ast::TypeImplItem(_) => {}
                 }
             }
             // Nothing to recurse on for these