ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for Chalk")
}
- ty::PredicateKind::OpaqueType(..) => {
- todo!("{:#?}", obligation);
- }
},
Some(pred) => match pred {
ty::PredicateKind::Trait(data) => {
//
// Let's just see where this breaks :shrug:
if let (ty::ConstKind::Unevaluated(a), ty::ConstKind::Unevaluated(b)) =
- (c1.val, c2.val)
+ (c1.val(), c2.val())
{
if infcx.try_unify_abstract_consts(a.shrink(), b.shrink()) {
return ProcessResult::Changed(vec![]);
let stalled_on = &mut pending_obligation.stalled_on;
- let mut evaluate = |c: &'tcx Const<'tcx>| {
- if let ty::ConstKind::Unevaluated(unevaluated) = c.val {
+ let mut evaluate = |c: Const<'tcx>| {
+ if let ty::ConstKind::Unevaluated(unevaluated) = c.val() {
match self.selcx.infcx().const_eval_resolve(
obligation.param_env,
unevaluated,
Some(obligation.cause.span),
) {
- Ok(val) => Ok(Const::from_value(self.selcx.tcx(), val, c.ty)),
+ Ok(val) => Ok(Const::from_value(self.selcx.tcx(), val, c.ty())),
Err(ErrorHandled::TooGeneric) => {
stalled_on.extend(
unevaluated
ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for Chalk")
}
- ty::PredicateKind::OpaqueType(a, b) => {
- match self.selcx.infcx().handle_opaque_type(
- a,
- b,
- &obligation.cause,
- obligation.param_env,
- ) {
- Ok(value) => ProcessResult::Changed(mk_pending(value.obligations)),
- Err(err) => ProcessResult::Error(FulfillmentErrorCode::CodeSubtypeError(
- ExpectedFound::new(true, a, b),
- err,
- )),
- }
- }
},
}
}