Allow creation of UniquePtrs to trivial aliased types.
diff --git a/gen/src/write.rs b/gen/src/write.rs
index 5d47c63..3cd94d1 100644
--- a/gen/src/write.rs
+++ b/gen/src/write.rs
@@ -1245,7 +1245,12 @@
let instance = to_mangled(&out.namespace, ty);
let can_construct_from_value = match ty {
- Type::Ident(ident) => types.structs.contains_key(ident),
+ // Some aliases are to opaque types; some are to trivial types.
+ // We can't know at code generation time, so we generate both C++
+ // and Rust side bindings for a "new" method anyway. But that
+ // Rust code will explode at runtime if anyone tries to call it on
+ // an opaque type.
+ Type::Ident(ident) => types.structs.contains_key(ident) || types.aliases.contains_key(ident),
_ => false,
};