1
Fork 0

Rollup merge of #122915 - fmease:lt-opaq-mismatch-delay-bug, r=compiler-errors

Delay a bug if no RPITITs were found

Fixes #122655. See the issue for context.

r? compiler-errors or compiler
This commit is contained in:
Matthias Krüger 2024-03-23 15:00:18 +01:00 committed by GitHub
commit f03326c579
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 74 additions and 21 deletions

View file

@ -639,10 +639,9 @@ 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`"
if !unnormalized_trait_sig.output().references_error() && collector.types.is_empty() {
tcx.dcx().delayed_bug(
"expect >0 RPITITs in call to `collect_return_position_impl_trait_in_trait_tys`",
);
}