OriginalQueryValues,
};
use crate::infer::InferCtxt;
-use crate::mir::interpret::ConstValue;
use std::sync::atomic::Ordering;
use crate::ty::fold::{TypeFoldable, TypeFolder};
use crate::ty::subst::GenericArg;
match *r {
ty::ReLateBound(index, ..) => {
if index >= self.binder_index {
- bug!("escaping late bound region during canonicalization")
+ bug!("escaping late-bound region during canonicalization");
} else {
r
}
.canonicalize_free_region(self, r),
ty::ReClosureBound(..) => {
- bug!("closure bound region encountered during canonicalization")
+ bug!("closure bound region encountered during canonicalization");
}
}
}
ty::Infer(ty::TyVar(vid)) => {
debug!("canonical: type var found with vid {:?}", vid);
match self.infcx.unwrap().probe_ty_var(vid) {
- // `t` could be a float / int variable: canonicalize that instead
+ // `t` could be a float / int variable; canonicalize that instead.
Ok(t) => {
debug!("(resolved to {:?})", t);
self.fold_ty(t)
}
// `TyVar(vid)` is unresolved, track its universe index in the canonicalized
- // result
+ // result.
Err(mut ui) => {
if !self.infcx.unwrap().tcx.sess.opts.debugging_opts.chalk {
// FIXME: perf problem described in #55921.
fn fold_const(&mut self, ct: &'tcx ty::Const<'tcx>) -> &'tcx ty::Const<'tcx> {
match ct.val {
- ConstValue::Infer(InferConst::Var(vid)) => {
+ ty::ConstKind::Infer(InferConst::Var(vid)) => {
debug!("canonical: const var found with vid {:?}", vid);
match self.infcx.unwrap().probe_const_var(vid) {
Ok(c) => {
}
}
}
- ConstValue::Infer(InferConst::Fresh(_)) => {
+ ty::ConstKind::Infer(InferConst::Fresh(_)) => {
bug!("encountered a fresh const during canonicalization")
}
- ConstValue::Bound(debruijn, _) => {
+ ty::ConstKind::Bound(debruijn, _) => {
if debruijn >= self.binder_index {
bug!("escaping bound type during canonicalization")
} else {
return ct;
}
}
- ConstValue::Placeholder(placeholder) => {
+ ty::ConstKind::Placeholder(placeholder) => {
return self.canonicalize_const_var(
CanonicalVarInfo {
kind: CanonicalVarKind::PlaceholderConst(placeholder),
let var = self.canonical_var(info, const_var.into());
self.tcx().mk_const(
ty::Const {
- val: ConstValue::Bound(self.binder_index, var.into()),
+ val: ty::ConstKind::Bound(self.binder_index, var.into()),
ty: self.fold_ty(const_var.ty),
}
)