Skip to content

Commit b147919

Browse files
committed
Collect DefKind::AssocTy in new RPITITs on ImplTraitInTraitCollector
1 parent 64872a8 commit b147919

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,14 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
831831

832832
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
833833
if let ty::Alias(ty::Projection, proj) = ty.kind()
834-
&& self.interner().def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder
834+
&& (self.interner().def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder
835+
|| self
836+
.interner()
837+
.sess
838+
.opts
839+
.unstable_opts
840+
.lower_impl_trait_in_trait_to_assoc_ty
841+
&& self.interner().def_kind(proj.def_id) == DefKind::AssocTy)
835842
{
836843
if let Some((ty, _)) = self.types.get(&proj.def_id) {
837844
return *ty;

0 commit comments

Comments
 (0)