diff options
| author | Rémy Rakic <remy.rakic+github@gmail.com> | 2024-06-25 19:55:06 +0000 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic+github@gmail.com> | 2024-06-25 21:05:54 +0000 |
| commit | 6402909f42566cfee84b8b66aec409adfcfc1e85 (patch) | |
| tree | fd832c6e2a7c25ed31b163d818b14991cb6de6e1 /compiler | |
| parent | d929a42a664c026167800801b26d734db925314f (diff) | |
| download | rust-6402909f42566cfee84b8b66aec409adfcfc1e85.tar.gz rust-6402909f42566cfee84b8b66aec409adfcfc1e85.zip | |
delay bug in RPITIT refinement checking with resolution errors
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs index 6cdbd692f73..ad3324f79e2 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs @@ -171,10 +171,10 @@ pub(super) fn check_refining_return_position_impl_trait_in_trait<'tcx>( } // Resolve any lifetime variables that may have been introduced during normalization. let Ok((trait_bounds, impl_bounds)) = infcx.fully_resolve((trait_bounds, impl_bounds)) else { - // This code path is not reached in any tests, but may be reachable. If - // this is triggered, it should be converted to `delayed_bug` and the - // triggering case turned into a test. - tcx.dcx().bug("encountered errors when checking RPITIT refinement (resolution)"); + // If resolution didn't fully complete, we cannot continue checking RPITIT refinement, and + // delay a bug as the original code contains load-bearing errors. + tcx.dcx().delayed_bug("encountered errors when checking RPITIT refinement (resolution)"); + return; }; // For quicker lookup, use an `IndexSet` (we don't use one earlier because |
