Skip to content

Commit 7426cc1

Browse files
committed
Wrap the trivial type static assertions
1 parent 89e386d commit 7426cc1

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

gen/src/write.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,24 @@ fn check_enum(out: &mut OutFile, enm: &Enum) {
412412
}
413413

414414
fn check_trivial_extern_type(out: &mut OutFile, id: &Ident) {
415-
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);
416-
writeln!(out, "static_assert(std::is_trivially_destructible<{}>::value,\"type {} marked as Trivial in Rust is not trivially destructible in C++\");", id, id);
415+
writeln!(out, "static_assert(");
416+
writeln!(
417+
out,
418+
" std::is_trivially_move_constructible<{}>::value,",
419+
id,
420+
);
421+
writeln!(
422+
out,
423+
" \"type {} marked as Trivial in Rust is not trivially move constructible in C++\");",
424+
id,
425+
);
426+
writeln!(out, "static_assert(");
427+
writeln!(out, " std::is_trivially_destructible<{}>::value,", id);
428+
writeln!(
429+
out,
430+
" \"type {} marked as Trivial in Rust is not trivially destructible in C++\");",
431+
id,
432+
);
417433
}
418434

419435
fn write_exception_glue(out: &mut OutFile, apis: &[Api]) {

0 commit comments

Comments
 (0)