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

@ -2200,7 +2200,8 @@ fn confirm_impl_trait_in_trait_candidate<'tcx>(
Err(guar) => return Progress::error(tcx, guar),
};
// We don't support specialization for RPITITs anyways... yet.
if !leaf_def.is_final() {
// Also don't try to project to an RPITIT that has no value
if !leaf_def.is_final() || !leaf_def.item.defaultness(tcx).has_value() {
return Progress { term: tcx.ty_error_misc().into(), obligations };
}