We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
()
1 parent b662443 commit 5bda3aaCopy full SHA for 5bda3aa
src/codegen/mod.rs
@@ -562,6 +562,12 @@ impl CodeGenerator for Type {
562
BlobTyBuilder::new(layout).build()
563
} else {
564
let inner_rust_ty = inner_item.to_rust_ty(ctx);
565
+
566
+ // We get a unit if the inner type is a template definition
567
+ // that is opaque or has non-type template parameters and
568
+ // doesn't know its layout. Its possible that we have better
569
+ // information about the layout, and in the worst case, just
570
+ // make sure we don't return a zero-sized type.
571
if inner_rust_ty == aster::AstBuilder::new().ty().unit() {
572
let layout = self.layout(ctx).unwrap_or_else(|| Layout::for_size(1));
573
0 commit comments