1
Fork 0

change usages of type_of to bound_type_of

This commit is contained in:
Kyle Matsuda 2023-02-06 17:48:12 -07:00
parent 9a7cc6c32f
commit d822b97a27
136 changed files with 385 additions and 262 deletions

View file

@ -2592,7 +2592,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
if is_closure {
None
} else {
let ty = self.infcx.tcx.type_of(self.mir_def_id());
let ty = self.infcx.tcx.bound_type_of(self.mir_def_id()).subst_identity();
match ty.kind() {
ty::FnDef(_, _) | ty::FnPtr(_) => self.annotate_fn_sig(
self.mir_def_id(),

View file

@ -1185,7 +1185,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
let parent_self_ty =
matches!(tcx.def_kind(parent_did), rustc_hir::def::DefKind::Impl { .. })
.then_some(parent_did)
.and_then(|did| match tcx.type_of(did).kind() {
.and_then(|did| match tcx.bound_type_of(did).subst_identity().kind() {
ty::Adt(def, ..) => Some(def.did()),
_ => None,
});

View file

@ -575,7 +575,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
let mut output_ty = self.regioncx.universal_regions().unnormalized_output_ty;
if let ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) = *output_ty.kind() {
output_ty = self.infcx.tcx.type_of(def_id)
output_ty = self.infcx.tcx.bound_type_of(def_id).subst_identity()
};
debug!("report_fnmut_error: output_ty={:?}", output_ty);
@ -896,7 +896,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
debug!(?fn_did, ?substs);
// Only suggest this on function calls, not closures
let ty = tcx.type_of(fn_did);
let ty = tcx.bound_type_of(fn_did).subst_identity();
debug!("ty: {:?}, ty.kind: {:?}", ty, ty.kind());
if let ty::Closure(_, _) = ty.kind() {
return;

View file

@ -850,7 +850,9 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
};
let found = tcx
.any_free_region_meets(&tcx.type_of(region_parent), |r| *r == ty::ReEarlyBound(region));
.any_free_region_meets(&tcx.bound_type_of(region_parent).subst_identity(), |r| {
*r == ty::ReEarlyBound(region)
});
Some(RegionName {
name: self.synthesize_region_name(),