Migrate item_bounds to ty::Clause

This commit is contained in:
Michael Goulet
2023-06-19 20:46:46 +00:00
parent 2efe091705
commit 46a650f4e0
37 changed files with 232 additions and 152 deletions

View File

@@ -409,9 +409,7 @@ fn fn_sig_suggestion<'tcx>(
output = if let ty::Alias(_, alias_ty) = *output.kind() {
tcx.explicit_item_bounds(alias_ty.def_id)
.subst_iter_copied(tcx, alias_ty.substs)
.find_map(|(bound, _)| {
bound.to_opt_poly_projection_pred()?.no_bound_vars()?.term.ty()
})
.find_map(|(bound, _)| bound.as_projection_clause()?.no_bound_vars()?.term.ty())
.unwrap_or_else(|| {
span_bug!(
ident.span,

View File

@@ -1086,7 +1086,7 @@ fn check_associated_type_bounds(wfcx: &WfCheckingCtxt<'_, '_>, item: ty::AssocIt
wfcx.infcx,
wfcx.param_env,
wfcx.body_def_id,
normalized_bound,
normalized_bound.as_predicate(),
bound_span,
)
});
@@ -1562,7 +1562,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
self.wfcx.infcx,
self.wfcx.param_env,
self.wfcx.body_def_id,
bound,
bound.as_predicate(),
bound_span,
));
// Set the debruijn index back to innermost here, since we already eagerly