Rollup merge of #122172 - compiler-errors:rpitit-collect-ice, r=fmease
Don't ICE if we collect no RPITITs unless there are no unification errors Move an assertion in `collect_return_position_impl_trait_in_trait_tys` to after the `ObligationCtxt::eq` calls, so that we only assert and ICE if we have unification errors. Fixes #121468
This commit is contained in:
commit
02b89d1676
3 changed files with 92 additions and 8 deletions
|
@ -521,14 +521,6 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
|
|||
)
|
||||
.fold_with(&mut collector);
|
||||
|
||||
if !unnormalized_trait_sig.output().references_error() {
|
||||
debug_assert_ne!(
|
||||
collector.types.len(),
|
||||
0,
|
||||
"expect >1 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`"
|
||||
);
|
||||
}
|
||||
|
||||
let trait_sig = ocx.normalize(&misc_cause, param_env, unnormalized_trait_sig);
|
||||
trait_sig.error_reported()?;
|
||||
let trait_return_ty = trait_sig.output();
|
||||
|
@ -647,6 +639,13 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
|
|||
}
|
||||
}
|
||||
|
||||
if !unnormalized_trait_sig.output().references_error() {
|
||||
debug_assert!(
|
||||
!collector.types.is_empty(),
|
||||
"expect >0 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`"
|
||||
);
|
||||
}
|
||||
|
||||
// FIXME: This has the same issue as #108544, but since this isn't breaking
|
||||
// existing code, I'm not particularly inclined to do the same hack as above
|
||||
// where we process wf obligations manually. This can be fixed in a forward-
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue