Set groundwork for proper const normalization
This commit is contained in:
@@ -32,8 +32,14 @@ fn normalize_canonicalized_projection_ty<'tcx>(
|
||||
let selcx = &mut SelectionContext::new(ocx.infcx);
|
||||
let cause = ObligationCause::dummy();
|
||||
let mut obligations = PredicateObligations::new();
|
||||
let answer =
|
||||
traits::normalize_projection_ty(selcx, param_env, goal, cause, 0, &mut obligations);
|
||||
let answer = traits::normalize_projection_term(
|
||||
selcx,
|
||||
param_env,
|
||||
goal.into(),
|
||||
cause,
|
||||
0,
|
||||
&mut obligations,
|
||||
);
|
||||
ocx.register_obligations(obligations);
|
||||
// #112047: With projections and opaques, we are able to create opaques that
|
||||
// are recursive (given some generic parameters of the opaque's type variables).
|
||||
@@ -104,14 +110,14 @@ fn normalize_canonicalized_inherent_projection_ty<'tcx>(
|
||||
let answer = traits::normalize_inherent_projection(
|
||||
selcx,
|
||||
param_env,
|
||||
goal,
|
||||
goal.into(),
|
||||
cause,
|
||||
0,
|
||||
&mut obligations,
|
||||
);
|
||||
ocx.register_obligations(obligations);
|
||||
|
||||
Ok(NormalizationResult { normalized_ty: answer })
|
||||
Ok(NormalizationResult { normalized_ty: answer.expect_type() })
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user