Rollup merge of #112981 - spastorino:new-rpitit-22, r=compiler-errors
Fix return type notation errors with -Zlower-impl-trait-in-trait-to-assoc-ty This just adjust the way we check for RPITITs and uses the new helper method to do the "old" and "new" check at once. r? `@compiler-errors`
This commit is contained in:
commit
4a175523b1
27 changed files with 287 additions and 25 deletions
|
@ -412,7 +412,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
|
|||
// an RPITIT (return-position impl trait in trait) or AFIT (async fn in trait).
|
||||
let output = tcx.fn_sig(assoc_item.def_id).skip_binder().output();
|
||||
let output = if let ty::Alias(ty::Projection, alias_ty) = *output.skip_binder().kind()
|
||||
&& tcx.def_kind(alias_ty.def_id) == DefKind::ImplTraitPlaceholder
|
||||
&& tcx.is_impl_trait_in_trait(alias_ty.def_id)
|
||||
{
|
||||
alias_ty
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue