Skip to content

Commit a5c68d7

Browse files
committed
remove unused field from infcx
1 parent e730969 commit a5c68d7

File tree

4 files changed

+3
-34
lines changed

4 files changed

+3
-34
lines changed

compiler/rustc_infer/src/infer/at.rs

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
6565
Self {
6666
tcx: self.tcx.clone(),
6767
defining_use_anchor: self.defining_use_anchor.clone(),
68-
reveal_defining_opaque_types: self.reveal_defining_opaque_types.clone(),
6968
in_progress_typeck_results: self.in_progress_typeck_results.clone(),
7069
inner: self.inner.clone(),
7170
skip_leak_check: self.skip_leak_check.clone(),

compiler/rustc_infer/src/infer/mod.rs

+2-25
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,6 @@ pub struct InferCtxt<'a, 'tcx> {
290290
/// to the outside until the end up in an `InferCtxt` for typeck or borrowck.
291291
pub defining_use_anchor: Option<LocalDefId>,
292292

293-
/// Used by WF-checking to not have to figure out hidden types itself, but
294-
/// to just invoke type_of to get the already computed hidden type from typeck.
295-
pub reveal_defining_opaque_types: bool,
296-
297293
/// During type-checking/inference of a body, `in_progress_typeck_results`
298294
/// contains a reference to the typeck results being built up, which are
299295
/// used for reading closure kinds/signatures as they are inferred,
@@ -569,7 +565,6 @@ pub struct InferCtxtBuilder<'tcx> {
569565
tcx: TyCtxt<'tcx>,
570566
fresh_typeck_results: Option<RefCell<ty::TypeckResults<'tcx>>>,
571567
defining_use_anchor: Option<LocalDefId>,
572-
reveal_defining_opaque_types: bool,
573568
}
574569

575570
pub trait TyCtxtInferExt<'tcx> {
@@ -578,12 +573,7 @@ pub trait TyCtxtInferExt<'tcx> {
578573

579574
impl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx> {
580575
fn infer_ctxt(self) -> InferCtxtBuilder<'tcx> {
581-
InferCtxtBuilder {
582-
tcx: self,
583-
defining_use_anchor: None,
584-
fresh_typeck_results: None,
585-
reveal_defining_opaque_types: false,
586-
}
576+
InferCtxtBuilder { tcx: self, defining_use_anchor: None, fresh_typeck_results: None }
587577
}
588578
}
589579

@@ -607,13 +597,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
607597
self
608598
}
609599

610-
/// WF-checking doesn't need to recompute opaque types and can instead use
611-
/// the type_of query to get them from typeck.
612-
pub fn reveal_defining_opaque_types(mut self) -> Self {
613-
self.reveal_defining_opaque_types = true;
614-
self
615-
}
616-
617600
/// Given a canonical value `C` as a starting point, create an
618601
/// inference context that contains each of the bound values
619602
/// within instantiated as a fresh variable. The `f` closure is
@@ -638,17 +621,11 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
638621
}
639622

640623
pub fn enter<R>(&mut self, f: impl for<'a> FnOnce(InferCtxt<'a, 'tcx>) -> R) -> R {
641-
let InferCtxtBuilder {
642-
tcx,
643-
defining_use_anchor,
644-
reveal_defining_opaque_types,
645-
ref fresh_typeck_results,
646-
} = *self;
624+
let InferCtxtBuilder { tcx, defining_use_anchor, ref fresh_typeck_results } = *self;
647625
let in_progress_typeck_results = fresh_typeck_results.as_ref();
648626
f(InferCtxt {
649627
tcx,
650628
defining_use_anchor,
651-
reveal_defining_opaque_types,
652629
in_progress_typeck_results,
653630
inner: RefCell::new(InferCtxtInner::new()),
654631
lexical_region_resolutions: RefCell::new(None),

compiler/rustc_typeck/src/check/inherited.rs

-7
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,6 @@ impl<'tcx> InheritedBuilder<'tcx> {
9595
let def_id = self.def_id;
9696
self.infcx.enter(|infcx| f(Inherited::new(infcx, def_id)))
9797
}
98-
99-
/// WF-checking doesn't need to recompute opaque types and can instead use
100-
/// the type_of query to get them from typeck.
101-
pub fn reveal_defining_opaque_types(mut self) -> Self {
102-
self.infcx = self.infcx.reveal_defining_opaque_types();
103-
self
104-
}
10598
}
10699

107100
impl<'a, 'tcx> Inherited<'a, 'tcx> {

compiler/rustc_typeck/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ fn for_item<'tcx>(tcx: TyCtxt<'tcx>, item: &hir::Item<'_>) -> CheckWfFcxBuilder<
968968

969969
fn for_id(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) -> CheckWfFcxBuilder<'_> {
970970
CheckWfFcxBuilder {
971-
inherited: Inherited::build(tcx, def_id).reveal_defining_opaque_types(),
971+
inherited: Inherited::build(tcx, def_id),
972972
id: hir::HirId::make_owner(def_id),
973973
span,
974974
param_env: tcx.param_env(def_id),

0 commit comments

Comments
 (0)