diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/astconv.rs | 5 | ||||
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_typeck/check/wfcheck.rs | 5 | ||||
| -rw-r--r-- | src/librustc_typeck/constrained_generic_params.rs | 3 |
4 files changed, 6 insertions, 9 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 5c661513382..ee3ebd691e4 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -18,7 +18,6 @@ use rustc::ty::{self, DefIdTree, Ty, TyCtxt, Const, ToPredicate, TypeFoldable}; use rustc::ty::{GenericParamDef, GenericParamDefKind}; use rustc::ty::subst::{self, Subst, InternalSubsts, SubstsRef}; use rustc::ty::wf::object_region_bounds; -use rustc::mir::interpret::ConstValue; use rustc_target::spec::abi; use crate::require_c_abi_if_c_variadic; use smallvec::SmallVec; @@ -2226,7 +2225,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { let def_id = tcx.hir().local_def_id(ast_const.hir_id); let mut const_ = ty::Const { - val: ConstValue::Unevaluated( + val: ty::ConstKind::Unevaluated( def_id, InternalSubsts::identity_for_item(tcx, def_id), ), @@ -2243,7 +2242,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { let generics = tcx.generics_of(item_def_id); let index = generics.param_def_id_to_index[&tcx.hir().local_def_id(hir_id)]; let name = tcx.hir().name(hir_id); - const_.val = ConstValue::Param(ty::ParamConst::new(index, name)); + const_.val = ty::ConstKind::Param(ty::ParamConst::new(index, name)); } tcx.mk_const(const_) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 72b5018589c..2363dbc5303 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1688,7 +1688,7 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt<'_>, id: DefId, span: Span) }; let param_env = ty::ParamEnv::reveal_all(); if let Ok(static_) = tcx.const_eval(param_env.and(cid)) { - let alloc = if let ConstValue::ByRef { alloc, .. } = static_.val { + let alloc = if let ty::ConstKind::Value(ConstValue::ByRef { alloc, .. }) = static_.val { alloc } else { bug!("Matching on non-ByRef static") diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 5b25d8f25a9..fd97493b591 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -6,7 +6,6 @@ use rustc::traits::{self, ObligationCauseCode}; use rustc::ty::{self, Ty, TyCtxt, GenericParamDefKind, TypeFoldable, ToPredicate}; use rustc::ty::subst::{Subst, InternalSubsts}; use rustc::util::nodemap::{FxHashSet, FxHashMap}; -use rustc::mir::interpret::ConstValue; use rustc::middle::lang_items; use rustc::infer::opaque_types::may_define_opaque_type; @@ -536,7 +535,7 @@ fn check_where_clauses<'tcx, 'fcx>( } fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool { - if let ConstValue::Param(param) = c.val { + if let ty::ConstKind::Param(param) = c.val { self.params.insert(param.index); } c.super_visit_with(self) @@ -705,7 +704,7 @@ fn check_opaque_types<'fcx, 'tcx>( } ty::subst::GenericArgKind::Const(ct) => match ct.val { - ConstValue::Param(_) => {} + ty::ConstKind::Param(_) => {} _ => { tcx.sess .struct_span_err( diff --git a/src/librustc_typeck/constrained_generic_params.rs b/src/librustc_typeck/constrained_generic_params.rs index 1fdf49fde55..0523de56512 100644 --- a/src/librustc_typeck/constrained_generic_params.rs +++ b/src/librustc_typeck/constrained_generic_params.rs @@ -1,7 +1,6 @@ use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::fold::{TypeFoldable, TypeVisitor}; use rustc::util::nodemap::FxHashSet; -use rustc::mir::interpret::ConstValue; use syntax::source_map::Span; #[derive(Clone, PartialEq, Eq, Hash, Debug)] @@ -77,7 +76,7 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector { } fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool { - if let ConstValue::Param(data) = c.val { + if let ty::ConstKind::Param(data) = c.val { self.parameters.push(Parameter::from(data)); } false |
