Rollup merge of #53001 - petrochenkov:master, r=estebank

privacy: Fix an ICE in `path_is_private_type`

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

(Untested.)
This commit is contained in:
kennytm 2018-08-04 14:35:55 +08:00 committed by GitHub
commit d028b3ea33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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