about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2023-01-20 16:45:01 -0300
committerSantiago Pastorino <spastorino@gmail.com>2023-01-22 11:02:28 -0300
commit6155a803805acaddd2518f09c2da70fbc320b274 (patch)
treed55a55f429b1e5a8fafab5b5e42c0ab8d9e83ddc
parentfb0a4e958950ed4dabc954c8a258594847b1d9bc (diff)
Rename relationships to infer_var_info
-rw-r--r--compiler/rustc_hir_typeck/src/fallback.rs10
-rw-r--r--compiler/rustc_hir_typeck/src/inherited.rs12
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs2
3 files changed, 12 insertions, 12 deletions
diff --git a/compiler/rustc_hir_typeck/src/fallback.rs b/compiler/rustc_hir_typeck/src/fallback.rs
index 4ef32023e7d..943dc9b9646 100644
--- a/compiler/rustc_hir_typeck/src/fallback.rs
+++ b/compiler/rustc_hir_typeck/src/fallback.rs
@@ -293,16 +293,16 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
                 .depth_first_search(root_vid)
                 .any(|n| roots_reachable_from_non_diverging.visited(n));
 
-            let mut relationship = ty::FoundRelationships { self_in_trait: false, output: false };
+            let mut found_infer_var_info = ty::InferVarInfo { self_in_trait: false, output: false };
 
-            for (vid, rel) in self.inh.relationships.borrow().iter() {
+            for (vid, info) in self.inh.infer_var_info.borrow().iter() {
                 if self.infcx.root_var(*vid) == root_vid {
-                    relationship.self_in_trait |= rel.self_in_trait;
-                    relationship.output |= rel.output;
+                    found_infer_var_info.self_in_trait |= info.self_in_trait;
+                    found_infer_var_info.output |= info.output;
                 }
             }
 
-            if relationship.self_in_trait && relationship.output {
+            if found_infer_var_info.self_in_trait && found_infer_var_info.output {
                 // This case falls back to () to ensure that the code pattern in
                 // tests/ui/never_type/fallback-closure-ret.rs continues to
                 // compile when never_type_fallback is enabled.
diff --git a/compiler/rustc_hir_typeck/src/inherited.rs b/compiler/rustc_hir_typeck/src/inherited.rs
index ce7e5caaefc..ba34f299453 100644
--- a/compiler/rustc_hir_typeck/src/inherited.rs
+++ b/compiler/rustc_hir_typeck/src/inherited.rs
@@ -65,7 +65,7 @@ pub struct Inherited<'tcx> {
     /// fallback. See the `fallback` module for details.
     pub(super) diverging_type_vars: RefCell<FxHashSet<Ty<'tcx>>>,
 
-    pub(super) relationships: RefCell<FxHashMap<ty::TyVid, ty::FoundRelationships>>,
+    pub(super) infer_var_info: RefCell<FxHashMap<ty::TyVid, ty::InferVarInfo>>,
 }
 
 impl<'tcx> Deref for Inherited<'tcx> {
@@ -131,7 +131,7 @@ impl<'tcx> Inherited<'tcx> {
             deferred_generator_interiors: RefCell::new(Vec::new()),
             diverging_type_vars: RefCell::new(Default::default()),
             body_id,
-            relationships: RefCell::new(Default::default()),
+            infer_var_info: RefCell::new(Default::default()),
         }
     }
 
@@ -161,7 +161,7 @@ impl<'tcx> Inherited<'tcx> {
     }
 
     pub fn update_infer_var_info(&self, obligation: &PredicateObligation<'tcx>) {
-        let relationships = &mut self.relationships.borrow_mut();
+        let infer_var_info = &mut self.infer_var_info.borrow_mut();
 
         // (*) binder skipped
         if let ty::PredicateKind::Clause(ty::Clause::Trait(tpred)) = obligation.predicate.kind().skip_binder()
@@ -183,7 +183,7 @@ impl<'tcx> Inherited<'tcx> {
             );
             // Don't report overflow errors. Otherwise equivalent to may_hold.
             if let Ok(result) = self.probe(|_| self.evaluate_obligation(&o)) && result.may_apply() {
-                relationships.entry(ty).or_default().self_in_trait = true;
+                infer_var_info.entry(ty).or_default().self_in_trait = true;
             }
         }
 
@@ -193,8 +193,8 @@ impl<'tcx> Inherited<'tcx> {
             // If the projection predicate (Foo::Bar == X) has X as a non-TyVid,
             // we need to make it into one.
             if let Some(vid) = predicate.term.ty().and_then(|ty| ty.ty_vid()) {
-                debug!("relationships: {:?}.output = true", vid);
-                relationships.entry(vid).or_default().output = true;
+                debug!("infer_var_info: {:?}.output = true", vid);
+                infer_var_info.entry(vid).or_default().output = true;
             }
         }
     }
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 7dfcd1bb507..f83bceca3b5 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -2619,7 +2619,7 @@ impl<'tcx> fmt::Debug for SymbolName<'tcx> {
 }
 
 #[derive(Debug, Default, Copy, Clone)]
-pub struct FoundRelationships {
+pub struct InferVarInfo {
     /// This is true if we identified that this Ty (`?T`) is found in a `?T: Foo`
     /// obligation, where:
     ///