X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_ast_lowering%2Fitem.rs;h=e0db8606bc203148b37dcaa5d5814e729cfaf34e;hb=35884fe16889b39d4be43cf8effc3bdf843c6f12;hp=b465fd79c8f20dc500dea03ef7f51e75e1b61fcb;hpb=f8d2264463162291f5cb3391c98d7bc95ec17d87;p=rust.git diff --git a/src/librustc_ast_lowering/item.rs b/src/librustc_ast_lowering/item.rs index b465fd79c8f..e0db8606bc2 100644 --- a/src/librustc_ast_lowering/item.rs +++ b/src/librustc_ast_lowering/item.rs @@ -683,6 +683,11 @@ fn lower_foreign_item(&mut self, i: &ForeignItem) -> hir::ForeignItem<'hir> { let ty = self.lower_ty(t, ImplTraitContext::disallowed()); hir::ForeignItemKind::Static(ty, m) } + ForeignItemKind::Const(ref t, _) => { + // For recovery purposes. + let ty = self.lower_ty(t, ImplTraitContext::disallowed()); + hir::ForeignItemKind::Static(ty, Mutability::Not) + } ForeignItemKind::TyAlias(..) => hir::ForeignItemKind::Type, ForeignItemKind::Macro(_) => panic!("macro shouldn't exist here"), },