Wrap the trivial type static assertions
diff --git a/gen/src/write.rs b/gen/src/write.rs
index e9e2239..ddde8a9 100644
--- a/gen/src/write.rs
+++ b/gen/src/write.rs
@@ -412,8 +412,24 @@
}
fn check_trivial_extern_type(out: &mut OutFile, id: &Ident) {
- writeln!(out, "static_assert(std::is_trivially_move_constructible<{}>::value,\"type {} marked as Trivial in Rust is not trivially move constructible in C++\");", id, id);
- writeln!(out, "static_assert(std::is_trivially_destructible<{}>::value,\"type {} marked as Trivial in Rust is not trivially destructible in C++\");", id, id);
+ writeln!(out, "static_assert(");
+ writeln!(
+ out,
+ " std::is_trivially_move_constructible<{}>::value,",
+ id,
+ );
+ writeln!(
+ out,
+ " \"type {} marked as Trivial in Rust is not trivially move constructible in C++\");",
+ id,
+ );
+ writeln!(out, "static_assert(");
+ writeln!(out, " std::is_trivially_destructible<{}>::value,", id);
+ writeln!(
+ out,
+ " \"type {} marked as Trivial in Rust is not trivially destructible in C++\");",
+ id,
+ );
}
fn write_exception_glue(out: &mut OutFile, apis: &[Api]) {