privacy: update visit_infer

This commit is contained in:
lcnr 2022-01-10 10:59:26 +01:00
parent b2d8f0c77d
commit cbc6d35a57

View File

@ -1148,19 +1148,11 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
if self.visit(ty).is_break() {
return;
}
} else {
// We don't do anything for const infers here.
}
} else {
let local_id = self.tcx.hir().local_def_id(inf.hir_id);
if let Some(did) = self.tcx.opt_const_param_of(local_id) {
if self.visit_def_id(did, "inferred", &"").is_break() {
return;
}
}
// FIXME see above note for same issue.
if self.visit(rustc_typeck::hir_ty_to_ty(self.tcx, &inf.to_ty())).is_break() {
return;
}
bug!("visit_infer without typeck_results");
}
intravisit::walk_inf(self, inf);
}