1
Fork 0

Make evaluate_obligation not succeed unconditionally if it registered new hidden types for opaque types

This commit is contained in:
Oli Scherer 2022-06-30 14:23:31 +00:00
parent ade2a96ff1
commit 84fc551664
8 changed files with 31 additions and 11 deletions

View file

@ -394,6 +394,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
Err(_) => return Ok(EvaluatedToErr),
}
if self.infcx.opaque_types_added_in_snapshot(snapshot) {
return Ok(result.max(EvaluatedToOkModuloOpaqueTypes));
}
match self.infcx.region_constraints_added_in_snapshot(snapshot) {
None => Ok(result),
Some(_) => Ok(result.max(EvaluatedToOkModuloRegions)),