@@ -195,7 +195,7 @@ fn satisfied_from_param_env<'tcx>(
195
195
match pred. kind ( ) . skip_binder ( ) {
196
196
ty:: PredicateKind :: ConstEvaluatable ( uv) => {
197
197
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 } ;
199
199
200
200
// Try to unify with each subtree in the AbstractConst to allow for
201
201
// `N + 1` being const evaluatable even if theres only a `ConstEvaluatable`
@@ -579,7 +579,7 @@ pub(super) fn try_unify_abstract_consts<'tcx>(
579
579
( || {
580
580
if let Some ( a) = AbstractConst :: new ( tcx, a) ? {
581
581
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 } ;
583
583
return Ok ( const_unify_ctxt. try_unify ( a, b) ) ;
584
584
}
585
585
}
@@ -625,22 +625,18 @@ where
625
625
recurse ( tcx, ct, & mut f)
626
626
}
627
627
628
- pub ( super ) struct ConstUnifyCtxt < ' tcx > {
628
+ struct ConstUnifyCtxt < ' tcx > {
629
629
tcx : TyCtxt < ' tcx > ,
630
630
param_env : ty:: ParamEnv < ' tcx > ,
631
631
}
632
632
633
633
impl < ' tcx > ConstUnifyCtxt < ' tcx > {
634
- pub ( super ) fn new ( tcx : TyCtxt < ' tcx > , param_env : ty:: ParamEnv < ' tcx > ) -> Self {
635
- ConstUnifyCtxt { tcx, param_env }
636
- }
637
-
638
634
// Substitutes generics repeatedly to allow AbstractConsts to unify where a
639
635
// ConstKind::Unevalated could be turned into an AbstractConst that would unify e.g.
640
636
// Param(N) should unify with Param(T), substs: [Unevaluated("T2", [Unevaluated("T3", [Param(N)])])]
641
637
#[ inline]
642
638
#[ instrument( skip( self ) , level = "debug" ) ]
643
- pub ( super ) fn try_replace_substs_in_root (
639
+ fn try_replace_substs_in_root (
644
640
& self ,
645
641
mut abstr_const : AbstractConst < ' tcx > ,
646
642
) -> Option < AbstractConst < ' tcx > > {
0 commit comments