Add common base class for opaque Rust types
diff --git a/gen/src/write.rs b/gen/src/write.rs
index a12af31..66d6351 100644
--- a/gen/src/write.rs
+++ b/gen/src/write.rs
@@ -232,13 +232,8 @@
for line in ety.doc.to_string().lines() {
writeln!(out, "//{}", line);
}
- writeln!(out, "struct {} final {{", ety.name.cxx);
- writeln!(out, " {}() = delete;", ety.name.cxx);
- writeln!(
- out,
- " {}(const {} &) = delete;",
- ety.name.cxx, ety.name.cxx,
- );
+ out.builtin.opaque = true;
+ writeln!(out, "struct {} final : public ::rust::Opaque {{", ety.name.cxx);
for method in methods {
write!(out, " ");
let sig = &method.sig;