1
Fork 0

drive-by: use is_const and is_const_if_const

This commit is contained in:
Michael Goulet 2022-01-26 19:24:01 -08:00
parent 1ab97dbc52
commit c6de4d55aa
7 changed files with 16 additions and 15 deletions

View file

@ -72,9 +72,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// CheckPredicate(&A: Super)
// CheckPredicate(A: ~const Super) // <- still const env, failure
// ```
if obligation.param_env.constness() == Constness::Const
&& obligation.predicate.skip_binder().constness == ty::BoundConstness::NotConst
{
if obligation.param_env.is_const() && !obligation.predicate.is_const_if_const() {
new_obligation = TraitObligation {
cause: obligation.cause.clone(),
param_env: obligation.param_env.without_const(),