@@ -80,7 +80,6 @@ pub struct InferOk<'tcx, T> {
80
80
}
81
81
pub type InferResult < ' tcx , T > = Result < InferOk < ' tcx , T > , TypeError < ' tcx > > ;
82
82
83
- pub type Bound < T > = Option < T > ;
84
83
pub type UnitResult < ' tcx > = RelateResult < ' tcx , ( ) > ; // "unify result"
85
84
pub type FixupResult < ' tcx , T > = Result < T , FixupError < ' tcx > > ; // "fixup result"
86
85
@@ -334,9 +333,6 @@ pub struct InferCtxt<'tcx> {
334
333
/// bound.
335
334
universe : Cell < ty:: UniverseIndex > ,
336
335
337
- normalize_fn_sig_for_diagnostic :
338
- Option < Lrc < dyn Fn ( & InferCtxt < ' tcx > , ty:: PolyFnSig < ' tcx > ) -> ty:: PolyFnSig < ' tcx > > > ,
339
-
340
336
/// During coherence we have to assume that other crates may add
341
337
/// additional impls which we currently don't know about.
342
338
///
@@ -573,8 +569,6 @@ pub struct InferCtxtBuilder<'tcx> {
573
569
considering_regions : bool ,
574
570
/// Whether we are in coherence mode.
575
571
intercrate : bool ,
576
- normalize_fn_sig_for_diagnostic :
577
- Option < Lrc < dyn Fn ( & InferCtxt < ' tcx > , ty:: PolyFnSig < ' tcx > ) -> ty:: PolyFnSig < ' tcx > > > ,
578
572
}
579
573
580
574
pub trait TyCtxtInferExt < ' tcx > {
@@ -587,7 +581,6 @@ impl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx> {
587
581
tcx : self ,
588
582
defining_use_anchor : DefiningAnchor :: Error ,
589
583
considering_regions : true ,
590
- normalize_fn_sig_for_diagnostic : None ,
591
584
intercrate : false ,
592
585
}
593
586
}
@@ -615,14 +608,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
615
608
self
616
609
}
617
610
618
- pub fn with_normalize_fn_sig_for_diagnostic (
619
- mut self ,
620
- fun : Lrc < dyn Fn ( & InferCtxt < ' tcx > , ty:: PolyFnSig < ' tcx > ) -> ty:: PolyFnSig < ' tcx > > ,
621
- ) -> Self {
622
- self . normalize_fn_sig_for_diagnostic = Some ( fun) ;
623
- self
624
- }
625
-
626
611
/// Given a canonical value `C` as a starting point, create an
627
612
/// inference context that contains each of the bound values
628
613
/// within instantiated as a fresh variable. The `f` closure is
@@ -644,13 +629,7 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
644
629
}
645
630
646
631
pub fn build ( & mut self ) -> InferCtxt < ' tcx > {
647
- let InferCtxtBuilder {
648
- tcx,
649
- defining_use_anchor,
650
- considering_regions,
651
- ref normalize_fn_sig_for_diagnostic,
652
- intercrate,
653
- } = * self ;
632
+ let InferCtxtBuilder { tcx, defining_use_anchor, considering_regions, intercrate } = * self ;
654
633
InferCtxt {
655
634
tcx,
656
635
defining_use_anchor,
@@ -666,9 +645,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
666
645
in_snapshot : Cell :: new ( false ) ,
667
646
skip_leak_check : Cell :: new ( false ) ,
668
647
universe : Cell :: new ( ty:: UniverseIndex :: ROOT ) ,
669
- normalize_fn_sig_for_diagnostic : normalize_fn_sig_for_diagnostic
670
- . as_ref ( )
671
- . map ( |f| f. clone ( ) ) ,
672
648
intercrate,
673
649
}
674
650
}
@@ -709,7 +685,12 @@ impl<'tcx> InferCtxt<'tcx> {
709
685
/// Creates a `TypeErrCtxt` for emitting various inference errors.
710
686
/// During typeck, use `FnCtxt::err_ctxt` instead.
711
687
pub fn err_ctxt ( & self ) -> TypeErrCtxt < ' _ , ' tcx > {
712
- TypeErrCtxt { infcx : self , typeck_results : None , fallback_has_occurred : false }
688
+ TypeErrCtxt {
689
+ infcx : self ,
690
+ typeck_results : None ,
691
+ fallback_has_occurred : false ,
692
+ normalize_fn_sig : Box :: new ( |fn_sig| fn_sig) ,
693
+ }
713
694
}
714
695
715
696
pub fn is_in_snapshot ( & self ) -> bool {
0 commit comments