Nicer ICE for #67981

This commit is contained in:
Jules Bertholet 2023-04-26 19:46:10 -04:00
parent 1c42cb4ef0
commit 5b6e747f37
No known key found for this signature in database
GPG Key ID: 32034DAFC38C1BFC

View File

@ -304,7 +304,17 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bug!("spread argument isn't a tuple?!");
};
let place = PlaceRef::alloca(bx, bx.layout_of(arg_ty));
let layout = bx.layout_of(arg_ty);
// FIXME: support unsized params in "rust-call" ABI
if layout.is_unsized() {
span_bug!(
arg_decl.source_info.span,
"\"rust-call\" ABI does not support unsized params",
);
}
let place = PlaceRef::alloca(bx, layout);
for i in 0..tupled_arg_tys.len() {
let arg = &fx.fn_abi.args[idx];
idx += 1;