Skip to content

Commit 496b073

Browse files
committed
Sync from rust 9a1d156
2 parents cda9145 + 9acb9fa commit 496b073

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/abi/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ pub(crate) fn conv_to_call_conv(sess: &Session, c: Conv, default_call_conv: Call
6565
sess.dcx().fatal("C-cmse-nonsecure-entry call conv is not yet implemented");
6666
}
6767

68-
Conv::Msp430Intr | Conv::PtxKernel | Conv::AvrInterrupt | Conv::AvrNonBlockingInterrupt => {
68+
Conv::Msp430Intr
69+
| Conv::PtxKernel
70+
| Conv::GpuKernel
71+
| Conv::AvrInterrupt
72+
| Conv::AvrNonBlockingInterrupt => {
6973
unreachable!("tried to use {c:?} call conv which only exists on an unsupported target");
7074
}
7175
}

src/base.rs

+6
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,12 @@ fn codegen_stmt<'tcx>(
828828
fx.bcx.ins().nop();
829829
}
830830
}
831+
Rvalue::Len(place) => {
832+
let place = codegen_place(fx, place);
833+
let usize_layout = fx.layout_of(fx.tcx.types.usize);
834+
let len = codegen_array_len(fx, place);
835+
lval.write_cvalue(fx, CValue::by_val(len, usize_layout));
836+
}
831837
Rvalue::ShallowInitBox(ref operand, content_ty) => {
832838
let content_ty = fx.monomorphize(content_ty);
833839
let box_layout = fx.layout_of(Ty::new_box(fx.tcx, content_ty));

0 commit comments

Comments
 (0)