1
Fork 0

Rollup merge of #111861 - compiler-errors:rtn-in-super, r=jackh726

Don't ICE on return-type notation when promoting trait preds to associated type bounds

Fixes #111846
This commit is contained in:
Matthias Krüger 2023-05-24 06:05:37 +02:00 committed by GitHub
commit 224b6511b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View file

@ -427,6 +427,8 @@ pub(super) fn explicit_predicates_of<'tcx>(
// supertrait).
if let ty::Alias(ty::Projection, projection) = ty.kind() {
projection.substs == trait_identity_substs
// FIXME(return_type_notation): This check should be more robust
&& !tcx.is_impl_trait_in_trait(projection.def_id)
&& tcx.associated_item(projection.def_id).container_id(tcx)
== def_id.to_def_id()
} else {