privacy: Fix an ICE in path_is_private_type

Fixes https://github.com/rust-lang/rust/issues/52879

(Untested.)
This commit is contained in:
Vadim Petrochenkov 2018-08-03 00:43:49 +03:00 committed by GitHub
parent 6eafab06cf
commit 6a3dfa4dba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(),
};