Only emit a C++ thunk if there was Rust code generated for the same function. A careful observer would note that it's still possible that a function _was_ generated, but that it doesn't call the C++ thunk, however, this is meant to be captured today by the "out of band" communication channel of `can_skip_cc_thunk`. I think that, now that these can directly call each other, maybe we should retire `can_skip_cc_thunk` and instead feature this information in the return value of `generate_func`. But for now... fixed! --- The fix itself is essentially two lines of code, but the change breaks many tests, which make assertions about the generated C++ thunks. If we remove the thunks, the tests fail! Where I was able to, I tried to keep (a version) of the test by fixing the C++ header so that it would emit functions. Where I didn't know how to do this (in particular, test_implicit_template_specializations_are_sorted_by_mangled_name), I deleted the broken assertions. (They did not seem critical to me, and the tests still otherwise are working and testing things.) PiperOrigin-RevId: 463097005
diff --git a/rs_bindings_from_cc/src_code_gen.rs b/rs_bindings_from_cc/src_code_gen.rs index c2a2293..2aec6f1 100644 --- a/rs_bindings_from_cc/src_code_gen.rs +++ b/rs_bindings_from_cc/src_code_gen.rs
@@ -2185,8 +2185,8 @@ lifetime = quote! {#reference_lifetime}; } RsTypeKind::Record { .. } => { - // This case doesn't happen for methods, but is needed for free functions mapped to - // a trait impl that take the first argument by value. + // This case doesn't happen for methods, but is needed for free functions mapped + // to a trait impl that take the first argument by value. return Ok(quote! { self }); } _ => bail!("Unexpected type of `self` parameter: {:?}", self), @@ -2751,6 +2751,10 @@ if can_skip_cc_thunk(db, func) { continue; } + if db.generate_func(func.clone()).unwrap_or_default().is_none() { + // No function was generated that will call this thunk. + continue; + } let thunk_ident = thunk_ident(func); let implementation_function = match &func.name { @@ -3218,21 +3222,25 @@ #[test] fn test_simple_struct() -> Result<()> { - let ir = ir_from_cc(&tokens_to_string(quote! { + let ir = ir_from_cc( + r#" + #pragma clang lifetime_elision struct SomeStruct final { + ~SomeStruct() {} int public_int; protected: int protected_int; private: int private_int; }; - })?)?; + "#, + )?; let BindingsTokens { rs_api, rs_api_impl } = generate_bindings_tokens(ir)?; assert_rs_matches!( rs_api, quote! { - #[derive(Clone, Copy)] + #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(4))] pub struct SomeStruct { __non_field_data: [::std::mem::MaybeUninit<u8>; 0], @@ -3250,9 +3258,8 @@ const _: () = assert!(::std::mem::size_of::<Option<&i32>>() == ::std::mem::size_of::<&i32>()); const _: () = assert!(::std::mem::size_of::<crate::SomeStruct>() == 12); const _: () = assert!(::std::mem::align_of::<crate::SomeStruct>() == 4); - const _: () = { static_assertions::assert_impl_all!(crate::SomeStruct: Clone); }; - const _: () = { static_assertions::assert_impl_all!(crate::SomeStruct: Copy); }; - const _: () = { static_assertions::assert_not_impl_any!(crate::SomeStruct: Drop); }; + const _: () = { static_assertions::assert_not_impl_any!(crate::SomeStruct: Copy); }; + const _: () = { static_assertions::assert_impl_all!(crate::SomeStruct: Drop); }; const _: () = assert!(memoffset_unstable_const::offset_of!(crate::SomeStruct, public_int) == 0); const _: () = assert!(memoffset_unstable_const::offset_of!(crate::SomeStruct, protected_int) == 4); const _: () = assert!(memoffset_unstable_const::offset_of!(crate::SomeStruct, private_int) == 8); @@ -3279,10 +3286,20 @@ #[test] fn test_struct_vs_class() -> Result<()> { - let ir = ir_from_cc(&tokens_to_string(quote! { - struct SomeStruct final { int field; }; - class SomeClass final { int field; }; - })?)?; + let ir = ir_from_cc( + r#" + #pragma clang lifetime_elision + struct SomeStruct final { + SomeStruct() {} + int field; + }; + class SomeClass final { + public: + SomeClass() {} + int field; + }; + "#, + )?; let BindingsTokens { rs_api, rs_api_impl } = generate_bindings_tokens(ir)?; // A Rust `struct` is generated for both `SomeStruct` and `SomeClass`. @@ -4475,6 +4492,7 @@ fn test_basic_union() -> Result<()> { let ir = ir_from_cc( r#" + #pragma clang lifetime_elision union SomeUnion { int some_field; long long some_bigger_field; @@ -4500,19 +4518,6 @@ extern "C" void __rust_thunk___ZN9SomeUnionC1Ev(union SomeUnion*__this) {...} } ); - assert_cc_matches!( - rs_api_impl, - quote! { - extern "C" void __rust_thunk___ZN9SomeUnionD1Ev(union SomeUnion*__this) {...} - } - ); - assert_cc_matches!( - rs_api_impl, - quote! { - extern "C" union SomeUnion* __rust_thunk___ZN9SomeUnionaSERKS_( - union SomeUnion*__this, const union SomeUnion* __param_0) { ... } - } - ); assert_cc_matches!(rs_api_impl, quote! { static_assert(sizeof(union SomeUnion)==8) }); assert_cc_matches!(rs_api_impl, quote! { static_assert(alignof(union SomeUnion)==8) }); assert_cc_matches!( @@ -5077,9 +5082,7 @@ assert_rs_not_matches!(rs_api, quote! {impl Drop}); assert_rs_not_matches!(rs_api, quote! {impl ::ctor::PinnedDrop}); assert_rs_matches!(rs_api, quote! {pub x: i32}); - // TODO(b/213326125): Avoid generating thunk impls that are never called. - // (The test assertion below should be reversed once this bug is fixed.) - assert_cc_matches!(rs_api_impl, quote! { std::destroy_at }); + assert_cc_not_matches!(rs_api_impl, quote! { std::destroy_at }); Ok(()) } @@ -6404,9 +6407,6 @@ test_namespace_bindings::f(); } ... - extern "C" void __rust_thunk___ZN23test_namespace_bindings1SC1Ev( - struct test_namespace_bindings::S* __this) {...} - ... extern "C" void __rust_thunk___Z4useSN23test_namespace_bindings1SE( struct test_namespace_bindings::S s) { useS(s); } ... @@ -6497,14 +6497,6 @@ } ); - // Constructors in mangled name order - let my_struct_bool_constructor = - make_rs_ident("__rust_thunk___ZN8MyStructIbEC1Ev__2f_2ftest_3atesting_5ftarget"); - let my_struct_double_constructor = - make_rs_ident("__rust_thunk___ZN8MyStructIdEC1Ev__2f_2ftest_3atesting_5ftarget"); - let my_struct_int_constructor = - make_rs_ident("__rust_thunk___ZN8MyStructIiEC1Ev__2f_2ftest_3atesting_5ftarget"); - // User defined methods in mangled name order let my_struct_bool_method = make_rs_ident("__rust_thunk___ZN8MyStructIbE4getTEv__2f_2ftest_3atesting_5ftarget"); @@ -6517,9 +6509,6 @@ &bindings.rs_api_impl, quote! { ... - extern "C" void #my_struct_bool_constructor(struct MyStruct<bool>*__this) {...} ... - extern "C" void #my_struct_double_constructor(struct MyStruct<double>*__this) {...} ... - extern "C" void #my_struct_int_constructor(struct MyStruct<int>*__this) {...} ... extern "C" bool #my_struct_bool_method(struct MyStruct<bool>*__this) {...} ... extern "C" double #my_struct_double_method(struct MyStruct<double>*__this) {...} ... extern "C" int #my_struct_int_method(struct MyStruct<int>*__this) {...} ...
diff --git a/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc index f76e4b6..be04feb 100644 --- a/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc
@@ -23,10 +23,6 @@ struct WithBitfields* __this, struct WithBitfields* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN13WithBitfieldsD1Ev( - struct WithBitfields* __this) { - std::destroy_at(__this); -} extern "C" struct WithBitfields* __rust_thunk___ZN13WithBitfieldsaSERKS_( struct WithBitfields* __this, const struct WithBitfields* __param_0) { return &__this->operator=(*__param_0);
diff --git a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc index dec3ece..e2b6800 100644 --- a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc
@@ -24,10 +24,6 @@ struct HasCustomAlignment* __this, struct HasCustomAlignment* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN18HasCustomAlignmentD1Ev( - struct HasCustomAlignment* __this) { - std::destroy_at(__this); -} extern "C" struct HasCustomAlignment* __rust_thunk___ZN18HasCustomAlignmentaSERKS_( struct HasCustomAlignment* __this, @@ -53,10 +49,6 @@ struct HasFieldWithCustomAlignment* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN27HasFieldWithCustomAlignmentD1Ev( - struct HasFieldWithCustomAlignment* __this) { - std::destroy_at(__this); -} extern "C" struct HasFieldWithCustomAlignment* __rust_thunk___ZN27HasFieldWithCustomAlignmentaSERKS_( struct HasFieldWithCustomAlignment* __this, @@ -83,10 +75,6 @@ struct InheritsFromBaseWithCustomAlignment* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN35InheritsFromBaseWithCustomAlignmentD1Ev( - struct InheritsFromBaseWithCustomAlignment* __this) { - std::destroy_at(__this); -} extern "C" struct InheritsFromBaseWithCustomAlignment* __rust_thunk___ZN35InheritsFromBaseWithCustomAlignmentaSERKS_( struct InheritsFromBaseWithCustomAlignment* __this, @@ -113,10 +101,6 @@ struct HasCustomAlignmentWithGnuAttr* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN29HasCustomAlignmentWithGnuAttrD1Ev( - struct HasCustomAlignmentWithGnuAttr* __this) { - std::destroy_at(__this); -} extern "C" struct HasCustomAlignmentWithGnuAttr* __rust_thunk___ZN29HasCustomAlignmentWithGnuAttraSERKS_( struct HasCustomAlignmentWithGnuAttr* __this,
diff --git a/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc index 976ac6f..2c7320a 100644 --- a/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc
@@ -14,72 +14,26 @@ extern "C" void __rust_thunk___ZN3FooC1Ev(struct Foo* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN3FooC1ERKS_(struct Foo* __this, - const struct Foo* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN3FooC1EOS_(struct Foo* __this, struct Foo* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN3FooD1Ev(struct Foo* __this) { - std::destroy_at(__this); -} -extern "C" struct Foo* __rust_thunk___ZN3FooaSERKS_( - struct Foo* __this, const struct Foo* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct Foo* __rust_thunk___ZN3FooaSEOS_(struct Foo* __this, - struct Foo* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___Z3foov() { foo(); } extern "C" void __rust_thunk___ZN3BarC1Ev(struct Bar* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN3BarC1ERKS_(struct Bar* __this, - const struct Bar* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN3BarC1EOS_(struct Bar* __this, struct Bar* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN3BarD1Ev(struct Bar* __this) { - std::destroy_at(__this); -} -extern "C" struct Bar* __rust_thunk___ZN3BaraSERKS_( - struct Bar* __this, const struct Bar* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct Bar* __rust_thunk___ZN3BaraSEOS_(struct Bar* __this, - struct Bar* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN13HasNoCommentsC1Ev( struct HasNoComments* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN13HasNoCommentsC1ERKS_( - struct HasNoComments* __this, const struct HasNoComments* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN13HasNoCommentsC1EOS_( struct HasNoComments* __this, struct HasNoComments* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN13HasNoCommentsD1Ev( - struct HasNoComments* __this) { - std::destroy_at(__this); -} -extern "C" struct HasNoComments* __rust_thunk___ZN13HasNoCommentsaSERKS_( - struct HasNoComments* __this, const struct HasNoComments* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct HasNoComments* __rust_thunk___ZN13HasNoCommentsaSEOS_( - struct HasNoComments* __this, struct HasNoComments* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(struct Foo) == 8); static_assert(alignof(struct Foo) == 4);
diff --git a/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc index c99b6ad..72855b6 100644 --- a/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc
@@ -11,129 +11,42 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -extern "C" void __rust_thunk___ZN17DocCommentSlashesC1ERKS_( - struct DocCommentSlashes* __this, - const struct DocCommentSlashes* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN17DocCommentSlashesC1EOS_( struct DocCommentSlashes* __this, struct DocCommentSlashes* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN17DocCommentSlashesD1Ev( - struct DocCommentSlashes* __this) { - std::destroy_at(__this); -} -extern "C" struct DocCommentSlashes* -__rust_thunk___ZN17DocCommentSlashesaSERKS_( - struct DocCommentSlashes* __this, - const struct DocCommentSlashes* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct DocCommentSlashes* __rust_thunk___ZN17DocCommentSlashesaSEOS_( - struct DocCommentSlashes* __this, struct DocCommentSlashes* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN14DocCommentBangC1Ev( struct DocCommentBang* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN14DocCommentBangC1ERKS_( - struct DocCommentBang* __this, const struct DocCommentBang* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN14DocCommentBangC1EOS_( struct DocCommentBang* __this, struct DocCommentBang* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN14DocCommentBangD1Ev( - struct DocCommentBang* __this) { - std::destroy_at(__this); -} -extern "C" struct DocCommentBang* __rust_thunk___ZN14DocCommentBangaSERKS_( - struct DocCommentBang* __this, const struct DocCommentBang* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct DocCommentBang* __rust_thunk___ZN14DocCommentBangaSEOS_( - struct DocCommentBang* __this, struct DocCommentBang* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN24MultilineCommentTwoStarsC1Ev( struct MultilineCommentTwoStars* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN24MultilineCommentTwoStarsC1ERKS_( - struct MultilineCommentTwoStars* __this, - const struct MultilineCommentTwoStars* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN24MultilineCommentTwoStarsC1EOS_( struct MultilineCommentTwoStars* __this, struct MultilineCommentTwoStars* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN24MultilineCommentTwoStarsD1Ev( - struct MultilineCommentTwoStars* __this) { - std::destroy_at(__this); -} -extern "C" struct MultilineCommentTwoStars* -__rust_thunk___ZN24MultilineCommentTwoStarsaSERKS_( - struct MultilineCommentTwoStars* __this, - const struct MultilineCommentTwoStars* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct MultilineCommentTwoStars* -__rust_thunk___ZN24MultilineCommentTwoStarsaSEOS_( - struct MultilineCommentTwoStars* __this, - struct MultilineCommentTwoStars* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN11LineCommentC1Ev(struct LineComment* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN11LineCommentC1ERKS_( - struct LineComment* __this, const struct LineComment* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN11LineCommentC1EOS_( struct LineComment* __this, struct LineComment* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN11LineCommentD1Ev(struct LineComment* __this) { - std::destroy_at(__this); -} -extern "C" struct LineComment* __rust_thunk___ZN11LineCommentaSERKS_( - struct LineComment* __this, const struct LineComment* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct LineComment* __rust_thunk___ZN11LineCommentaSEOS_( - struct LineComment* __this, struct LineComment* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN16MultilineOneStarC1Ev( struct MultilineOneStar* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN16MultilineOneStarC1ERKS_( - struct MultilineOneStar* __this, const struct MultilineOneStar* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN16MultilineOneStarC1EOS_( struct MultilineOneStar* __this, struct MultilineOneStar* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN16MultilineOneStarD1Ev( - struct MultilineOneStar* __this) { - std::destroy_at(__this); -} -extern "C" struct MultilineOneStar* __rust_thunk___ZN16MultilineOneStaraSERKS_( - struct MultilineOneStar* __this, const struct MultilineOneStar* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct MultilineOneStar* __rust_thunk___ZN16MultilineOneStaraSEOS_( - struct MultilineOneStar* __this, struct MultilineOneStar* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" int __rust_thunk___Z3foov() { return foo(); } extern "C" void __rust_thunk___ZN10MyTemplateIiEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( @@ -141,29 +54,11 @@ crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN10MyTemplateIiEC1ERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<int>* __this, const struct MyTemplate<int>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN10MyTemplateIiEC1EOS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( struct MyTemplate<int>* __this, struct MyTemplate<int>* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void -__rust_thunk___ZN10MyTemplateIiED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<int>* __this) { - std::destroy_at(__this); -} -extern "C" struct MyTemplate<int>* -__rust_thunk___ZN10MyTemplateIiEaSERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<int>* __this, const struct MyTemplate<int>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" struct MyTemplate<int>* -__rust_thunk___ZN10MyTemplateIiEaSEOS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<int>* __this, struct MyTemplate<int>* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" int const* +extern "C" int const* __rust_thunk___ZNK10MyTemplateIiE15get_field_valueEv__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( const struct MyTemplate<int>* __this) { return &__this->get_field_value(); @@ -174,31 +69,11 @@ crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN10MyTemplateIfEC1ERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<float>* __this, - const struct MyTemplate<float>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN10MyTemplateIfEC1EOS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( struct MyTemplate<float>* __this, struct MyTemplate<float>* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void -__rust_thunk___ZN10MyTemplateIfED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<float>* __this) { - std::destroy_at(__this); -} -extern "C" struct MyTemplate<float>* -__rust_thunk___ZN10MyTemplateIfEaSERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<float>* __this, - const struct MyTemplate<float>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" struct MyTemplate<float>* -__rust_thunk___ZN10MyTemplateIfEaSEOS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( - struct MyTemplate<float>* __this, struct MyTemplate<float>* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" float const* +extern "C" float const* __rust_thunk___ZNK10MyTemplateIfE15get_field_valueEv__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3adoc_5fcomment_5fcc( const struct MyTemplate<float>* __this) { return &__this->get_field_value();
diff --git a/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc index 558f75e..7c78ef7 100644 --- a/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc
@@ -14,25 +14,10 @@ extern "C" void __rust_thunk___ZN4typeC1Ev(struct type* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN4typeC1ERKS_(struct type* __this, - const struct type* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN4typeC1EOS_(struct type* __this, struct type* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN4typeD1Ev(struct type* __this) { - std::destroy_at(__this); -} -extern "C" struct type* __rust_thunk___ZN4typeaSERKS_( - struct type* __this, const struct type* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct type* __rust_thunk___ZN4typeaSEOS_(struct type* __this, - struct type* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(struct type) == 4); static_assert(alignof(struct type) == 4);
diff --git a/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc index 0a71daa..1cbb551 100644 --- a/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc
@@ -22,9 +22,6 @@ class Base0* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN5Base0D1Ev(class Base0* __this) { - std::destroy_at(__this); -} extern "C" class Base0* __rust_thunk___ZN5Base0aSERKS_( class Base0* __this, const class Base0* __param_0) { return &__this->operator=(*__param_0); @@ -44,9 +41,6 @@ class Base1* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN5Base1D1Ev(class Base1* __this) { - std::destroy_at(__this); -} extern "C" class Base1* __rust_thunk___ZN5Base1aSERKS_( class Base1* __this, const class Base1* __param_0) { return &__this->operator=(*__param_0); @@ -66,9 +60,6 @@ class Base2* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN5Base2D1Ev(class Base2* __this) { - std::destroy_at(__this); -} extern "C" class Base2* __rust_thunk___ZN5Base2aSERKS_( class Base2* __this, const class Base2* __param_0) { return &__this->operator=(*__param_0); @@ -80,25 +71,10 @@ extern "C" void __rust_thunk___ZN7DerivedC1Ev(struct Derived* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN7DerivedC1ERKS_( - struct Derived* __this, const struct Derived* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN7DerivedC1EOS_(struct Derived* __this, struct Derived* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN7DerivedD1Ev(struct Derived* __this) { - std::destroy_at(__this); -} -extern "C" struct Derived* __rust_thunk___ZN7DerivedaSERKS_( - struct Derived* __this, const struct Derived* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct Derived* __rust_thunk___ZN7DerivedaSEOS_( - struct Derived* __this, struct Derived* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN12VirtualBase1C1Ev( class VirtualBase1* __this) { crubit::construct_at(__this); @@ -111,10 +87,6 @@ class VirtualBase1* __this, class VirtualBase1* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN12VirtualBase1D1Ev( - class VirtualBase1* __this) { - std::destroy_at(__this); -} extern "C" class VirtualBase1* __rust_thunk___ZN12VirtualBase1aSERKS_( class VirtualBase1* __this, const class VirtualBase1* __param_0) { return &__this->operator=(*__param_0); @@ -135,10 +107,6 @@ class VirtualBase2* __this, class VirtualBase2* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN12VirtualBase2D1Ev( - class VirtualBase2* __this) { - std::destroy_at(__this); -} extern "C" class VirtualBase2* __rust_thunk___ZN12VirtualBase2aSERKS_( class VirtualBase2* __this, const class VirtualBase2* __param_0) { return &__this->operator=(*__param_0); @@ -159,10 +127,6 @@ class VirtualDerived* __this, class VirtualDerived* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN14VirtualDerivedD1Ev( - class VirtualDerived* __this) { - std::destroy_at(__this); -} extern "C" class VirtualDerived* __rust_thunk___ZN14VirtualDerivedaSERKS_( class VirtualDerived* __this, const class VirtualDerived* __param_0) { return &__this->operator=(*__param_0);
diff --git a/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc index a8de4df..e7d227e 100644 --- a/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc
@@ -14,50 +14,19 @@ extern "C" void __rust_thunk___ZN11FirstStructC1Ev(struct FirstStruct* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN11FirstStructC1ERKS_( - struct FirstStruct* __this, const struct FirstStruct* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN11FirstStructC1EOS_( struct FirstStruct* __this, struct FirstStruct* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN11FirstStructD1Ev(struct FirstStruct* __this) { - std::destroy_at(__this); -} -extern "C" struct FirstStruct* __rust_thunk___ZN11FirstStructaSERKS_( - struct FirstStruct* __this, const struct FirstStruct* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct FirstStruct* __rust_thunk___ZN11FirstStructaSEOS_( - struct FirstStruct* __this, struct FirstStruct* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" int __rust_thunk___Z10first_funcv() { return first_func(); } extern "C" void __rust_thunk___ZN12SecondStructC1Ev( struct SecondStruct* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN12SecondStructC1ERKS_( - struct SecondStruct* __this, const struct SecondStruct* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN12SecondStructC1EOS_( struct SecondStruct* __this, struct SecondStruct* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN12SecondStructD1Ev( - struct SecondStruct* __this) { - std::destroy_at(__this); -} -extern "C" struct SecondStruct* __rust_thunk___ZN12SecondStructaSERKS_( - struct SecondStruct* __this, const struct SecondStruct* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct SecondStruct* __rust_thunk___ZN12SecondStructaSEOS_( - struct SecondStruct* __this, struct SecondStruct* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" int __rust_thunk___Z11second_funcv() { return second_func(); } static_assert(sizeof(struct FirstStruct) == 4);
diff --git a/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc index 85ebd7a..d482916 100644 --- a/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc
@@ -15,32 +15,11 @@ struct test_namespace_bindings::S* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings1SC1ERKS0_( - struct test_namespace_bindings::S* __this, - const struct test_namespace_bindings::S* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings1SC1EOS0_( struct test_namespace_bindings::S* __this, struct test_namespace_bindings::S* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings1SD1Ev( - struct test_namespace_bindings::S* __this) { - std::destroy_at(__this); -} -extern "C" struct test_namespace_bindings::S* -__rust_thunk___ZN23test_namespace_bindings1SaSERKS0_( - struct test_namespace_bindings::S* __this, - const struct test_namespace_bindings::S* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct test_namespace_bindings::S* -__rust_thunk___ZN23test_namespace_bindings1SaSEOS0_( - struct test_namespace_bindings::S* __this, - struct test_namespace_bindings::S* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings15inline_functionEv() { test_namespace_bindings::inline_function(); @@ -50,33 +29,11 @@ crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN32test_namespace_bindings_reopened5inner1SC1ERKS1_( - struct test_namespace_bindings_reopened::inner::S* __this, - const struct test_namespace_bindings_reopened::inner::S* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SC1EOS1_( struct test_namespace_bindings_reopened::inner::S* __this, struct test_namespace_bindings_reopened::inner::S* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SD1Ev( - struct test_namespace_bindings_reopened::inner::S* __this) { - std::destroy_at(__this); -} -extern "C" struct test_namespace_bindings_reopened::inner::S* -__rust_thunk___ZN32test_namespace_bindings_reopened5inner1SaSERKS1_( - struct test_namespace_bindings_reopened::inner::S* __this, - const struct test_namespace_bindings_reopened::inner::S* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct test_namespace_bindings_reopened::inner::S* -__rust_thunk___ZN32test_namespace_bindings_reopened5inner1SaSEOS1_( - struct test_namespace_bindings_reopened::inner::S* __this, - struct test_namespace_bindings_reopened::inner::S* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1Ev( struct test_namespace_bindings_inline::inner::StructInInlineNamespace* @@ -84,14 +41,6 @@ crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1ERKS1_( - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* - __this, - const struct test_namespace_bindings_inline::inner::StructInInlineNamespace* - __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1EOS1_( struct test_namespace_bindings_inline::inner::StructInInlineNamespace* __this, @@ -99,28 +48,6 @@ __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void -__rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceD1Ev( - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* - __this) { - std::destroy_at(__this); -} -extern "C" struct test_namespace_bindings_inline::inner::StructInInlineNamespace* -__rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceaSERKS1_( - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* - __this, - const struct test_namespace_bindings_inline::inner::StructInInlineNamespace* - __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct test_namespace_bindings_inline::inner::StructInInlineNamespace* -__rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceaSEOS1_( - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* - __this, - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* - __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(struct test_namespace_bindings::S) == 4); static_assert(alignof(struct test_namespace_bindings::S) == 4);
diff --git a/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc index f2e6b68..fa8e64d 100644 --- a/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc
@@ -11,32 +11,6 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -extern "C" void __rust_thunk___ZN1SC1Ev(struct S* __this) { - crubit::construct_at(__this); -} -extern "C" void __rust_thunk___ZN1SC1ERKS_(struct S* __this, - const struct S* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN1SD1Ev(struct S* __this) { - std::destroy_at(__this); -} -extern "C" struct S* __rust_thunk___ZN1SaSERKS_(struct S* __this, - const struct S* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct TriviallyCopyableButNontriviallyDestructible* -__rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleaSERKS_( - struct TriviallyCopyableButNontriviallyDestructible* __this, - const struct TriviallyCopyableButNontriviallyDestructible* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" void -__rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleC1ERKS_( - struct TriviallyCopyableButNontriviallyDestructible* __this, - const struct TriviallyCopyableButNontriviallyDestructible* __param_0) { - crubit::construct_at(__this, *__param_0); -} static_assert(sizeof(struct S) == 1); static_assert(alignof(struct S) == 1);
diff --git a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc index d532ae0..ef6c1ef 100644 --- a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc
@@ -14,25 +14,10 @@ extern "C" void __rust_thunk___ZN6StructC1Ev(struct Struct* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN6StructC1ERKS_( - struct Struct* __this, const struct Struct* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN6StructC1EOS_(struct Struct* __this, struct Struct* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN6StructD1Ev(struct Struct* __this) { - std::destroy_at(__this); -} -extern "C" struct Struct* __rust_thunk___ZN6StructaSERKS_( - struct Struct* __this, const struct Struct* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct Struct* __rust_thunk___ZN6StructaSEOS_( - struct Struct* __this, struct Struct* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" struct Struct __rust_thunk___ZN6Struct4MakeEic(int f1, char f2) { return Struct::Make(f1, f2); } @@ -40,32 +25,11 @@ struct PaddingBetweenFields* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN20PaddingBetweenFieldsC1ERKS_( - struct PaddingBetweenFields* __this, - const struct PaddingBetweenFields* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN20PaddingBetweenFieldsC1EOS_( struct PaddingBetweenFields* __this, struct PaddingBetweenFields* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN20PaddingBetweenFieldsD1Ev( - struct PaddingBetweenFields* __this) { - std::destroy_at(__this); -} -extern "C" struct PaddingBetweenFields* -__rust_thunk___ZN20PaddingBetweenFieldsaSERKS_( - struct PaddingBetweenFields* __this, - const struct PaddingBetweenFields* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct PaddingBetweenFields* -__rust_thunk___ZN20PaddingBetweenFieldsaSEOS_( - struct PaddingBetweenFields* __this, - struct PaddingBetweenFields* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" struct PaddingBetweenFields __rust_thunk___ZN20PaddingBetweenFields4MakeEci(char f1, int f2) { return PaddingBetweenFields::Make(f1, f2);
diff --git a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc index e926bbf..0955a08 100644 --- a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc
@@ -95,20 +95,11 @@ const struct NontrivialByValue* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" void __rust_thunk___ZN17NontrivialByValueD1Ev( - struct NontrivialByValue* __this) { - std::destroy_at(__this); -} extern "C" void __rust_thunk___ZN17NontrivialByValueaSES_( struct NontrivialByValue* __return, struct NontrivialByValue* __this, struct NontrivialByValue other) { crubit::construct_at(__return, __this->operator=(other)); } -extern "C" void __rust_thunk___ZN17NontrivialByValueeqES_( - struct NontrivialByValue* __return, struct NontrivialByValue* __this, - struct NontrivialByValue other) { - crubit::construct_at(__return, __this->operator==(other)); -} static_assert(sizeof(struct Nontrivial) == 4); static_assert(alignof(struct Nontrivial) == 4);
diff --git a/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc index 12d985f..fd47d41 100644 --- a/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc
@@ -15,180 +15,57 @@ class AddableConstMember* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN18AddableConstMemberC1ERKS_( - class AddableConstMember* __this, - const class AddableConstMember* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN18AddableConstMemberC1EOS_( class AddableConstMember* __this, class AddableConstMember* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN18AddableConstMemberD1Ev( - class AddableConstMember* __this) { - std::destroy_at(__this); -} -extern "C" class AddableConstMember* -__rust_thunk___ZN18AddableConstMemberaSERKS_( - class AddableConstMember* __this, - const class AddableConstMember* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class AddableConstMember* -__rust_thunk___ZN18AddableConstMemberaSEOS_( - class AddableConstMember* __this, class AddableConstMember* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN21AddableNonConstMemberC1Ev( class AddableNonConstMember* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN21AddableNonConstMemberC1ERKS_( - class AddableNonConstMember* __this, - const class AddableNonConstMember* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN21AddableNonConstMemberC1EOS_( class AddableNonConstMember* __this, class AddableNonConstMember* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN21AddableNonConstMemberD1Ev( - class AddableNonConstMember* __this) { - std::destroy_at(__this); -} -extern "C" class AddableNonConstMember* -__rust_thunk___ZN21AddableNonConstMemberaSERKS_( - class AddableNonConstMember* __this, - const class AddableNonConstMember* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class AddableNonConstMember* -__rust_thunk___ZN21AddableNonConstMemberaSEOS_( - class AddableNonConstMember* __this, - class AddableNonConstMember* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN13AddableFriendC1Ev( class AddableFriend* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN13AddableFriendC1ERKS_( - class AddableFriend* __this, const class AddableFriend* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN13AddableFriendC1EOS_( class AddableFriend* __this, class AddableFriend* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN13AddableFriendD1Ev( - class AddableFriend* __this) { - std::destroy_at(__this); -} -extern "C" class AddableFriend* __rust_thunk___ZN13AddableFriendaSERKS_( - class AddableFriend* __this, const class AddableFriend* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class AddableFriend* __rust_thunk___ZN13AddableFriendaSEOS_( - class AddableFriend* __this, class AddableFriend* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN11AddableFreeC1Ev(class AddableFree* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN11AddableFreeC1ERKS_( - class AddableFree* __this, const class AddableFree* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN11AddableFreeC1EOS_( class AddableFree* __this, class AddableFree* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN11AddableFreeD1Ev(class AddableFree* __this) { - std::destroy_at(__this); -} -extern "C" class AddableFree* __rust_thunk___ZN11AddableFreeaSERKS_( - class AddableFree* __this, const class AddableFree* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class AddableFree* __rust_thunk___ZN11AddableFreeaSEOS_( - class AddableFree* __this, class AddableFree* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN10OverloadedC1Ev(class Overloaded* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN10OverloadedC1ERKS_( - class Overloaded* __this, const class Overloaded* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN10OverloadedC1EOS_( class Overloaded* __this, class Overloaded* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN10OverloadedD1Ev(class Overloaded* __this) { - std::destroy_at(__this); -} -extern "C" class Overloaded* __rust_thunk___ZN10OverloadedaSERKS_( - class Overloaded* __this, const class Overloaded* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class Overloaded* __rust_thunk___ZN10OverloadedaSEOS_( - class Overloaded* __this, class Overloaded* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN15IncompatibleLHSC1Ev( class IncompatibleLHS* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN15IncompatibleLHSC1ERKS_( - class IncompatibleLHS* __this, const class IncompatibleLHS* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN15IncompatibleLHSC1EOS_( class IncompatibleLHS* __this, class IncompatibleLHS* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN15IncompatibleLHSD1Ev( - class IncompatibleLHS* __this) { - std::destroy_at(__this); -} -extern "C" class IncompatibleLHS* __rust_thunk___ZN15IncompatibleLHSaSERKS_( - class IncompatibleLHS* __this, const class IncompatibleLHS* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class IncompatibleLHS* __rust_thunk___ZN15IncompatibleLHSaSEOS_( - class IncompatibleLHS* __this, class IncompatibleLHS* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN18AddableReturnsVoidC1Ev( class AddableReturnsVoid* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN18AddableReturnsVoidC1ERKS_( - class AddableReturnsVoid* __this, - const class AddableReturnsVoid* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN18AddableReturnsVoidC1EOS_( class AddableReturnsVoid* __this, class AddableReturnsVoid* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN18AddableReturnsVoidD1Ev( - class AddableReturnsVoid* __this) { - std::destroy_at(__this); -} -extern "C" class AddableReturnsVoid* -__rust_thunk___ZN18AddableReturnsVoidaSERKS_( - class AddableReturnsVoid* __this, - const class AddableReturnsVoid* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class AddableReturnsVoid* -__rust_thunk___ZN18AddableReturnsVoidaSEOS_( - class AddableReturnsVoid* __this, class AddableReturnsVoid* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN26AddableConstMemberNonunpinC1Ev( class AddableConstMemberNonunpin* __this) { crubit::construct_at(__this);
diff --git a/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc index 815f160..d096ee5 100644 --- a/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc
@@ -15,32 +15,11 @@ class test_namespace_bindings::SomeClass* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings9SomeClassC1ERKS0_( - class test_namespace_bindings::SomeClass* __this, - const class test_namespace_bindings::SomeClass* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings9SomeClassC1EOS0_( class test_namespace_bindings::SomeClass* __this, class test_namespace_bindings::SomeClass* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings9SomeClassD1Ev( - class test_namespace_bindings::SomeClass* __this) { - std::destroy_at(__this); -} -extern "C" class test_namespace_bindings::SomeClass* -__rust_thunk___ZN23test_namespace_bindings9SomeClassaSERKS0_( - class test_namespace_bindings::SomeClass* __this, - const class test_namespace_bindings::SomeClass* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class test_namespace_bindings::SomeClass* -__rust_thunk___ZN23test_namespace_bindings9SomeClassaSEOS0_( - class test_namespace_bindings::SomeClass* __this, - class test_namespace_bindings::SomeClass* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(class test_namespace_bindings::SomeClass) == 8); static_assert(alignof(class test_namespace_bindings::SomeClass) == 4);
diff --git a/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc index cb9f6a5..5c962b5 100644 --- a/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc
@@ -14,25 +14,10 @@ extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class SomeClass* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN9SomeClassC1ERKS_( - class SomeClass* __this, const class SomeClass* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN9SomeClassC1EOS_(class SomeClass* __this, class SomeClass* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN9SomeClassD1Ev(class SomeClass* __this) { - std::destroy_at(__this); -} -extern "C" class SomeClass* __rust_thunk___ZN9SomeClassaSERKS_( - class SomeClass* __this, const class SomeClass* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" class SomeClass* __rust_thunk___ZN9SomeClassaSEOS_( - class SomeClass* __this, class SomeClass* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(class SomeClass) == 4); static_assert(alignof(class SomeClass) == 4);
diff --git a/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc index eaebde1..11ec77a 100644 --- a/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc
@@ -15,26 +15,10 @@ struct DifferentScope* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN14DifferentScopeC1ERKS_( - struct DifferentScope* __this, const struct DifferentScope* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN14DifferentScopeC1EOS_( struct DifferentScope* __this, struct DifferentScope* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN14DifferentScopeD1Ev( - struct DifferentScope* __this) { - std::destroy_at(__this); -} -extern "C" struct DifferentScope* __rust_thunk___ZN14DifferentScopeaSERKS_( - struct DifferentScope* __this, const struct DifferentScope* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct DifferentScope* __rust_thunk___ZN14DifferentScopeaSEOS_( - struct DifferentScope* __this, struct DifferentScope* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings10MyTemplateI14DifferentScopeEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( class test_namespace_bindings::MyTemplate<DifferentScope>* __this) { @@ -52,27 +36,6 @@ crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN23test_namespace_bindings10MyTemplateI14DifferentScopeEC1ERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<DifferentScope>* __this, - const class test_namespace_bindings::MyTemplate<DifferentScope>* - __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN23test_namespace_bindings10MyTemplateINS_13TemplateParamEEC1ERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* __this, - const class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN23test_namespace_bindings10MyTemplateIiEC1ERKS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<int>* __this, - const class test_namespace_bindings::MyTemplate<int>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN23test_namespace_bindings10MyTemplateI14DifferentScopeEC1EOS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( class test_namespace_bindings::MyTemplate<DifferentScope>* __this, class test_namespace_bindings::MyTemplate<DifferentScope>* __param_0) { @@ -92,60 +55,7 @@ class test_namespace_bindings::MyTemplate<int>* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void -__rust_thunk___ZN23test_namespace_bindings10MyTemplateI14DifferentScopeED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<DifferentScope>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN23test_namespace_bindings10MyTemplateINS_13TemplateParamEED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN23test_namespace_bindings10MyTemplateIiED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<int>* __this) { - std::destroy_at(__this); -} -extern "C" class test_namespace_bindings::MyTemplate<DifferentScope>* -__rust_thunk___ZN23test_namespace_bindings10MyTemplateI14DifferentScopeEaSERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<DifferentScope>* __this, - const class test_namespace_bindings::MyTemplate<DifferentScope>* - __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* -__rust_thunk___ZN23test_namespace_bindings10MyTemplateINS_13TemplateParamEEaSERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* __this, - const class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class test_namespace_bindings::MyTemplate<int>* -__rust_thunk___ZN23test_namespace_bindings10MyTemplateIiEaSERKS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<int>* __this, - const class test_namespace_bindings::MyTemplate<int>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class test_namespace_bindings::MyTemplate<DifferentScope>* -__rust_thunk___ZN23test_namespace_bindings10MyTemplateI14DifferentScopeEaSEOS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<DifferentScope>* __this, - class test_namespace_bindings::MyTemplate<DifferentScope>* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* -__rust_thunk___ZN23test_namespace_bindings10MyTemplateINS_13TemplateParamEEaSEOS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* __this, - class test_namespace_bindings::MyTemplate< - test_namespace_bindings::TemplateParam>* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" class test_namespace_bindings::MyTemplate<int>* -__rust_thunk___ZN23test_namespace_bindings10MyTemplateIiEaSEOS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - class test_namespace_bindings::MyTemplate<int>* __this, - class test_namespace_bindings::MyTemplate<int>* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" class test_namespace_bindings::MyTemplate<DifferentScope> +extern "C" class test_namespace_bindings::MyTemplate<DifferentScope> __rust_thunk___ZN23test_namespace_bindings10MyTemplateI14DifferentScopeE6CreateES1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( struct DifferentScope value) { return test_namespace_bindings::MyTemplate<DifferentScope>::Create(value); @@ -180,33 +90,11 @@ crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN23test_namespace_bindings13TemplateParamC1ERKS0_( - struct test_namespace_bindings::TemplateParam* __this, - const struct test_namespace_bindings::TemplateParam* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN23test_namespace_bindings13TemplateParamC1EOS0_( struct test_namespace_bindings::TemplateParam* __this, struct test_namespace_bindings::TemplateParam* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings13TemplateParamD1Ev( - struct test_namespace_bindings::TemplateParam* __this) { - std::destroy_at(__this); -} -extern "C" struct test_namespace_bindings::TemplateParam* -__rust_thunk___ZN23test_namespace_bindings13TemplateParamaSERKS0_( - struct test_namespace_bindings::TemplateParam* __this, - const struct test_namespace_bindings::TemplateParam* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct test_namespace_bindings::TemplateParam* -__rust_thunk___ZN23test_namespace_bindings13TemplateParamaSEOS0_( - struct test_namespace_bindings::TemplateParam* __this, - struct test_namespace_bindings::TemplateParam* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsINS0_IiiEEiEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( struct test_namespace_bindings::TemplateWithTwoParams< @@ -220,22 +108,6 @@ crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsINS0_IiiEEiEC1ERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* __this, - const struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* - __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsIifEC1ERKS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams<int, float>* __this, - const struct test_namespace_bindings::TemplateWithTwoParams<int, float>* - __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsINS0_IiiEEiEC1EOS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( struct test_namespace_bindings::TemplateWithTwoParams< test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* __this, @@ -252,84 +124,17 @@ crubit::construct_at(__this, std::move(*__param_0)); } extern "C" void -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsINS0_IiiEEiED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* - __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsIifED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams<int, float>* __this) { - std::destroy_at(__this); -} -extern "C" struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsINS0_IiiEEiEaSERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* __this, - const struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* - __param_0) { - return &__this->operator=(*__param_0); -} extern "C" struct test_namespace_bindings::TemplateWithTwoParams<int, float>* -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsIifEaSERKS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams<int, float>* __this, - const struct test_namespace_bindings::TemplateWithTwoParams<int, float>* - __param_0) { - return &__this->operator=(*__param_0); -} extern "C" struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsINS0_IiiEEiEaSEOS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* __this, - struct test_namespace_bindings::TemplateWithTwoParams< - test_namespace_bindings::TemplateWithTwoParams<int, int>, int>* - __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" struct test_namespace_bindings::TemplateWithTwoParams<int, float>* -__rust_thunk___ZN23test_namespace_bindings21TemplateWithTwoParamsIifEaSEOS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct test_namespace_bindings::TemplateWithTwoParams<int, float>* __this, - struct test_namespace_bindings::TemplateWithTwoParams<int, float>* - __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN18MyTopLevelTemplateIN23test_namespace_bindings13TemplateParamEEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* __this) { crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN18MyTopLevelTemplateIN23test_namespace_bindings13TemplateParamEEC1ERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* __this, - const struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* - __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN18MyTopLevelTemplateIN23test_namespace_bindings13TemplateParamEEC1EOS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* __this, struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void -__rust_thunk___ZN18MyTopLevelTemplateIN23test_namespace_bindings13TemplateParamEED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* __this) { - std::destroy_at(__this); -} -extern "C" struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* -__rust_thunk___ZN18MyTopLevelTemplateIN23test_namespace_bindings13TemplateParamEEaSERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* __this, - const struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* - __param_0) { - return &__this->operator=(*__param_0); -} extern "C" struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* -__rust_thunk___ZN18MyTopLevelTemplateIN23test_namespace_bindings13TemplateParamEEaSEOS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fcc( - struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* __this, - struct MyTopLevelTemplate<test_namespace_bindings::TemplateParam>* - __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(struct DifferentScope) == 1); static_assert(alignof(struct DifferentScope) == 1);
diff --git a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc index a330e28..629eb28 100644 --- a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc
@@ -12,189 +12,6 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" void -__rust_thunk___ZN10MyTemplateI8TopLevelEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<TopLevel>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIN23test_namespace_bindings5InnerEEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<test_namespace_bindings::Inner>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIS_I8TopLevelEEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<TopLevel>>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIS_IN23test_namespace_bindings5InnerEEEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<test_namespace_bindings::Inner>>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIbEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<bool>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIcEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<char>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIdEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<double>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIfEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<float>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIiEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<int>* __this) { - crubit::construct_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateI8TopLevelEC1ERKS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<TopLevel>* __this, - const class MyTemplate<TopLevel>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIN23test_namespace_bindings5InnerEEC1ERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<test_namespace_bindings::Inner>* __this, - const class MyTemplate<test_namespace_bindings::Inner>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIS_I8TopLevelEEC1ERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<TopLevel>>* __this, - const class MyTemplate<MyTemplate<TopLevel>>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIS_IN23test_namespace_bindings5InnerEEEC1ERKS3___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<test_namespace_bindings::Inner>>* __this, - const class MyTemplate<MyTemplate<test_namespace_bindings::Inner>>* - __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIbEC1ERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<bool>* __this, const class MyTemplate<bool>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIcEC1ERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<char>* __this, const class MyTemplate<char>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIdEC1ERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<double>* __this, - const class MyTemplate<double>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIfEC1ERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<float>* __this, const class MyTemplate<float>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIiEC1ERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<int>* __this, const class MyTemplate<int>* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void -__rust_thunk___ZN10MyTemplateI8TopLevelED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<TopLevel>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIN23test_namespace_bindings5InnerEED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<test_namespace_bindings::Inner>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIS_I8TopLevelEED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<TopLevel>>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIS_IN23test_namespace_bindings5InnerEEED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<test_namespace_bindings::Inner>>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIbED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<bool>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIcED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<char>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIdED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<double>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIfED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<float>* __this) { - std::destroy_at(__this); -} -extern "C" void -__rust_thunk___ZN10MyTemplateIiED1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<int>* __this) { - std::destroy_at(__this); -} -extern "C" class MyTemplate<TopLevel>* -__rust_thunk___ZN10MyTemplateI8TopLevelEaSERKS1___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<TopLevel>* __this, - const class MyTemplate<TopLevel>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<test_namespace_bindings::Inner>* -__rust_thunk___ZN10MyTemplateIN23test_namespace_bindings5InnerEEaSERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<test_namespace_bindings::Inner>* __this, - const class MyTemplate<test_namespace_bindings::Inner>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<MyTemplate<TopLevel>>* -__rust_thunk___ZN10MyTemplateIS_I8TopLevelEEaSERKS2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<TopLevel>>* __this, - const class MyTemplate<MyTemplate<TopLevel>>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<MyTemplate<test_namespace_bindings::Inner>>* -__rust_thunk___ZN10MyTemplateIS_IN23test_namespace_bindings5InnerEEEaSERKS3___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<MyTemplate<test_namespace_bindings::Inner>>* __this, - const class MyTemplate<MyTemplate<test_namespace_bindings::Inner>>* - __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<bool>* -__rust_thunk___ZN10MyTemplateIbEaSERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<bool>* __this, const class MyTemplate<bool>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<char>* -__rust_thunk___ZN10MyTemplateIcEaSERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<char>* __this, const class MyTemplate<char>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<double>* -__rust_thunk___ZN10MyTemplateIdEaSERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<double>* __this, - const class MyTemplate<double>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<float>* -__rust_thunk___ZN10MyTemplateIfEaSERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<float>* __this, const class MyTemplate<float>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" class MyTemplate<int>* -__rust_thunk___ZN10MyTemplateIiEaSERKS0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( - class MyTemplate<int>* __this, const class MyTemplate<int>* __param_0) { - return &__this->operator=(*__param_0); -} extern "C" void __rust_thunk___ZN10MyTemplateI8TopLevelE8processTES0___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3atemplates_5fsource_5forder_5fcc( class MyTemplate<TopLevel>* __this, struct TopLevel t) { __this->processT(t); @@ -242,39 +59,6 @@ class MyTemplate<int>* __this, int t) { __this->processT(t); } -extern "C" void __rust_thunk___ZN8TopLevelC1Ev(struct TopLevel* __this) { - crubit::construct_at(__this); -} -extern "C" void __rust_thunk___ZN8TopLevelC1ERKS_( - struct TopLevel* __this, const struct TopLevel* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN8TopLevelD1Ev(struct TopLevel* __this) { - std::destroy_at(__this); -} -extern "C" struct TopLevel* __rust_thunk___ZN8TopLevelaSERKS_( - struct TopLevel* __this, const struct TopLevel* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" void __rust_thunk___ZN23test_namespace_bindings5InnerC1Ev( - struct test_namespace_bindings::Inner* __this) { - crubit::construct_at(__this); -} -extern "C" void __rust_thunk___ZN23test_namespace_bindings5InnerC1ERKS0_( - struct test_namespace_bindings::Inner* __this, - const struct test_namespace_bindings::Inner* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" void __rust_thunk___ZN23test_namespace_bindings5InnerD1Ev( - struct test_namespace_bindings::Inner* __this) { - std::destroy_at(__this); -} -extern "C" struct test_namespace_bindings::Inner* -__rust_thunk___ZN23test_namespace_bindings5InneraSERKS0_( - struct test_namespace_bindings::Inner* __this, - const struct test_namespace_bindings::Inner* __param_0) { - return &__this->operator=(*__param_0); -} static_assert(sizeof(class MyTemplate<TopLevel>) == 1); static_assert(alignof(class MyTemplate<TopLevel>) == 1);
diff --git a/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc index 6d5b9cb..fb34037 100644 --- a/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc
@@ -15,66 +15,22 @@ struct test_namespace_bindings::Trivial* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings7TrivialC1ERKS0_( - struct test_namespace_bindings::Trivial* __this, - const struct test_namespace_bindings::Trivial* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings7TrivialC1EOS0_( struct test_namespace_bindings::Trivial* __this, struct test_namespace_bindings::Trivial* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings7TrivialD1Ev( - struct test_namespace_bindings::Trivial* __this) { - std::destroy_at(__this); -} -extern "C" struct test_namespace_bindings::Trivial* -__rust_thunk___ZN23test_namespace_bindings7TrivialaSERKS0_( - struct test_namespace_bindings::Trivial* __this, - const struct test_namespace_bindings::Trivial* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct test_namespace_bindings::Trivial* -__rust_thunk___ZN23test_namespace_bindings7TrivialaSEOS0_( - struct test_namespace_bindings::Trivial* __this, - struct test_namespace_bindings::Trivial* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings20TrivialWithDefaultedC1Ev( struct test_namespace_bindings::TrivialWithDefaulted* __this) { crubit::construct_at(__this); } extern "C" void -__rust_thunk___ZN23test_namespace_bindings20TrivialWithDefaultedC1ERKS0_( - struct test_namespace_bindings::TrivialWithDefaulted* __this, - const struct test_namespace_bindings::TrivialWithDefaulted* __param_0) { - crubit::construct_at(__this, *__param_0); -} -extern "C" struct test_namespace_bindings::TrivialWithDefaulted* -__rust_thunk___ZN23test_namespace_bindings20TrivialWithDefaultedaSERKS0_( - struct test_namespace_bindings::TrivialWithDefaulted* __this, - const struct test_namespace_bindings::TrivialWithDefaulted* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" void __rust_thunk___ZN23test_namespace_bindings20TrivialWithDefaultedC1EOS0_( struct test_namespace_bindings::TrivialWithDefaulted* __this, struct test_namespace_bindings::TrivialWithDefaulted* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" struct test_namespace_bindings::TrivialWithDefaulted* -__rust_thunk___ZN23test_namespace_bindings20TrivialWithDefaultedaSEOS0_( - struct test_namespace_bindings::TrivialWithDefaulted* __this, - struct test_namespace_bindings::TrivialWithDefaulted* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} -extern "C" void -__rust_thunk___ZN23test_namespace_bindings20TrivialWithDefaultedD1Ev( - struct test_namespace_bindings::TrivialWithDefaulted* __this) { - std::destroy_at(__this); -} extern "C" void __rust_thunk___ZN23test_namespace_bindings15TrivialNonfinalC1Ev( struct test_namespace_bindings::TrivialNonfinal* __this) { crubit::construct_at(__this); @@ -91,10 +47,6 @@ struct test_namespace_bindings::TrivialNonfinal* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN23test_namespace_bindings15TrivialNonfinalD1Ev( - struct test_namespace_bindings::TrivialNonfinal* __this) { - std::destroy_at(__this); -} extern "C" struct test_namespace_bindings::TrivialNonfinal* __rust_thunk___ZN23test_namespace_bindings15TrivialNonfinalaSERKS0_( struct test_namespace_bindings::TrivialNonfinal* __this,
diff --git a/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc index ce16eac..f00944a 100644 --- a/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc
@@ -22,9 +22,6 @@ struct SomeStruct* __this, struct SomeStruct* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN10SomeStructD1Ev(struct SomeStruct* __this) { - std::destroy_at(__this); -} extern "C" struct SomeStruct* __rust_thunk___ZN10SomeStructaSERKS_( struct SomeStruct* __this, const struct SomeStruct* __param_0) { return &__this->operator=(*__param_0); @@ -36,25 +33,10 @@ extern "C" void __rust_thunk___ZN9SomeUnionC1Ev(union SomeUnion* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN9SomeUnionC1ERKS_( - union SomeUnion* __this, const union SomeUnion* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN9SomeUnionC1EOS_(union SomeUnion* __this, union SomeUnion* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN9SomeUnionD1Ev(union SomeUnion* __this) { - std::destroy_at(__this); -} -extern "C" union SomeUnion* __rust_thunk___ZN9SomeUnionaSERKS_( - union SomeUnion* __this, const union SomeUnion* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" union SomeUnion* __rust_thunk___ZN9SomeUnionaSEOS_( - union SomeUnion* __this, union SomeUnion* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(struct SomeStruct) == 1); static_assert(alignof(struct SomeStruct) == 1);
diff --git a/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc index 3d92c93..0557929 100644 --- a/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc
@@ -14,38 +14,14 @@ extern "C" void __rust_thunk___ZN10SomeStructC1Ev(struct SomeStruct* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN10SomeStructC1ERKS_( - struct SomeStruct* __this, const struct SomeStruct* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN10SomeStructC1EOS_( struct SomeStruct* __this, struct SomeStruct* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN10SomeStructD1Ev(struct SomeStruct* __this) { - std::destroy_at(__this); -} -extern "C" struct SomeStruct* __rust_thunk___ZN10SomeStructaSERKS_( - struct SomeStruct* __this, const struct SomeStruct* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct SomeStruct* __rust_thunk___ZN10SomeStructaSEOS_( - struct SomeStruct* __this, struct SomeStruct* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} -extern "C" void __rust_thunk___ZN19FieldTypeTestStructC1ERKS_( - struct FieldTypeTestStruct* __this, - const struct FieldTypeTestStruct* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN19FieldTypeTestStructC1EOS_( struct FieldTypeTestStruct* __this, struct FieldTypeTestStruct* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN19FieldTypeTestStructD1Ev( - struct FieldTypeTestStruct* __this) { - std::destroy_at(__this); -} extern "C" void __rust_thunk___Z21VoidReturningFunctionv() { VoidReturningFunction(); }
diff --git a/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc index db4aceb..3bce6d5 100644 --- a/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc
@@ -14,28 +14,10 @@ extern "C" void __rust_thunk___ZN10EmptyUnionC1Ev(union EmptyUnion* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN10EmptyUnionC1ERKS_( - union EmptyUnion* __this, const union EmptyUnion* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN10EmptyUnionC1EOS_( union EmptyUnion* __this, union EmptyUnion* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN10EmptyUnionD1Ev(union EmptyUnion* __this) { - std::destroy_at(__this); -} -extern "C" union EmptyUnion* __rust_thunk___ZN10EmptyUnionaSERKS_( - union EmptyUnion* __this, const union EmptyUnion* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" union EmptyUnion* __rust_thunk___ZN10EmptyUnionaSEOS_( - union EmptyUnion* __this, union EmptyUnion* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} -extern "C" void __rust_thunk___ZN10NontrivialD1Ev(struct Nontrivial* __this) { - std::destroy_at(__this); -} extern "C" struct TriviallyCopyableButNontriviallyDestructible* __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleaSERKS_( struct TriviallyCopyableButNontriviallyDestructible* __this, @@ -57,30 +39,10 @@ union NonEmptyUnion* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN13NonEmptyUnionC1ERKS_( - union NonEmptyUnion* __this, const union NonEmptyUnion* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN13NonEmptyUnionC1EOS_( union NonEmptyUnion* __this, union NonEmptyUnion* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN13NonEmptyUnionD1Ev( - union NonEmptyUnion* __this) { - std::destroy_at(__this); -} -extern "C" union NonEmptyUnion* __rust_thunk___ZN13NonEmptyUnionaSERKS_( - union NonEmptyUnion* __this, const union NonEmptyUnion* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" union NonEmptyUnion* __rust_thunk___ZN13NonEmptyUnionaSEOS_( - union NonEmptyUnion* __this, union NonEmptyUnion* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} -extern "C" void __rust_thunk___ZN12NonCopyUnionD1Ev( - union NonCopyUnion* __this) { - std::destroy_at(__this); -} extern "C" void __rust_thunk___ZN13NonCopyUnion2C1ERKS_( union NonCopyUnion2* __this, const union NonCopyUnion2* __param_0) { crubit::construct_at(__this, *__param_0); @@ -89,42 +51,14 @@ union NonCopyUnion2* __this, union NonCopyUnion2* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" union NonCopyUnion2* __rust_thunk___ZN13NonCopyUnion2aSERKS_( - union NonCopyUnion2* __this, const union NonCopyUnion2* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" union NonCopyUnion2* __rust_thunk___ZN13NonCopyUnion2aSEOS_( - union NonCopyUnion2* __this, union NonCopyUnion2* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} extern "C" void __rust_thunk___ZN20UnionWithOpaqueFieldC1Ev( union UnionWithOpaqueField* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN20UnionWithOpaqueFieldC1ERKS_( - union UnionWithOpaqueField* __this, - const union UnionWithOpaqueField* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN20UnionWithOpaqueFieldC1EOS_( union UnionWithOpaqueField* __this, union UnionWithOpaqueField* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN20UnionWithOpaqueFieldD1Ev( - union UnionWithOpaqueField* __this) { - std::destroy_at(__this); -} -extern "C" union UnionWithOpaqueField* -__rust_thunk___ZN20UnionWithOpaqueFieldaSERKS_( - union UnionWithOpaqueField* __this, - const union UnionWithOpaqueField* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" union UnionWithOpaqueField* -__rust_thunk___ZN20UnionWithOpaqueFieldaSEOS_( - union UnionWithOpaqueField* __this, union UnionWithOpaqueField* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(union EmptyUnion) == 1); static_assert(alignof(union EmptyUnion) == 1);
diff --git a/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc index 5b4d881..36f074e 100644 --- a/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc
@@ -15,57 +15,18 @@ struct TrivialCustomType* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN17TrivialCustomTypeC1ERKS_( - struct TrivialCustomType* __this, - const struct TrivialCustomType* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN17TrivialCustomTypeC1EOS_( struct TrivialCustomType* __this, struct TrivialCustomType* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN17TrivialCustomTypeD1Ev( - struct TrivialCustomType* __this) { - std::destroy_at(__this); -} -extern "C" struct TrivialCustomType* -__rust_thunk___ZN17TrivialCustomTypeaSERKS_( - struct TrivialCustomType* __this, - const struct TrivialCustomType* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct TrivialCustomType* __rust_thunk___ZN17TrivialCustomTypeaSEOS_( - struct TrivialCustomType* __this, struct TrivialCustomType* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} -extern "C" void __rust_thunk___ZN20NontrivialCustomTypeD1Ev( - struct NontrivialCustomType* __this) { - std::destroy_at(__this); -} extern "C" void __rust_thunk___ZN16ContainingStructC1Ev( struct ContainingStruct* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN16ContainingStructC1ERKS_( - struct ContainingStruct* __this, const struct ContainingStruct* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN16ContainingStructC1EOS_( struct ContainingStruct* __this, struct ContainingStruct* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN16ContainingStructD1Ev( - struct ContainingStruct* __this) { - std::destroy_at(__this); -} -extern "C" struct ContainingStruct* __rust_thunk___ZN16ContainingStructaSERKS_( - struct ContainingStruct* __this, const struct ContainingStruct* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct ContainingStruct* __rust_thunk___ZN16ContainingStructaSEOS_( - struct ContainingStruct* __this, struct ContainingStruct* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(struct TrivialCustomType) == 4); static_assert(alignof(struct TrivialCustomType) == 4);
diff --git a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc index b718285..c0036fb 100644 --- a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc
@@ -22,9 +22,6 @@ struct Derived2* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN8Derived2D1Ev(struct Derived2* __this) { - std::destroy_at(__this); -} extern "C" struct Derived2* __rust_thunk___ZN8Derived2aSERKS_( struct Derived2* __this, const struct Derived2* __param_0) { return &__this->operator=(*__param_0); @@ -45,10 +42,6 @@ class VirtualDerived2* __this, class VirtualDerived2* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN15VirtualDerived2D1Ev( - class VirtualDerived2* __this) { - std::destroy_at(__this); -} extern "C" class VirtualDerived2* __rust_thunk___ZN15VirtualDerived2aSERKS_( class VirtualDerived2* __this, const class VirtualDerived2* __param_0) { return &__this->operator=(*__param_0);
diff --git a/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc index 9021562..890951a 100644 --- a/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc
@@ -15,30 +15,10 @@ struct UserOfImportedType* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN18UserOfImportedTypeC1ERKS_( - struct UserOfImportedType* __this, - const struct UserOfImportedType* __param_0) { - crubit::construct_at(__this, *__param_0); -} extern "C" void __rust_thunk___ZN18UserOfImportedTypeC1EOS_( struct UserOfImportedType* __this, struct UserOfImportedType* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -extern "C" void __rust_thunk___ZN18UserOfImportedTypeD1Ev( - struct UserOfImportedType* __this) { - std::destroy_at(__this); -} -extern "C" struct UserOfImportedType* -__rust_thunk___ZN18UserOfImportedTypeaSERKS_( - struct UserOfImportedType* __this, - const struct UserOfImportedType* __param_0) { - return &__this->operator=(*__param_0); -} -extern "C" struct UserOfImportedType* -__rust_thunk___ZN18UserOfImportedTypeaSEOS_( - struct UserOfImportedType* __this, struct UserOfImportedType* __param_0) { - return &__this->operator=(std::move(*__param_0)); -} static_assert(sizeof(struct UserOfImportedType) == 8); static_assert(alignof(struct UserOfImportedType) == 8);