Rollup merge of #140021 - compiler-errors:no-deep-norm-ice, r=lcnr
Don't ICE on pending obligations from deep normalization in a loop See the comment I left inline in `compiler/rustc_trait_selection/src/traits/normalize.rs`. Fixes https://github.com/rust-lang/rust/issues/133868 r? lcnr
This commit is contained in:
commit
f79eef91df
4 changed files with 163 additions and 14 deletions
|
@ -77,7 +77,15 @@ impl<'tcx> At<'_, 'tcx> {
|
|||
.into_value_registering_obligations(self.infcx, &mut *fulfill_cx);
|
||||
let errors = fulfill_cx.select_all_or_error(self.infcx);
|
||||
let value = self.infcx.resolve_vars_if_possible(value);
|
||||
if errors.is_empty() { Ok(value) } else { Err(errors) }
|
||||
if errors.is_empty() {
|
||||
Ok(value)
|
||||
} else {
|
||||
// Drop pending obligations, since deep normalization may happen
|
||||
// in a loop and we don't want to trigger the assertion on the next
|
||||
// iteration due to pending ambiguous obligations we've left over.
|
||||
let _ = fulfill_cx.collect_remaining_errors(self.infcx);
|
||||
Err(errors)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue