Auto merge of #99796 - compiler-errors:issue-53475, r=oli-obk

use `check_region_obligations_and_report_errors` to avoid ICEs

If we don't call `process_registered_region_obligations` before `resolve_regions_and_report_errors` then we'll ICE if we have any region obligations, and `check_region_obligations_and_report_errors` just does both of these for us in a nice convenient function.

Fixes #53475

r? types
This commit is contained in:
bors 2022-07-30 09:35:22 +00:00
commit 110777b60c
8 changed files with 45 additions and 13 deletions

View file

@ -398,13 +398,7 @@ fn resolve_negative_obligation<'cx, 'tcx>(
let outlives_env = OutlivesEnvironment::new(param_env);
infcx.process_registered_region_obligations(outlives_env.region_bound_pairs(), param_env);
let errors = infcx.resolve_regions(&outlives_env);
if !errors.is_empty() {
return false;
}
true
infcx.resolve_regions(&outlives_env).is_empty()
}
pub fn trait_ref_is_knowable<'tcx>(