Skip to content

Commit 028c83c

Browse files
committed
Rename in librustc_typecheck.
1 parent ff6b7cd commit 028c83c

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use rustc::ty::{self, DefIdTree, Ty, TyCtxt, Const, ToPredicate, TypeFoldable};
1818
use rustc::ty::{GenericParamDef, GenericParamDefKind};
1919
use rustc::ty::subst::{self, Subst, InternalSubsts, SubstsRef};
2020
use rustc::ty::wf::object_region_bounds;
21-
use rustc::mir::interpret::ConstValue;
2221
use rustc_target::spec::abi;
2322
use crate::require_c_abi_if_c_variadic;
2423
use smallvec::SmallVec;
@@ -2226,7 +2225,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
22262225
let def_id = tcx.hir().local_def_id(ast_const.hir_id);
22272226

22282227
let mut const_ = ty::Const {
2229-
val: ConstValue::Unevaluated(
2228+
val: ty::ConstKind::Unevaluated(
22302229
def_id,
22312230
InternalSubsts::identity_for_item(tcx, def_id),
22322231
),
@@ -2243,7 +2242,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
22432242
let generics = tcx.generics_of(item_def_id);
22442243
let index = generics.param_def_id_to_index[&tcx.hir().local_def_id(hir_id)];
22452244
let name = tcx.hir().name(hir_id);
2246-
const_.val = ConstValue::Param(ty::ParamConst::new(index, name));
2245+
const_.val = ty::ConstKind::Param(ty::ParamConst::new(index, name));
22472246
}
22482247

22492248
tcx.mk_const(const_)

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt<'_>, id: DefId, span: Span)
16881688
};
16891689
let param_env = ty::ParamEnv::reveal_all();
16901690
if let Ok(static_) = tcx.const_eval(param_env.and(cid)) {
1691-
let alloc = if let ConstValue::ByRef { alloc, .. } = static_.val {
1691+
let alloc = if let ty::ConstKind::Value(ConstValue::ByRef { alloc, .. }) = static_.val {
16921692
alloc
16931693
} else {
16941694
bug!("Matching on non-ByRef static")

src/librustc_typeck/check/wfcheck.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use rustc::traits::{self, ObligationCauseCode};
66
use rustc::ty::{self, Ty, TyCtxt, GenericParamDefKind, TypeFoldable, ToPredicate};
77
use rustc::ty::subst::{Subst, InternalSubsts};
88
use rustc::util::nodemap::{FxHashSet, FxHashMap};
9-
use rustc::mir::interpret::ConstValue;
109
use rustc::middle::lang_items;
1110
use rustc::infer::opaque_types::may_define_opaque_type;
1211

@@ -536,7 +535,7 @@ fn check_where_clauses<'tcx, 'fcx>(
536535
}
537536

538537
fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool {
539-
if let ConstValue::Param(param) = c.val {
538+
if let ty::ConstKind::Param(param) = c.val {
540539
self.params.insert(param.index);
541540
}
542541
c.super_visit_with(self)
@@ -705,7 +704,7 @@ fn check_opaque_types<'fcx, 'tcx>(
705704
}
706705

707706
ty::subst::GenericArgKind::Const(ct) => match ct.val {
708-
ConstValue::Param(_) => {}
707+
ty::ConstKind::Param(_) => {}
709708
_ => {
710709
tcx.sess
711710
.struct_span_err(

src/librustc_typeck/constrained_generic_params.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use rustc::ty::{self, Ty, TyCtxt};
22
use rustc::ty::fold::{TypeFoldable, TypeVisitor};
33
use rustc::util::nodemap::FxHashSet;
4-
use rustc::mir::interpret::ConstValue;
54
use syntax::source_map::Span;
65

76
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
@@ -77,7 +76,7 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
7776
}
7877

7978
fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool {
80-
if let ConstValue::Param(data) = c.val {
79+
if let ty::ConstKind::Param(data) = c.val {
8180
self.parameters.push(Parameter::from(data));
8281
}
8382
false

0 commit comments

Comments
 (0)