1
Fork 0

Don't project to RPITIT that has no default value

This commit is contained in:
Michael Goulet 2023-03-04 18:36:02 +00:00
parent 276b75a843
commit 7634c5916a
4 changed files with 41 additions and 3 deletions

View file

@ -344,8 +344,8 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::EarlyBinder<Ty<'_>>
in_trait,
..
}) => {
if in_trait {
assert!(tcx.impl_defaultness(owner).has_value());
if in_trait && !tcx.impl_defaultness(owner).has_value() {
span_bug!(tcx.def_span(def_id), "tried to get type of this RPITIT with no definition");
}
find_opaque_ty_constraints_for_rpit(tcx, def_id, owner)
}