Skip to content

Commit caa975c

Browse files
committed
use ty::Unevaluated instead of def substs pair
1 parent 0312438 commit caa975c

File tree

19 files changed

+66
-86
lines changed

19 files changed

+66
-86
lines changed

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
678678
a: ty::Unevaluated<'tcx>,
679679
b: ty::Unevaluated<'tcx>,
680680
) -> bool {
681-
let canonical = self.canonicalize_query(
682-
((a.def, a.substs(self.tcx)), (b.def, b.substs(self.tcx))),
683-
&mut OriginalQueryValues::default(),
684-
);
681+
let canonical = self.canonicalize_query((a, b), &mut OriginalQueryValues::default());
685682
debug!("canonical consts: {:?}", &canonical.value);
686683

687684
self.tcx.try_unify_abstract_consts(canonical.value)

compiler/rustc_middle/src/query/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,11 @@ rustc_queries! {
303303
}
304304

305305
query try_unify_abstract_consts(key: (
306-
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
307-
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>)
306+
ty::Unevaluated<'tcx>, ty::Unevaluated<'tcx>
308307
)) -> bool {
309308
desc {
310309
|tcx| "trying to unify the generic constants {} and {}",
311-
tcx.def_path_str(key.0.0.did), tcx.def_path_str(key.1.0.did)
310+
tcx.def_path_str(key.0.def.did), tcx.def_path_str(key.1.def.did)
312311
}
313312
}
314313

compiler/rustc_middle/src/ty/consts/kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::ScalarInt;
1818
///
1919
/// We check for all possible substs in `fn default_anon_const_substs`,
2020
/// so refer to that check for more info.
21-
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable)]
21+
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable, Lift)]
2222
#[derive(Hash, HashStable)]
2323
pub struct Unevaluated<'tcx> {
2424
pub def: ty::WithOptConstParam<DefId>,

