@@ -290,10 +290,6 @@ pub struct InferCtxt<'a, 'tcx> {
290
290
/// to the outside until the end up in an `InferCtxt` for typeck or borrowck.
291
291
pub defining_use_anchor : Option < LocalDefId > ,
292
292
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
-
297
293
/// During type-checking/inference of a body, `in_progress_typeck_results`
298
294
/// contains a reference to the typeck results being built up, which are
299
295
/// used for reading closure kinds/signatures as they are inferred,
@@ -569,7 +565,6 @@ pub struct InferCtxtBuilder<'tcx> {
569
565
tcx : TyCtxt < ' tcx > ,
570
566
fresh_typeck_results : Option < RefCell < ty:: TypeckResults < ' tcx > > > ,
571
567
defining_use_anchor : Option < LocalDefId > ,
572
- reveal_defining_opaque_types : bool ,
573
568
}
574
569
575
570
pub trait TyCtxtInferExt < ' tcx > {
@@ -578,12 +573,7 @@ pub trait TyCtxtInferExt<'tcx> {
578
573
579
574
impl < ' tcx > TyCtxtInferExt < ' tcx > for TyCtxt < ' tcx > {
580
575
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 }
587
577
}
588
578
}
589
579
@@ -607,13 +597,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
607
597
self
608
598
}
609
599
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
-
617
600
/// Given a canonical value `C` as a starting point, create an
618
601
/// inference context that contains each of the bound values
619
602
/// within instantiated as a fresh variable. The `f` closure is
@@ -638,17 +621,11 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
638
621
}
639
622
640
623
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 ;
647
625
let in_progress_typeck_results = fresh_typeck_results. as_ref ( ) ;
648
626
f ( InferCtxt {
649
627
tcx,
650
628
defining_use_anchor,
651
- reveal_defining_opaque_types,
652
629
in_progress_typeck_results,
653
630
inner : RefCell :: new ( InferCtxtInner :: new ( ) ) ,
654
631
lexical_region_resolutions : RefCell :: new ( None ) ,
0 commit comments