Always produce sub-obligations when using cached projection result
This commit is contained in:
parent
d565c74887
commit
8657bb251c
@ -529,15 +529,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
|
|||||||
// evaluation this is not the case, and dropping the trait
|
// evaluation this is not the case, and dropping the trait
|
||||||
// evaluations can causes ICEs (e.g., #43132).
|
// evaluations can causes ICEs (e.g., #43132).
|
||||||
debug!(?ty, "found normalized ty");
|
debug!(?ty, "found normalized ty");
|
||||||
|
obligations.extend(ty.obligations);
|
||||||
// Once we have inferred everything we need to know, we
|
|
||||||
// can ignore the `obligations` from that point on.
|
|
||||||
if infcx.unresolved_type_vars(&ty.value).is_none() {
|
|
||||||
infcx.inner.borrow_mut().projection_cache().complete_normalized(cache_key, &ty);
|
|
||||||
// No need to extend `obligations`.
|
|
||||||
} else {
|
|
||||||
obligations.extend(ty.obligations);
|
|
||||||
}
|
|
||||||
return Ok(Some(ty.value));
|
return Ok(Some(ty.value));
|
||||||
}
|
}
|
||||||
Err(ProjectionCacheEntry::Error) => {
|
Err(ProjectionCacheEntry::Error) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user