@@ -950,6 +950,9 @@ fn write_rust_function_shim_impl(
950
950
// We've already defined this inside the struct.
951
951
return ;
952
952
}
953
+ if !out. header {
954
+ begin_function_definition ( out) ;
955
+ }
953
956
write_rust_function_shim_decl ( out, local_name, sig, indirect_call) ;
954
957
if out. header {
955
958
writeln ! ( out, ";" ) ;
@@ -1487,6 +1490,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Pair) {
1487
1490
let instance = ident. to_symbol ( ) ;
1488
1491
1489
1492
writeln ! ( out, "template <>" ) ;
1493
+ begin_function_definition ( out) ;
1490
1494
writeln ! (
1491
1495
out,
1492
1496
"{} *Box<{}>::allocation::alloc() noexcept {{" ,
@@ -1496,6 +1500,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Pair) {
1496
1500
writeln ! ( out, "}}" ) ;
1497
1501
1498
1502
writeln ! ( out, "template <>" ) ;
1503
+ begin_function_definition ( out) ;
1499
1504
writeln ! (
1500
1505
out,
1501
1506
"void Box<{}>::allocation::dealloc({} *ptr) noexcept {{" ,
@@ -1505,6 +1510,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Pair) {
1505
1510
writeln ! ( out, "}}" ) ;
1506
1511
1507
1512
writeln ! ( out, "template <>" ) ;
1513
+ begin_function_definition ( out) ;
1508
1514
writeln ! ( out, "void Box<{}>::drop() noexcept {{" , inner) ;
1509
1515
writeln ! ( out, " cxxbridge1$box${}$drop(this);" , instance) ;
1510
1516
writeln ! ( out, "}}" ) ;
@@ -1517,16 +1523,19 @@ fn write_rust_vec_impl(out: &mut OutFile, element: &RustName) {
1517
1523
out. include . cstddef = true ;
1518
1524
1519
1525
writeln ! ( out, "template <>" ) ;
1526
+ begin_function_definition ( out) ;
1520
1527
writeln ! ( out, "Vec<{}>::Vec() noexcept {{" , inner) ;
1521
1528
writeln ! ( out, " cxxbridge1$rust_vec${}$new(this);" , instance) ;
1522
1529
writeln ! ( out, "}}" ) ;
1523
1530
1524
1531
writeln ! ( out, "template <>" ) ;
1532
+ begin_function_definition ( out) ;
1525
1533
writeln ! ( out, "void Vec<{}>::drop() noexcept {{" , inner) ;
1526
1534
writeln ! ( out, " return cxxbridge1$rust_vec${}$drop(this);" , instance) ;
1527
1535
writeln ! ( out, "}}" ) ;
1528
1536
1529
1537
writeln ! ( out, "template <>" ) ;
1538
+ begin_function_definition ( out) ;
1530
1539
writeln ! (
1531
1540
out,
1532
1541
"::std::size_t Vec<{}>::size() const noexcept {{" ,
@@ -1536,6 +1545,7 @@ fn write_rust_vec_impl(out: &mut OutFile, element: &RustName) {
1536
1545
writeln ! ( out, "}}" ) ;
1537
1546
1538
1547
writeln ! ( out, "template <>" ) ;
1548
+ begin_function_definition ( out) ;
1539
1549
writeln ! (
1540
1550
out,
1541
1551
"::std::size_t Vec<{}>::capacity() const noexcept {{" ,
@@ -1549,11 +1559,13 @@ fn write_rust_vec_impl(out: &mut OutFile, element: &RustName) {
1549
1559
writeln ! ( out, "}}" ) ;
1550
1560
1551
1561
writeln ! ( out, "template <>" ) ;
1562
+ begin_function_definition ( out) ;
1552
1563
writeln ! ( out, "const {} *Vec<{0}>::data() const noexcept {{" , inner) ;
1553
1564
writeln ! ( out, " return cxxbridge1$rust_vec${}$data(this);" , instance) ;
1554
1565
writeln ! ( out, "}}" ) ;
1555
1566
1556
1567
writeln ! ( out, "template <>" ) ;
1568
+ begin_function_definition ( out) ;
1557
1569
writeln ! (
1558
1570
out,
1559
1571
"void Vec<{}>::reserve_total(::std::size_t cap) noexcept {{" ,
@@ -1567,6 +1579,7 @@ fn write_rust_vec_impl(out: &mut OutFile, element: &RustName) {
1567
1579
writeln ! ( out, "}}" ) ;
1568
1580
1569
1581
writeln ! ( out, "template <>" ) ;
1582
+ begin_function_definition ( out) ;
1570
1583
writeln ! (
1571
1584
out,
1572
1585
"void Vec<{}>::set_len(::std::size_t len) noexcept {{" ,
0 commit comments