@@ -80,7 +80,6 @@ pub struct InferOk<'tcx, T> {
8080}
8181pub type InferResult < ' tcx , T > = Result < InferOk < ' tcx , T > , TypeError < ' tcx > > ;
8282
83- pub type Bound < T > = Option < T > ;
8483pub type UnitResult < ' tcx > = RelateResult < ' tcx , ( ) > ; // "unify result"
8584pub type FixupResult < ' tcx , T > = Result < T , FixupError < ' tcx > > ; // "fixup result"
8685
@@ -334,9 +333,6 @@ pub struct InferCtxt<'tcx> {
334333 /// bound.
335334 universe : Cell < ty:: UniverseIndex > ,
336335
337- normalize_fn_sig_for_diagnostic :
338- Option < Lrc < dyn Fn ( & InferCtxt < ' tcx > , ty:: PolyFnSig < ' tcx > ) -> ty:: PolyFnSig < ' tcx > > > ,
339-
340336 /// During coherence we have to assume that other crates may add
341337 /// additional impls which we currently don't know about.
342338 ///
@@ -573,8 +569,6 @@ pub struct InferCtxtBuilder<'tcx> {
573569 considering_regions : bool ,
574570 /// Whether we are in coherence mode.
575571 intercrate : bool ,
576- normalize_fn_sig_for_diagnostic :
577- Option < Lrc < dyn Fn ( & InferCtxt < ' tcx > , ty:: PolyFnSig < ' tcx > ) -> ty:: PolyFnSig < ' tcx > > > ,
578572}
579573
580574pub trait TyCtxtInferExt < ' tcx > {
@@ -587,7 +581,6 @@ impl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx> {
587581 tcx : self ,
588582 defining_use_anchor : DefiningAnchor :: Error ,
589583 considering_regions : true ,
590- normalize_fn_sig_for_diagnostic : None ,
591584 intercrate : false ,
592585 }
593586 }
@@ -615,14 +608,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
615608 self
616609 }
617610
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-
626611 /// Given a canonical value `C` as a starting point, create an
627612 /// inference context that contains each of the bound values
628613 /// within instantiated as a fresh variable. The `f` closure is
@@ -644,13 +629,7 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
644629 }
645630
646631 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 ;
654633 InferCtxt {
655634 tcx,
656635 defining_use_anchor,
@@ -666,9 +645,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
666645 in_snapshot : Cell :: new ( false ) ,
667646 skip_leak_check : Cell :: new ( false ) ,
668647 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 ( ) ) ,
672648 intercrate,
673649 }
674650 }
@@ -709,7 +685,12 @@ impl<'tcx> InferCtxt<'tcx> {
709685 /// Creates a `TypeErrCtxt` for emitting various inference errors.
710686 /// During typeck, use `FnCtxt::err_ctxt` instead.
711687 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+ }
713694 }
714695
715696 pub fn is_in_snapshot ( & self ) -> bool {
0 commit comments