From fa84018c2ef0aa35e46f11dce87f3e0410fae9a4 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 13 May 2024 14:34:47 -0400 Subject: Apply nits --- compiler/rustc_infer/src/traits/project.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_infer/src/traits/project.rs') diff --git a/compiler/rustc_infer/src/traits/project.rs b/compiler/rustc_infer/src/traits/project.rs index c1cfa5ca6b7..b696264aab0 100644 --- a/compiler/rustc_infer/src/traits/project.rs +++ b/compiler/rustc_infer/src/traits/project.rs @@ -93,7 +93,7 @@ pub enum ProjectionCacheEntry<'tcx> { Ambiguous, Recur, Error, - NormalizedTy { + NormalizedTerm { ty: NormalizedTerm<'tcx>, /// If we were able to successfully evaluate the /// corresponding cache entry key during predicate @@ -186,7 +186,7 @@ impl<'tcx> ProjectionCache<'_, 'tcx> { return; } let fresh_key = - map.insert(key, ProjectionCacheEntry::NormalizedTy { ty: value, complete: None }); + map.insert(key, ProjectionCacheEntry::NormalizedTerm { ty: value, complete: None }); assert!(!fresh_key, "never started projecting `{key:?}`"); } @@ -197,13 +197,16 @@ impl<'tcx> ProjectionCache<'_, 'tcx> { pub fn complete(&mut self, key: ProjectionCacheKey<'tcx>, result: EvaluationResult) { let mut map = self.map(); match map.get(&key) { - Some(ProjectionCacheEntry::NormalizedTy { ty, complete: _ }) => { + Some(ProjectionCacheEntry::NormalizedTerm { ty, complete: _ }) => { info!("ProjectionCacheEntry::complete({:?}) - completing {:?}", key, ty); let mut ty = ty.clone(); if result.must_apply_considering_regions() { ty.obligations = vec![]; } - map.insert(key, ProjectionCacheEntry::NormalizedTy { ty, complete: Some(result) }); + map.insert( + key, + ProjectionCacheEntry::NormalizedTerm { ty, complete: Some(result) }, + ); } ref value => { // Type inference could "strand behind" old cache entries. Leave @@ -215,7 +218,7 @@ impl<'tcx> ProjectionCache<'_, 'tcx> { pub fn is_complete(&mut self, key: ProjectionCacheKey<'tcx>) -> Option { self.map().get(&key).and_then(|res| match res { - ProjectionCacheEntry::NormalizedTy { ty: _, complete } => *complete, + ProjectionCacheEntry::NormalizedTerm { ty: _, complete } => *complete, _ => None, }) } -- cgit 1.4.1-3-g733a5