1
Fork 0

Align Term methods with GenericArg methods

This commit is contained in:
Michael Goulet 2024-05-29 22:23:49 -04:00
parent 7c52d2db63
commit 273b990554
23 changed files with 46 additions and 36 deletions

View file

@ -2281,7 +2281,7 @@ fn try_report_async_mismatch<'tcx>(
&& let Some(proj) = proj.no_bound_vars()
&& infcx.can_eq(
error.root_obligation.param_env,
proj.term.ty().unwrap(),
proj.term.expect_type(),
impl_sig.output(),
)
{

View file

@ -267,7 +267,7 @@ fn report_mismatched_rpitit_signature<'tcx>(
.explicit_item_bounds(future_ty.def_id)
.iter_instantiated_copied(tcx, future_ty.args)
.find_map(|(clause, _)| match clause.kind().no_bound_vars()? {
ty::ClauseKind::Projection(proj) => proj.term.ty(),
ty::ClauseKind::Projection(proj) => proj.term.as_type(),
_ => None,
})
else {

View file

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