From 6a3dfa4dba2d341b9d93481c3ccf8338248b5d20 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 3 Aug 2018 00:43:49 +0300 Subject: [PATCH] privacy: Fix an ICE in `path_is_private_type` Fixes https://github.com/rust-lang/rust/issues/52879 (Untested.) --- src/librustc_privacy/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index f32f6eda8ff..e07a0579f41 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -1005,7 +1005,7 @@ struct ObsoleteCheckTypeForPrivatenessVisitor<'a, 'b: 'a, 'tcx: 'b> { impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> { fn path_is_private_type(&self, path: &hir::Path) -> bool { let did = match path.def { - Def::PrimTy(..) | Def::SelfTy(..) => return false, + Def::PrimTy(..) | Def::SelfTy(..) | Def::Err => return false, def => def.def_id(), };