Align Term methods with GenericArg methods
This commit is contained in:
parent
7c52d2db63
commit
273b990554
23 changed files with 46 additions and 36 deletions
|
@ -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(),
|
||||
)
|
||||
{
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue