Navigation Menu

Skip to content

Commit

Permalink
Always produce sub-obligations when using cached projection result
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed May 16, 2021
1 parent d565c74 commit 8657bb2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions compiler/rustc_trait_selection/src/traits/project.rs
Expand Up @@ -529,15 +529,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
// evaluation this is not the case, and dropping the trait
// evaluations can causes ICEs (e.g., #43132).
debug!(?ty, "found normalized ty");

// 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);
}
obligations.extend(ty.obligations);
return Ok(Some(ty.value));
}
Err(ProjectionCacheEntry::Error) => {
Expand Down

0 comments on commit 8657bb2

Please sign in to comment.