diff options
Diffstat (limited to 'compiler/rustc_infer/src')
| -rw-r--r-- | compiler/rustc_infer/src/infer/canonical/canonicalizer.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/canonical/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/canonical/query_response.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/combine.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/freshen.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/fudge.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/higher_ranked/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/nll_relate/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/resolve.rs | 2 |
11 files changed, 20 insertions, 20 deletions
diff --git a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs index 07682577197..9c30c81123b 100644 --- a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs +++ b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs @@ -476,7 +476,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> { } fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { - match ct.val() { + match ct.kind() { ty::ConstKind::Infer(InferConst::Var(vid)) => { debug!("canonical: const var found with vid {:?}", vid); match self.infcx.probe_const_var(vid) { @@ -778,7 +778,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> { } else { let var = self.canonical_var(info, const_var.into()); self.tcx().mk_const(ty::ConstS { - val: ty::ConstKind::Bound(self.binder_index, var), + kind: ty::ConstKind::Bound(self.binder_index, var), ty: self.fold_ty(const_var.ty()), }) } diff --git a/compiler/rustc_infer/src/infer/canonical/mod.rs b/compiler/rustc_infer/src/infer/canonical/mod.rs index c7fa2527eb2..f251d561c60 100644 --- a/compiler/rustc_infer/src/infer/canonical/mod.rs +++ b/compiler/rustc_infer/src/infer/canonical/mod.rs @@ -149,7 +149,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> { let placeholder_mapped = ty::PlaceholderConst { universe: universe_mapped, name }; self.tcx .mk_const(ty::ConstS { - val: ty::ConstKind::Placeholder(placeholder_mapped), + kind: ty::ConstKind::Placeholder(placeholder_mapped), ty: name.ty, }) .into() diff --git a/compiler/rustc_infer/src/infer/canonical/query_response.rs b/compiler/rustc_infer/src/infer/canonical/query_response.rs index ec468f42852..8938ed78a94 100644 --- a/compiler/rustc_infer/src/infer/canonical/query_response.rs +++ b/compiler/rustc_infer/src/infer/canonical/query_response.rs @@ -458,7 +458,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> { } } GenericArgKind::Const(result_value) => { - if let ty::ConstKind::Bound(debrujin, b) = result_value.val() { + if let ty::ConstKind::Bound(debrujin, b) = result_value.kind() { // ...in which case we would set `canonical_vars[0]` to `Some(const X)`. // We only allow a `ty::INNERMOST` index in substitutions. diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index 120e57ecebd..67dcb6e708b 100644 --- a/compiler/rustc_infer/src/infer/combine.rs +++ b/compiler/rustc_infer/src/infer/combine.rs @@ -142,7 +142,7 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> { let a_is_expected = relation.a_is_expected(); - match (a.val(), b.val()) { + match (a.kind(), b.kind()) { ( ty::ConstKind::Infer(InferConst::Var(a_vid)), ty::ConstKind::Infer(InferConst::Var(b_vid)), @@ -726,7 +726,7 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> { ) -> RelateResult<'tcx, ty::Const<'tcx>> { assert_eq!(c, c2); // we are abusing TypeRelation here; both LHS and RHS ought to be == - match c.val() { + match c.kind() { ty::ConstKind::Infer(InferConst::Var(vid)) => { let mut inner = self.infcx.inner.borrow_mut(); let variable_table = &mut inner.const_unification_table(); @@ -761,7 +761,7 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> { )?; Ok(self.tcx().mk_const(ty::ConstS { ty: c.ty(), - val: ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }), + kind: ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }), })) } _ => relate::super_relate_consts(self, c, c), @@ -941,7 +941,7 @@ impl<'tcx> TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> { debug_assert_eq!(c, _c); debug!("ConstInferUnifier: c={:?}", c); - match c.val() { + match c.kind() { ty::ConstKind::Infer(InferConst::Var(vid)) => { // Check if the current unification would end up // unifying `target_vid` with a const which contains @@ -992,7 +992,7 @@ impl<'tcx> TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> { )?; Ok(self.tcx().mk_const(ty::ConstS { ty: c.ty(), - val: ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }), + kind: ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }), })) } _ => relate::super_relate_consts(self, c, c), diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs index 4c734b1589b..07f5d72fac4 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs @@ -247,7 +247,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { } } GenericArgKind::Const(ct) => { - if let ty::ConstKind::Infer(InferConst::Var(vid)) = ct.val() { + if let ty::ConstKind::Infer(InferConst::Var(vid)) = ct.kind() { let origin = self.inner.borrow_mut().const_unification_table().probe_value(vid).origin; if let ConstVariableOriginKind::ConstParameterDefinition(name, def_id) = @@ -673,7 +673,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> { } (GenericArgKind::Const(inner_ct), GenericArgKind::Const(target_ct)) => { use ty::InferConst::*; - match (inner_ct.val(), target_ct.val()) { + match (inner_ct.kind(), target_ct.kind()) { (ty::ConstKind::Infer(Var(a_vid)), ty::ConstKind::Infer(Var(b_vid))) => self .infcx .inner @@ -713,7 +713,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> { } } GenericArgKind::Const(ct) => { - if matches!(ct.val(), ty::ConstKind::Unevaluated(..)) { + if matches!(ct.kind(), ty::ConstKind::Unevaluated(..)) { // You can't write the generic arguments for // unevaluated constants. walker.skip_current_subtree(); diff --git a/compiler/rustc_infer/src/infer/freshen.rs b/compiler/rustc_infer/src/infer/freshen.rs index edafee2df57..024f7409947 100644 --- a/compiler/rustc_infer/src/infer/freshen.rs +++ b/compiler/rustc_infer/src/infer/freshen.rs @@ -218,7 +218,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> { } fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { - match ct.val() { + match ct.kind() { ty::ConstKind::Infer(ty::InferConst::Var(v)) => { let opt_ct = self .infcx diff --git a/compiler/rustc_infer/src/infer/fudge.rs b/compiler/rustc_infer/src/infer/fudge.rs index 1e6995db269..2f0eadce631 100644 --- a/compiler/rustc_infer/src/infer/fudge.rs +++ b/compiler/rustc_infer/src/infer/fudge.rs @@ -229,7 +229,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceFudger<'a, 'tcx> { } fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { - if let ty::ConstKind::Infer(ty::InferConst::Var(vid)) = ct.val() { + if let ty::ConstKind::Infer(ty::InferConst::Var(vid)) = ct.kind() { if self.const_vars.0.contains(&vid) { // This variable was created during the fudging. // Recreate it with a fresh variable here. diff --git a/compiler/rustc_infer/src/infer/higher_ranked/mod.rs b/compiler/rustc_infer/src/infer/higher_ranked/mod.rs index bb3b410b2bd..c82685d1b70 100644 --- a/compiler/rustc_infer/src/infer/higher_ranked/mod.rs +++ b/compiler/rustc_infer/src/infer/higher_ranked/mod.rs @@ -99,7 +99,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { let fld_c = |bound_var: ty::BoundVar, ty| { self.tcx.mk_const(ty::ConstS { - val: ty::ConstKind::Placeholder(ty::PlaceholderConst { + kind: ty::ConstKind::Placeholder(ty::PlaceholderConst { universe: next_universe, name: ty::BoundConst { var: bound_var, ty }, }), diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 017c7abc3aa..59c708fb750 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -1754,7 +1754,7 @@ impl<'tcx> TyOrConstInferVar<'tcx> { /// Tries to extract an inference variable from a constant, returns `None` /// for constants other than `ty::ConstKind::Infer(_)` (or `InferConst::Fresh`). pub fn maybe_from_const(ct: ty::Const<'tcx>) -> Option<Self> { - match ct.val() { + match ct.kind() { ty::ConstKind::Infer(InferConst::Var(v)) => Some(TyOrConstInferVar::Const(v)), _ => None, } @@ -1833,7 +1833,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for ShallowResolver<'a, 'tcx> { } fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { - if let ty::ConstKind::Infer(InferConst::Var(vid)) = ct.val() { + if let ty::ConstKind::Infer(InferConst::Var(vid)) = ct.kind() { self.infcx .inner .borrow_mut() diff --git a/compiler/rustc_infer/src/infer/nll_relate/mod.rs b/compiler/rustc_infer/src/infer/nll_relate/mod.rs index 9b6e5c8a347..ebe156d081d 100644 --- a/compiler/rustc_infer/src/infer/nll_relate/mod.rs +++ b/compiler/rustc_infer/src/infer/nll_relate/mod.rs @@ -659,7 +659,7 @@ where b = self.infcx.shallow_resolve(b); } - match b.val() { + match b.kind() { ty::ConstKind::Infer(InferConst::Var(_)) if D::forbid_inference_vars() => { // Forbid inference variables in the RHS. bug!("unexpected inference var {:?}", b) @@ -1034,7 +1034,7 @@ where a: ty::Const<'tcx>, _: ty::Const<'tcx>, ) -> RelateResult<'tcx, ty::Const<'tcx>> { - match a.val() { + match a.kind() { ty::ConstKind::Infer(InferConst::Var(_)) if D::forbid_inference_vars() => { bug!("unexpected inference variable encountered in NLL generalization: {:?}", a); } diff --git a/compiler/rustc_infer/src/infer/resolve.rs b/compiler/rustc_infer/src/infer/resolve.rs index ce3c7328e2d..d830000b65f 100644 --- a/compiler/rustc_infer/src/infer/resolve.rs +++ b/compiler/rustc_infer/src/infer/resolve.rs @@ -223,7 +223,7 @@ impl<'a, 'tcx> FallibleTypeFolder<'tcx> for FullTypeResolver<'a, 'tcx> { Ok(c) // micro-optimize -- if there is nothing in this const that this fold affects... } else { let c = self.infcx.shallow_resolve(c); - match c.val() { + match c.kind() { ty::ConstKind::Infer(InferConst::Var(vid)) => { return Err(FixupError::UnresolvedConst(vid)); } |
