]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_passes/src/reachable.rs
Auto merge of #85178 - cjgillot:local-crate, r=oli-obk
[rust.git] / compiler / rustc_passes / src / reachable.rs
index af1a81c4ddef05f7c47e98d3a7c94541a879567b..0b3227abb5f8b4892d213f0b02ecf8b5d5624669 100644 (file)
@@ -249,7 +249,7 @@ fn propagate_node(&mut self, node: &Node<'tcx>, search_item: LocalDefId) {
                     // Reachable constants will be inlined into other crates
                     // unconditionally, so we need to make sure that their
                     // contents are also reachable.
-                    hir::ItemKind::Const(_, init) => {
+                    hir::ItemKind::Const(_, init) | hir::ItemKind::Static(_, _, init) => {
                         self.visit_nested_body(init);
                     }
 
@@ -260,7 +260,6 @@ fn propagate_node(&mut self, node: &Node<'tcx>, search_item: LocalDefId) {
                     | hir::ItemKind::Use(..)
                     | hir::ItemKind::OpaqueTy(..)
                     | hir::ItemKind::TyAlias(..)
-                    | hir::ItemKind::Static(..)
                     | hir::ItemKind::Mod(..)
                     | hir::ItemKind::ForeignMod { .. }
                     | hir::ItemKind::Impl { .. }