compiler/rustc_middle/src/ty/flags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ impl FlagComputation {
252252
ty::PredicateKind::ClosureKind(_def_id, substs, _kind) => {
253253
self.add_substs(substs);
254254
}
255-
ty::PredicateKind::ConstEvaluatable(_def_id, substs) => {
256-
self.add_substs(substs);
255+
ty::PredicateKind::ConstEvaluatable(uv) => {
256+
self.add_unevaluated_const(uv);
257257
}
258258
ty::PredicateKind::ConstEquate(expected, found) => {
259259
self.add_const(expected);

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ crate struct PredicateInner<'tcx> {
406406
}
407407

408408
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
409-
static_assert_size!(PredicateInner<'_>, 48);
409+
static_assert_size!(PredicateInner<'_>, 56);
410410

411411
#[derive(Clone, Copy, Lift)]
412412
pub struct Predicate<'tcx> {
@@ -502,7 +502,7 @@ pub enum PredicateKind<'tcx> {
502502
Coerce(CoercePredicate<'tcx>),
503503

504504
/// Constant initializer must evaluate successfully.
505-
ConstEvaluatable(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
505+
ConstEvaluatable(ty::Unevaluated<'tcx>),
506506

507507
/// Constants must be equal. The first component is the const that is expected.
508508
ConstEquate(&'tcx Const<'tcx>, &'tcx Const<'tcx>),

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,8 +2294,8 @@ define_print_and_forward_display! {
22942294
print_value_path(closure_def_id, &[]),
22952295
write("` implements the trait `{}`", kind))
22962296
}
2297-
ty::PredicateKind::ConstEvaluatable(def, substs) => {
2298-
p!("the constant `", print_value_path(def.did, substs), "` can be evaluated")
2297+
ty::PredicateKind::ConstEvaluatable(uv) => {
2298+
p!("the constant `", print_value_path(uv.def.did, uv.substs_.map_or(&[], |x| x)), "` can be evaluated")
22992299
}
23002300
ty::PredicateKind::ConstEquate(c1, c2) => {
23012301
p!("the constant `", print(c1), "` equals `", print(c2), "`")

compiler/rustc_middle/src/ty/relate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ pub fn super_relate_consts<R: TypeRelation<'tcx>>(
579579
(ty::ConstKind::Unevaluated(au), ty::ConstKind::Unevaluated(bu))
580580
if tcx.features().const_evaluatable_checked =>
581581
{
582-
tcx.try_unify_abstract_consts(((au.def, au.substs(tcx)), (bu.def, bu.substs(tcx))))
582+
tcx.try_unify_abstract_consts((au, bu))
583583
}
584584

585585
// While this is slightly incorrect, it shouldn't matter for `min_const_generics`

compiler/rustc_middle/src/ty/structural_impls.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ impl fmt::Debug for ty::PredicateKind<'tcx> {
190190
ty::PredicateKind::ClosureKind(closure_def_id, closure_substs, kind) => {
191191
write!(f, "ClosureKind({:?}, {:?}, {:?})", closure_def_id, closure_substs, kind)
192192
}
193-
ty::PredicateKind::ConstEvaluatable(def_id, substs) => {
194-
write!(f, "ConstEvaluatable({:?}, {:?})", def_id, substs)
193+
ty::PredicateKind::ConstEvaluatable(uv) => {
194+
write!(f, "ConstEvaluatable({:?}, {:?})", uv.def, uv.substs_)
195195
}
196196
ty::PredicateKind::ConstEquate(c1, c2) => write!(f, "ConstEquate({:?}, {:?})", c1, c2),
197197
ty::PredicateKind::TypeWellFormedFromEnv(ty) => {
@@ -447,8 +447,8 @@ impl<'a, 'tcx> Lift<'tcx> for ty::PredicateKind<'a> {
447447
ty::PredicateKind::ObjectSafe(trait_def_id) => {
448448
Some(ty::PredicateKind::ObjectSafe(trait_def_id))
449449
}
450-
ty::PredicateKind::ConstEvaluatable(def_id, substs) => {
451-
tcx.lift(substs).map(|substs| ty::PredicateKind::ConstEvaluatable(def_id, substs))
450+
ty::PredicateKind::ConstEvaluatable(uv) => {
451+
tcx.lift(uv).map(|uv| ty::PredicateKind::ConstEvaluatable(uv))
452452
}
453453
ty::PredicateKind::ConstEquate(c1, c2) => {
454454
tcx.lift((c1, c2)).map(|(c1, c2)| ty::PredicateKind::ConstEquate(c1, c2))

compiler/rustc_privacy/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ where
134134
ty.visit_with(self)
135135
}
136136
ty::PredicateKind::RegionOutlives(..) => ControlFlow::CONTINUE,
137-
ty::PredicateKind::ConstEvaluatable(defs, substs)
137+
ty::PredicateKind::ConstEvaluatable(uv)
138138
if self.def_id_visitor.tcx().features().const_evaluatable_checked =>
139139
{
140140
let tcx = self.def_id_visitor.tcx();
141-
if let Ok(Some(ct)) = AbstractConst::new(tcx, defs, substs) {
141+
if let Ok(Some(ct)) = AbstractConst::new(tcx, uv) {
142142
self.visit_abstract_const_expr(tcx, ct)?;
143143
}
144144
ControlFlow::CONTINUE

compiler/rustc_query_impl/src/keys.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,13 @@ impl<'tcx> Key for (DefId, SubstsRef<'tcx>) {
217217
}
218218
}
219219

220-
impl<'tcx> Key
221-
for (
222-
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
223-
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
224-
)
225-
{
220+
impl<'tcx> Key for (ty::Unevaluated<'tcx>, ty::Unevaluated<'tcx>) {
226221
#[inline(always)]
227222
fn query_crate_is_local(&self) -> bool {
228-
(self.0).0.did.krate == LOCAL_CRATE
223+
(self.0).def.did.krate == LOCAL_CRATE
229224
}
230225
fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
231-
(self.0).0.did.default_span(tcx)
226+
(self.0).def.did.default_span(tcx)
232227
}
233228
}
234229

compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_middle::mir::{self, Rvalue, StatementKind, TerminatorKind};
1919
use rustc_middle::ty::subst::{Subst, SubstsRef};
2020
use rustc_middle::ty::{self, TyCtxt, TypeFoldable};
2121
use rustc_session::lint;
22-
use rustc_span::def_id::{DefId, LocalDefId};
22+
use rustc_span::def_id::LocalDefId;
2323
use rustc_span::Span;
2424

2525
use std::cmp;
@@ -29,26 +29,20 @@ use std::ops::ControlFlow;
2929
/// Check if a given constant can be evaluated.
3030
pub fn is_const_evaluatable<'cx, 'tcx>(
3131
infcx: &InferCtxt<'cx, 'tcx>,
32-
def: ty::WithOptConstParam<DefId>,
33-
substs: SubstsRef<'tcx>,
32+
uv: ty::Unevaluated<'tcx>,
3433
param_env: ty::ParamEnv<'tcx>,
3534
span: Span,
3635
) -> Result<(), NotConstEvaluatable> {
37-
debug!("is_const_evaluatable({:?}, {:?})", def, substs);
36+
debug!("is_const_evaluatable({:?})", uv);
3837
if infcx.tcx.features().const_evaluatable_checked {
3938
let tcx = infcx.tcx;
40-
match AbstractConst::new(tcx, def, substs)? {
39+
match AbstractConst::new(tcx, uv)? {
4140
// We are looking at a generic abstract constant.
4241
Some(ct) => {
4342
for pred in param_env.caller_bounds() {
4443
match pred.kind().skip_binder() {
45-
ty::PredicateKind::ConstEvaluatable(b_def, b_substs) => {
46-
if b_def == def && b_substs == substs {
47-
debug!("is_const_evaluatable: caller_bound ~~> ok");
48-
return Ok(());
49-
}
50-
51-
if let Some(b_ct) = AbstractConst::new(tcx, b_def, b_substs)? {
44+
ty::PredicateKind::ConstEvaluatable(uv) => {
45+
if let Some(b_ct) = AbstractConst::new(tcx, uv)? {
5246
// Try to unify with each subtree in the AbstractConst to allow for
5347
// `N + 1` being const evaluatable even if theres only a `ConstEvaluatable`
5448
// predicate for `(N + 1) * 2`
@@ -134,7 +128,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
134128
}
135129

136130
let future_compat_lint = || {
137-
if let Some(local_def_id) = def.did.as_local() {
131+
if let Some(local_def_id) = uv.def.did.as_local() {
138132
infcx.tcx.struct_span_lint_hir(
139133
lint::builtin::CONST_EVALUATABLE_UNCHECKED,
140134
infcx.tcx.hir().local_def_id_to_hir_id(local_def_id),
@@ -155,13 +149,12 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
155149
// and hopefully soon change this to an error.
156150
//
157151
// See #74595 for more details about this.
158-
let concrete =
159-
infcx.const_eval_resolve(param_env, ty::Unevaluated::new(def, substs), Some(span));
152+
let concrete = infcx.const_eval_resolve(param_env, uv, Some(span));
160153

161-
if concrete.is_ok() && substs.has_param_types_or_consts(infcx.tcx) {
162-
match infcx.tcx.def_kind(def.did) {
154+
if concrete.is_ok() && uv.substs(infcx.tcx).has_param_types_or_consts(infcx.tcx) {
155+
match infcx.tcx.def_kind(uv.def.did) {
163156
DefKind::AnonConst => {
164-
let mir_body = infcx.tcx.mir_for_ctfe_opt_const_arg(def);
157+
let mir_body = infcx.tcx.mir_for_ctfe_opt_const_arg(uv.def);
165158

166159
if mir_body.is_polymorphic {
167160
future_compat_lint();
@@ -173,7 +166,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
173166

174167
debug!(?concrete, "is_const_evaluatable");
175168
match concrete {
176-
Err(ErrorHandled::TooGeneric) => Err(match substs.has_infer_types_or_consts() {
169+
Err(ErrorHandled::TooGeneric) => Err(match uv.has_infer_types_or_consts() {
177170
true => NotConstEvaluatable::MentionsInfer,
178171
false => NotConstEvaluatable::MentionsParam,
179172
}),
@@ -198,23 +191,22 @@ pub struct AbstractConst<'tcx> {
198191
pub substs: SubstsRef<'tcx>,
199192
}
200193

201-
impl AbstractConst<'tcx> {
194+
impl<'tcx> AbstractConst<'tcx> {
202195
pub fn new(
203196
tcx: TyCtxt<'tcx>,
204-
def: ty::WithOptConstParam<DefId>,
205-
substs: SubstsRef<'tcx>,
197+
uv: ty::Unevaluated<'tcx>,
206198
) -> Result<Option<AbstractConst<'tcx>>, ErrorReported> {
207-
let inner = tcx.mir_abstract_const_opt_const_arg(def)?;
208-
debug!("AbstractConst::new({:?}) = {:?}", def, inner);
209-
Ok(inner.map(|inner| AbstractConst { inner, substs }))
199+
let inner = tcx.mir_abstract_const_opt_const_arg(uv.def)?;
200+
debug!("AbstractConst::new({:?}) = {:?}", uv, inner);
201+
Ok(inner.map(|inner| AbstractConst { inner, substs: uv.substs(tcx) }))
210202
}
211203

212204
pub fn from_const(
213205
tcx: TyCtxt<'tcx>,
214206
ct: &ty::Const<'tcx>,
215207
) -> Result<Option<AbstractConst<'tcx>>, ErrorReported> {
216208
match ct.val {
217-
ty::ConstKind::Unevaluated(uv) => AbstractConst::new(tcx, uv.def, uv.substs(tcx)),
209+
ty::ConstKind::Unevaluated(uv) => AbstractConst::new(tcx, uv),
218210
ty::ConstKind::Error(_) => Err(ErrorReported),
219211
_ => Ok(None),
220212
}
@@ -564,14 +556,11 @@ pub(super) fn mir_abstract_const<'tcx>(
564556

565557
pub(super) fn try_unify_abstract_consts<'tcx>(
566558
tcx: TyCtxt<'tcx>,
567-
((a, a_substs), (b, b_substs)): (
568-
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
569-
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
570-
),
559+
(a, b): (ty::Unevaluated<'tcx>, ty::Unevaluated<'tcx>),
571560
) -> bool {
572561
(|| {
573-
if let Some(a) = AbstractConst::new(tcx, a, a_substs)? {
574-
if let Some(b) = AbstractConst::new(tcx, b, b_substs)? {
562+
if let Some(a) = AbstractConst::new(tcx, a)? {
563+
if let Some(b) = AbstractConst::new(tcx, b)? {
575564
return Ok(try_unify(tcx, a, b));
576565
}
577566
}

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
811811
}
812812

813813
match obligation.predicate.kind().skip_binder() {
814-
ty::PredicateKind::ConstEvaluatable(def, _) => {
814+
ty::PredicateKind::ConstEvaluatable(uv) => {
815815
let mut err =
816816
self.tcx.sess.struct_span_err(span, "unconstrained generic constant");
817-
let const_span = self.tcx.def_span(def.did);
817+
let const_span = self.tcx.def_span(uv.def.did);
818818
match self.tcx.sess.source_map().span_to_snippet(const_span) {
819819
Ok(snippet) => err.help(&format!(
820820
"try adding a `where` bound using this expression: `where [(); {}]:`",

compiler/rustc_trait_selection/src/traits/fulfill.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,19 +543,20 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
543543
}
544544
}
545545

546-
ty::PredicateKind::ConstEvaluatable(def_id, substs) => {
546+
ty::PredicateKind::ConstEvaluatable(uv) => {
547547
match const_evaluatable::is_const_evaluatable(
548548
self.selcx.infcx(),
549-
def_id,
550-
substs,
549+
uv,
551550
obligation.param_env,
552551
obligation.cause.span,
553552
) {
554553
Ok(()) => ProcessResult::Changed(vec![]),
555554
Err(NotConstEvaluatable::MentionsInfer) => {
556555
pending_obligation.stalled_on.clear();
557556
pending_obligation.stalled_on.extend(
558-
substs.iter().filter_map(TyOrConstInferVar::maybe_from_generic_arg),
557+
uv.substs(infcx.tcx)
558+
.iter()
559+
.filter_map(TyOrConstInferVar::maybe_from_generic_arg),
559560
);
560561
ProcessResult::Unchanged
561562
}

compiler/rustc_trait_selection/src/traits/object_safety.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,12 +854,12 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
854854
}
855855

856856
fn visit_predicate(&mut self, pred: ty::Predicate<'tcx>) -> ControlFlow<Self::BreakTy> {
857-
if let ty::PredicateKind::ConstEvaluatable(def, substs) = pred.kind().skip_binder() {
857+
if let ty::PredicateKind::ConstEvaluatable(ct) = pred.kind().skip_binder() {
858858
// FIXME(const_evaluatable_checked): We should probably deduplicate the logic for
859859
// `AbstractConst`s here, it might make sense to change `ConstEvaluatable` to
860860
// take a `ty::Const` instead.
861861
use rustc_middle::mir::abstract_const::Node;
862-
if let Ok(Some(ct)) = AbstractConst::new(self.tcx, def, substs) {
862+
if let Ok(Some(ct)) = AbstractConst::new(self.tcx, ct) {
863863
const_evaluatable::walk_abstract_const(self.tcx, ct, |node| match node.root() {
864864
Node::Leaf(leaf) => {
865865
let leaf = leaf.subst(self.tcx, ct.substs);

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
598598
}
599599
}
600600

601-
ty::PredicateKind::ConstEvaluatable(def_id, substs) => {
601+
ty::PredicateKind::ConstEvaluatable(uv) => {
602602
match const_evaluatable::is_const_evaluatable(
603603
self.infcx,
604-
def_id,
605-
substs,
604+
uv,
606605
obligation.param_env,
607606
obligation.cause.span,
608607
) {

compiler/rustc_trait_selection/src/traits/wf.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ pub fn predicate_obligations<'a, 'tcx>(
132132
wf.compute(a.into());
133133
wf.compute(b.into());
134134
}
135-
ty::PredicateKind::ConstEvaluatable(def, substs) => {
136-
let obligations = wf.nominal_obligations(def.did, substs);
135+
ty::PredicateKind::ConstEvaluatable(uv) => {
136+
let substs = uv.substs(wf.tcx());
137+
let obligations = wf.nominal_obligations(uv.def.did, substs);
137138
wf.out.extend(obligations);
138139

139140
for arg in substs.iter() {
@@ -442,8 +443,10 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
442443
let obligations = self.nominal_obligations(uv.def.did, substs);
443444
self.out.extend(obligations);
444445

445-
let predicate = ty::PredicateKind::ConstEvaluatable(uv.def, substs)
446-
.to_predicate(self.tcx());
446+
let predicate = ty::PredicateKind::ConstEvaluatable(
447+
ty::Unevaluated::new(uv.def, substs),
448+
)
449+
.to_predicate(self.tcx());
447450
let cause = self.cause(traits::MiscObligation);
448451
self.out.push(traits::Obligation::with_depth(
449452
cause,

compiler/rustc_typeck/src/check/dropck.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
236236
relator.relate(predicate.rebind(a), p.rebind(b)).is_ok()
237237
}
238238
(
239-
ty::PredicateKind::ConstEvaluatable(def_a, substs_a),
240-
ty::PredicateKind::ConstEvaluatable(def_b, substs_b),
241-
) => tcx.try_unify_abstract_consts(((def_a, substs_a), (def_b, substs_b))),
239+
ty::PredicateKind::ConstEvaluatable(a),
240+
ty::PredicateKind::ConstEvaluatable(b),
241+
) => tcx.try_unify_abstract_consts((a, b)),
242242
(ty::PredicateKind::TypeOutlives(a), ty::PredicateKind::TypeOutlives(b)) => {
243243
relator.relate(predicate.rebind(a.0), p.rebind(b.0)).is_ok()
244244
}

compiler/rustc_typeck/src/check/wfcheck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,10 @@ fn check_type_defn<'tcx, F>(
541541
fcx.register_predicate(traits::Obligation::new(
542542
cause,
543543
fcx.param_env,
544-
ty::PredicateKind::ConstEvaluatable(
544+
ty::PredicateKind::ConstEvaluatable(ty::Unevaluated::new(
545545
ty::WithOptConstParam::unknown(discr_def_id.to_def_id()),
546546
discr_substs,
547-
)
547+
))
548548
.to_predicate(tcx),
549549
));
550550
}

compiler/rustc_typeck/src/collect.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,11 +2355,8 @@ fn const_evaluatable_predicates_of<'tcx>(
23552355
if let ty::ConstKind::Unevaluated(uv) = ct.val {
23562356
assert_eq!(uv.promoted, None);
23572357
let span = self.tcx.hir().span(c.hir_id);
2358-
self.preds.insert((
2359-
ty::PredicateKind::ConstEvaluatable(uv.def, uv.substs(self.tcx))
2360-
.to_predicate(self.tcx),
2361-
span,
2362-
));
2358+
self.preds
2359+
.insert((ty::PredicateKind::ConstEvaluatable(uv).to_predicate(self.tcx), span));
23632360
}
23642361
}
23652362

0 commit comments

Comments
 (0)