Rustup to rustc 1.38.0-nightly (6a91782b7
2019-08-06)
This commit is contained in:
parent
7602a46bb9
commit
bd7c119e4b
@ -612,7 +612,8 @@ fn codegen_array_len<'a, 'tcx: 'a>(
|
||||
) -> Value {
|
||||
match place.layout().ty.sty {
|
||||
ty::Array(_elem_ty, len) => {
|
||||
let len = crate::constant::force_eval_const(fx, len).unwrap_usize(fx.tcx) as i64;
|
||||
let len = crate::constant::force_eval_const(fx, len)
|
||||
.eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64;
|
||||
fx.bcx.ins().iconst(fx.pointer_type, len)
|
||||
}
|
||||
ty::Slice(_elem_ty) => place
|
||||
@ -1162,7 +1163,8 @@ pub fn trans_place_projection<'a, 'tcx: 'a>(
|
||||
ty::Array(elem_ty, len) => {
|
||||
let elem_layout = fx.layout_of(elem_ty);
|
||||
let ptr = base.to_addr(fx);
|
||||
let len = crate::constant::force_eval_const(fx, len).unwrap_usize(fx.tcx);
|
||||
let len = crate::constant::force_eval_const(fx, len)
|
||||
.eval_usize(fx.tcx, ParamEnv::reveal_all());
|
||||
CPlace::for_addr(
|
||||
fx.bcx.ins().iadd_imm(ptr, elem_layout.size.bytes() as i64 * from as i64),
|
||||
fx.layout_of(fx.tcx.mk_array(elem_ty, len - from as u64 - to as u64)),
|
||||
|
@ -264,7 +264,7 @@ fn define_all_allocs(
|
||||
let const_ = tcx.const_eval(ParamEnv::reveal_all().and(cid)).unwrap();
|
||||
|
||||
let alloc = match const_.val {
|
||||
ConstValue::ByRef { align: _, offset, alloc } if offset.bytes() == 0 => alloc,
|
||||
ConstValue::ByRef { alloc, offset } if offset.bytes() == 0 => alloc,
|
||||
_ => bug!("static const eval returned {:#?}", const_),
|
||||
};
|
||||
|
||||
@ -342,6 +342,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
|
||||
type FrameExtra = ();
|
||||
type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation<()>)>;
|
||||
|
||||
const CHECK_ALIGN: bool = true;
|
||||
const STATIC_KIND: Option<!> = None;
|
||||
|
||||
fn enforce_validity(_: &InterpCx<'mir, 'tcx, Self>) -> bool {
|
||||
|
@ -920,7 +920,7 @@ fn swap(bcx: &mut FunctionBuilder, v: Value) -> Value {
|
||||
let idx_const = crate::constant::mir_operand_get_const_val(fx, idx).expect("simd_shuffle* idx not const");
|
||||
|
||||
let idx_bytes = match idx_const.val {
|
||||
ConstValue::ByRef { align: _, offset, alloc } => {
|
||||
ConstValue::ByRef { alloc, offset } => {
|
||||
let ptr = Pointer::new(AllocId(0 /* dummy */), offset);
|
||||
let size = Size::from_bytes(4 * u64::from(ret_lane_count) /* size_of([u32; ret_lane_count]) */);
|
||||
alloc.get_bytes(fx, ptr, size).unwrap()
|
||||
|
@ -20,7 +20,10 @@ pub fn unsized_info<'a, 'tcx: 'a>(
|
||||
(&ty::Array(_, len), &ty::Slice(_)) => fx
|
||||
.bcx
|
||||
.ins()
|
||||
.iconst(fx.pointer_type, len.unwrap_usize(fx.tcx) as i64),
|
||||
.iconst(
|
||||
fx.pointer_type,
|
||||
len.eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64,
|
||||
),
|
||||
(&ty::Dynamic(..), &ty::Dynamic(..)) => {
|
||||
// For now, upcasts are limited to changes in marker
|
||||
// traits, and hence never actually require an actual
|
||||
|
Loading…
Reference in New Issue
Block a user