Skip to content

Commit 3733844

Browse files
committed
Rename relationships to infer_var_info
1 parent dc90fb3 commit 3733844

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

compiler/rustc_hir_typeck/src/fallback.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,16 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
293293
.depth_first_search(root_vid)
294294
.any(|n| roots_reachable_from_non_diverging.visited(n));
295295

296-
let mut relationship = ty::FoundRelationships { self_in_trait: false, output: false };
296+
let mut found_infer_var_info = ty::InferVarInfo { self_in_trait: false, output: false };
297297

298-
for (vid, rel) in self.inh.relationships.borrow().iter() {
298+
for (vid, info) in self.inh.infer_var_info.borrow().iter() {
299299
if self.infcx.root_var(*vid) == root_vid {
300-
relationship.self_in_trait |= rel.self_in_trait;
301-
relationship.output |= rel.output;
300+
found_infer_var_info.self_in_trait |= info.self_in_trait;
301+
found_infer_var_info.output |= info.output;
302302
}
303303
}
304304

305-
if relationship.self_in_trait && relationship.output {
305+
if found_infer_var_info.self_in_trait && found_infer_var_info.output {
306306
// This case falls back to () to ensure that the code pattern in
307307
// tests/ui/never_type/fallback-closure-ret.rs continues to
308308
// compile when never_type_fallback is enabled.

compiler/rustc_hir_typeck/src/inherited.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub struct Inherited<'tcx> {
6565
/// fallback. See the `fallback` module for details.
6666
pub(super) diverging_type_vars: RefCell<FxHashSet<Ty<'tcx>>>,
6767

68-
pub(super) relationships: RefCell<FxHashMap<ty::TyVid, ty::FoundRelationships>>,
68+
pub(super) infer_var_info: RefCell<FxHashMap<ty::TyVid, ty::InferVarInfo>>,
6969
}
7070

7171
impl<'tcx> Deref for Inherited<'tcx> {
@@ -131,7 +131,7 @@ impl<'tcx> Inherited<'tcx> {
131131
deferred_generator_interiors: RefCell::new(Vec::new()),
132132
diverging_type_vars: RefCell::new(Default::default()),
133133
body_id,
134-
relationships: RefCell::new(Default::default()),
134+
infer_var_info: RefCell::new(Default::default()),
135135
}
136136
}
137137

@@ -161,7 +161,7 @@ impl<'tcx> Inherited<'tcx> {
161161
}
162162

163163
pub fn update_infer_var_info(&self, obligation: &PredicateObligation<'tcx>) {
164-
let relationships = &mut self.relationships.borrow_mut();
164+
let infer_var_info = &mut self.infer_var_info.borrow_mut();
165165

166166
// (*) binder skipped
167167
if let ty::PredicateKind::Clause(ty::Clause::Trait(tpred)) = obligation.predicate.kind().skip_binder()
@@ -183,7 +183,7 @@ impl<'tcx> Inherited<'tcx> {
183183
);
184184
// Don't report overflow errors. Otherwise equivalent to may_hold.
185185
if let Ok(result) = self.probe(|_| self.evaluate_obligation(&o)) && result.may_apply() {
186-
relationships.entry(ty).or_default().self_in_trait = true;
186+
infer_var_info.entry(ty).or_default().self_in_trait = true;
187187
}
188188
}
189189

@@ -193,8 +193,8 @@ impl<'tcx> Inherited<'tcx> {
193193
// If the projection predicate (Foo::Bar == X) has X as a non-TyVid,
194194
// we need to make it into one.
195195
if let Some(vid) = predicate.term.ty().and_then(|ty| ty.ty_vid()) {
196-
debug!("relationships: {:?}.output = true", vid);
197-
relationships.entry(vid).or_default().output = true;
196+
debug!("infer_var_info: {:?}.output = true", vid);
197+
infer_var_info.entry(vid).or_default().output = true;
198198
}
199199
}
200200
}

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2614,7 +2614,7 @@ impl<'tcx> fmt::Debug for SymbolName<'tcx> {
26142614
}
26152615

26162616
#[derive(Debug, Default, Copy, Clone)]
2617-
pub struct FoundRelationships {
2617+
pub struct InferVarInfo {
26182618
/// This is true if we identified that this Ty (`?T`) is found in a `?T: Foo`
26192619
/// obligation, where:
26202620
///

0 commit comments

Comments
 (0)