1
Fork 0

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:
Michael Goulet 2023-06-23 19:47:21 -07:00 committed by GitHub
commit 4a175523b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 287 additions and 25 deletions

View file

@ -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 {