Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e34c743

Browse files
committedJan 30, 2025
Do not elaborate implicit supertrait associated type bounds into dyn trait's existential predicates
1 parent a6434ef commit e34c743

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+620
-145
lines changed
 

‎compiler/rustc_middle/src/ty/sty.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,10 @@ impl<'tcx> rustc_type_ir::inherent::Ty<TyCtxt<'tcx>> for Ty<'tcx> {
10251025
fn has_unsafe_fields(self) -> bool {
10261026
Ty::has_unsafe_fields(self)
10271027
}
1028+
1029+
fn is_self_param(self) -> bool {
1030+
self.is_param(0)
1031+
}
10281032
}
10291033

10301034
/// Type utilities

‎compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,15 @@ where
725725
assumption.upcast(cx),
726726
));
727727
}
728+
729+
for assumption in elaborate::implied_supertrait_projections(cx, principal) {
730+
candidates.extend(G::probe_and_consider_object_bound_candidate(
731+
self,
732+
CandidateSource::BuiltinImpl(BuiltinImplSource::Misc),
733+
goal,
734+
assumption.with_self_ty(cx, self_ty).upcast(cx),
735+
));
736+
}
728737
}
729738
}
730739

There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.