about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/traits/project.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-05-13 14:34:47 -0400
committerMichael Goulet <michael@errs.io>2024-05-13 16:55:58 -0400
commitfa84018c2ef0aa35e46f11dce87f3e0410fae9a4 (patch)
tree82805a73ac639eb16f335902db412ce92d041dac /compiler/rustc_infer/src/traits/project.rs
parent3bcdf3058ef3eaef5042661cf8301acfbcddce65 (diff)
downloadrust-fa84018c2ef0aa35e46f11dce87f3e0410fae9a4.tar.gz
rust-fa84018c2ef0aa35e46f11dce87f3e0410fae9a4.zip
Apply nits
Diffstat (limited to 'compiler/rustc_infer/src/traits/project.rs')
-rw-r--r--compiler/rustc_infer/src/traits/project.rs13
1 files changed, 8 insertions, 5 deletions
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<EvaluationResult> {
         self.map().get(&key).and_then(|res| match res {
-            ProjectionCacheEntry::NormalizedTy { ty: _, complete } => *complete,
+            ProjectionCacheEntry::NormalizedTerm { ty: _, complete } => *complete,
             _ => None,
         })
     }