about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-09-15 10:45:32 +0200
committerRalf Jung <post@ralfj.de>2023-09-15 10:45:37 +0200
commit3ee65c28e92c678bfd99c76f4090a36974093974 (patch)
tree64665cf57a528bd6f961a6b9e9d9c7c131c074f1 /compiler/rustc_codegen_llvm/src
parent29a4b7b9710a8abc587bbbf6ee1aba4a37af4f17 (diff)
downloadrust-3ee65c28e92c678bfd99c76f4090a36974093974.tar.gz
rust-3ee65c28e92c678bfd99c76f4090a36974093974.zip
cannot have Direct for unsized types
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/abi.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs
index 65d4d5120d0..9e834b83df4 100644
--- a/compiler/rustc_codegen_llvm/src/abi.rs
+++ b/compiler/rustc_codegen_llvm/src/abi.rs
@@ -351,6 +351,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
                     // guarnateeing that we generate ABI-compatible LLVM IR. Things get tricky for
                     // aggregates...
                     if matches!(arg.layout.abi, abi::Abi::Aggregate { .. }) {
+                        assert!(
+                            arg.layout.is_sized(),
+                            "`PassMode::Direct` for unsized type: {}",
+                            arg.layout.ty
+                        );
                         // This really shouldn't happen, since `immediate_llvm_type` will use
                         // `layout.fields` to turn this Rust type into an LLVM type. This means all
                         // sorts of Rust type details leak into the ABI. However wasm sadly *does*