Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit bd7c119

Browse files
committed
Rustup to rustc 1.38.0-nightly (6a91782 2019-08-06)
1 parent 7602a46 commit bd7c119

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/base.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@ fn codegen_array_len<'a, 'tcx: 'a>(
612612
) -> Value {
613613
match place.layout().ty.sty {
614614
ty::Array(_elem_ty, len) => {
615-
let len = crate::constant::force_eval_const(fx, len).unwrap_usize(fx.tcx) as i64;
615+
let len = crate::constant::force_eval_const(fx, len)
616+
.eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64;
616617
fx.bcx.ins().iconst(fx.pointer_type, len)
617618
}
618619
ty::Slice(_elem_ty) => place
@@ -1162,7 +1163,8 @@ pub fn trans_place_projection<'a, 'tcx: 'a>(
11621163
ty::Array(elem_ty, len) => {
11631164
let elem_layout = fx.layout_of(elem_ty);
11641165
let ptr = base.to_addr(fx);
1165-
let len = crate::constant::force_eval_const(fx, len).unwrap_usize(fx.tcx);
1166+
let len = crate::constant::force_eval_const(fx, len)
1167+
.eval_usize(fx.tcx, ParamEnv::reveal_all());
11661168
CPlace::for_addr(
11671169
fx.bcx.ins().iadd_imm(ptr, elem_layout.size.bytes() as i64 * from as i64),
11681170
fx.layout_of(fx.tcx.mk_array(elem_ty, len - from as u64 - to as u64)),

src/constant.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ fn define_all_allocs(
264264
let const_ = tcx.const_eval(ParamEnv::reveal_all().and(cid)).unwrap();
265265

266266
let alloc = match const_.val {
267-
ConstValue::ByRef { align: _, offset, alloc } if offset.bytes() == 0 => alloc,
267+
ConstValue::ByRef { alloc, offset } if offset.bytes() == 0 => alloc,
268268
_ => bug!("static const eval returned {:#?}", const_),
269269
};
270270

@@ -342,6 +342,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
342342
type FrameExtra = ();
343343
type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation<()>)>;
344344

345+
const CHECK_ALIGN: bool = true;
345346
const STATIC_KIND: Option<!> = None;
346347

347348
fn enforce_validity(_: &InterpCx<'mir, 'tcx, Self>) -> bool {

src/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ pub fn codegen_intrinsic_call<'a, 'tcx: 'a>(
920920
let idx_const = crate::constant::mir_operand_get_const_val(fx, idx).expect("simd_shuffle* idx not const");
921921

922922
let idx_bytes = match idx_const.val {
923-
ConstValue::ByRef { align: _, offset, alloc } => {
923+
ConstValue::ByRef { alloc, offset } => {
924924
let ptr = Pointer::new(AllocId(0 /* dummy */), offset);
925925
let size = Size::from_bytes(4 * u64::from(ret_lane_count) /* size_of([u32; ret_lane_count]) */);
926926
alloc.get_bytes(fx, ptr, size).unwrap()

src/unsize.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ pub fn unsized_info<'a, 'tcx: 'a>(
2020
(&ty::Array(_, len), &ty::Slice(_)) => fx
2121
.bcx
2222
.ins()
23-
.iconst(fx.pointer_type, len.unwrap_usize(fx.tcx) as i64),
23+
.iconst(
24+
fx.pointer_type,
25+
len.eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64,
26+
),
2427
(&ty::Dynamic(..), &ty::Dynamic(..)) => {
2528
// For now, upcasts are limited to changes in marker
2629
// traits, and hence never actually require an actual

0 commit comments

Comments
 (0)