Rename in librustc_codegen_ssa.

This commit is contained in:
Camille GILLOT 2019-11-08 23:12:26 +01:00
parent c67125260b
commit 25fab7ecf5
3 changed files with 8 additions and 8 deletions

View file

@ -14,7 +14,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
constant: &mir::Constant<'tcx>,
) -> Result<&'tcx ty::Const<'tcx>, ErrorHandled> {
match constant.literal.val {
mir::interpret::ConstValue::Unevaluated(def_id, ref substs) => {
ty::ConstKind::Unevaluated(def_id, ref substs) => {
let substs = self.monomorphize(substs);
let instance = ty::Instance::resolve(
self.cx.tcx(), ty::ParamEnv::reveal_all(), def_id, substs,

View file

@ -75,12 +75,12 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
return OperandRef::new_zst(bx, layout);
}
let val = match val.val {
ConstValue::Unevaluated(..) => bug!("unevaluated constant in `OperandRef::from_const`"),
ConstValue::Param(_) => bug!("encountered a ConstValue::Param in codegen"),
ConstValue::Infer(_) => bug!("encountered a ConstValue::Infer in codegen"),
ConstValue::Bound(..) => bug!("encountered a ConstValue::Bound in codegen"),
ConstValue::Placeholder(_) => bug!("encountered a ConstValue::Placeholder in codegen"),
let val_val = match val.val {
ty::ConstKind::Value(val_val) => val_val,
_ => bug!("encountered bad ConstKind in codegen"),
};
let val = match val_val {
ConstValue::Scalar(x) => {
let scalar = match layout.abi {
layout::Abi::Scalar(ref x) => x,

View file

@ -480,7 +480,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let layout = cx.layout_of(self.monomorphize(&ty));
match bx.tcx().const_eval(param_env.and(cid)) {
Ok(val) => match val.val {
mir::interpret::ConstValue::ByRef { alloc, offset } => {
ty::ConstKind::Value(mir::interpret::ConstValue::ByRef { alloc, offset }) => {
bx.cx().from_const_alloc(layout, alloc, offset)
}
_ => bug!("promoteds should have an allocation: {:?}", val),