diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2021-05-16 17:18:17 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2021-05-16 17:18:17 -0400 |
| commit | 8657bb251cc11d37cf5600350d1c2351728b4e4e (patch) | |
| tree | 8c9b32076bd450da7223a1ed5441d48cff925fff | |
| parent | d565c7488749fd0e998d6be21efeb20354e4696d (diff) | |
| download | rust-8657bb251cc11d37cf5600350d1c2351728b4e4e.tar.gz rust-8657bb251cc11d37cf5600350d1c2351728b4e4e.zip | |
Always produce sub-obligations when using cached projection result
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index b3e5df4da0a..388413ae06b 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -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) => { |
