Skip to content

Commit 3ee65c2

Browse files
committed
cannot have Direct for unsized types
1 parent 29a4b7b commit 3ee65c2

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_codegen_llvm/src

1 file changed

+5
-0
lines changed

compiler/rustc_codegen_llvm/src/abi.rs

+5
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
351351
// guarnateeing that we generate ABI-compatible LLVM IR. Things get tricky for
352352
// aggregates...
353353
if matches!(arg.layout.abi, abi::Abi::Aggregate { .. }) {
354+
assert!(
355+
arg.layout.is_sized(),
356+
"`PassMode::Direct` for unsized type: {}",
357+
arg.layout.ty
358+
);
354359
// This really shouldn't happen, since `immediate_llvm_type` will use
355360
// `layout.fields` to turn this Rust type into an LLVM type. This means all
356361
// sorts of Rust type details leak into the ABI. However wasm sadly *does*

0 commit comments

Comments
 (0)