@@ -195,7 +195,7 @@ fn satisfied_from_param_env<'tcx>(
195195 match pred. kind ( ) . skip_binder ( ) {
196196 ty:: PredicateKind :: ConstEvaluatable ( uv) => {
197197 if let Some ( b_ct) = AbstractConst :: new ( tcx, uv) ? {
198- let const_unify_ctxt = ConstUnifyCtxt :: new ( tcx, param_env) ;
198+ let const_unify_ctxt = ConstUnifyCtxt { tcx, param_env } ;
199199
200200 // Try to unify with each subtree in the AbstractConst to allow for
201201 // `N + 1` being const evaluatable even if theres only a `ConstEvaluatable`
@@ -579,7 +579,7 @@ pub(super) fn try_unify_abstract_consts<'tcx>(
579579 ( || {
580580 if let Some ( a) = AbstractConst :: new ( tcx, a) ? {
581581 if let Some ( b) = AbstractConst :: new ( tcx, b) ? {
582- let const_unify_ctxt = ConstUnifyCtxt :: new ( tcx, param_env) ;
582+ let const_unify_ctxt = ConstUnifyCtxt { tcx, param_env } ;
583583 return Ok ( const_unify_ctxt. try_unify ( a, b) ) ;
584584 }
585585 }
@@ -625,22 +625,18 @@ where
625625 recurse ( tcx, ct, & mut f)
626626}
627627
628- pub ( super ) struct ConstUnifyCtxt < ' tcx > {
628+ struct ConstUnifyCtxt < ' tcx > {
629629 tcx : TyCtxt < ' tcx > ,
630630 param_env : ty:: ParamEnv < ' tcx > ,
631631}
632632
633633impl < ' tcx > ConstUnifyCtxt < ' tcx > {
634- pub ( super ) fn new ( tcx : TyCtxt < ' tcx > , param_env : ty:: ParamEnv < ' tcx > ) -> Self {
635- ConstUnifyCtxt { tcx, param_env }
636- }
637-
638634 // Substitutes generics repeatedly to allow AbstractConsts to unify where a
639635 // ConstKind::Unevalated could be turned into an AbstractConst that would unify e.g.
640636 // Param(N) should unify with Param(T), substs: [Unevaluated("T2", [Unevaluated("T3", [Param(N)])])]
641637 #[ inline]
642638 #[ instrument( skip( self ) , level = "debug" ) ]
643- pub ( super ) fn try_replace_substs_in_root (
639+ fn try_replace_substs_in_root (
644640 & self ,
645641 mut abstr_const : AbstractConst < ' tcx > ,
646642 ) -> Option < AbstractConst < ' tcx > > {
0 commit comments