From 8190ab62b44d3eb2f84d53c846b0b704240ded3f Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 25 Mar 2026 07:35:30 -0700 Subject: [PATCH] extern crate core as __rust_core PiperOrigin-RevId: 889234896 --- examples/cpp/enum/example_generated.rs | 1 + examples/cpp/function/example_generated.rs | 1 + examples/cpp/method/example_generated.rs | 11 +- .../trivial_abi_struct/example_generated.rs | 15 +- .../cpp/trivial_struct/example_generated.rs | 15 +- .../unsafe_attributes/example_generated.rs | 1 + examples/cpp/virtual/example_generated.rs | 32 +- .../bazel_support/generate_bindings.bzl | 7 +- .../database/code_snippet.rs | 29 +- .../generate_bindings/database/rs_snippet.rs | 18 +- .../generate_bindings_test.rs | 26 +- .../generate_dyn_callable.rs | 10 +- .../generate_bindings/generate_enum_test.rs | 2 +- .../generate_bindings/generate_function.rs | 18 +- .../generate_function_test.rs | 44 +-- .../generate_function_thunk.rs | 8 +- .../generate_struct_and_union_test.rs | 120 ++++---- rs_bindings_from_cc/generate_bindings/lib.rs | 24 +- .../test/annotations/do_not_bind_rs_api.rs | 45 +-- .../test/annotations/owned_ptr_rs_api.rs | 15 +- .../test/annotations/owned_ptr_user_rs_api.rs | 7 +- .../test/annotations/rust_name_rs_api.rs | 25 +- .../assume_lifetimes/free_function_rs_api.rs | 1 + .../member_function_rs_api.rs | 11 +- .../simple_string_view_rs_api.rs | 13 +- .../assume_lifetimes/string_view_rs_api.rs | 21 +- .../consume_absl/absl_functional.golden.rs | 57 ++-- .../test/display/displayables_api.rs | 157 +++++----- .../test/function/inline/inline_rs_api.rs | 13 +- .../test/function/simple/simple_rs_api.rs | 1 + .../test/global/global_rs_api.rs | 11 +- .../test/golden/bitfields_rs_api.rs | 37 +-- .../test/golden/bridge_type_rs_api.rs | 9 +- .../golden/c_abi_compatible_type_rs_api.rs | 15 +- .../test/golden/callables_rs_api.rs | 241 ++++++++------- .../test/golden/callables_supported_rs_api.rs | 29 +- .../test/golden/clang_attrs_rs_api.rs | 41 +-- .../test/golden/comment_rs_api.rs | 35 ++- .../test/golden/compatibility_rs_api.rs | 15 +- .../test/golden/composable_bridging_rs_api.rs | 51 ++-- ...omposable_bridging_template_type_rs_api.rs | 9 +- .../crubit_internal_rust_type_rs_api.rs | 67 +++-- ...efinition_of_forward_declaration_rs_api.rs | 11 +- .../golden/depends_on_nested_types_rs_api.rs | 1 + .../test/golden/deprecated_rs_api.rs | 17 +- ...agerly_import_template_type_args_rs_api.rs | 1 + .../test/golden/doc_comment_rs_api.rs | 59 ++-- .../test/golden/enums_rs_api.rs | 1 + .../test/golden/escaping_keywords_rs_api.rs | 11 +- .../test/golden/forward_declaration_rs_api.rs | 1 + .../test/golden/friend_functions_rs_api.rs | 13 +- .../golden/function_annotations_rs_api.rs | 3 +- .../test/golden/includes_rs_api.rs | 2 + .../test/golden/inheritance_rs_api.rs | 131 +++++---- .../test/golden/item_order_rs_api.rs | 25 +- .../test/golden/lifetimes_rs_api.rs | 1 + .../test/golden/method_access_rs_api.rs | 21 +- .../test/golden/method_qualifiers_rs_api.rs | 23 +- .../test/golden/namespace_rs_api.rs | 45 +-- .../test/golden/nested_types_rs_api.rs | 277 ++++++++++-------- .../test/golden/no_elided_lifetimes_rs_api.rs | 61 ++-- .../test/golden/no_unique_address_rs_api.rs | 89 +++--- .../test/golden/nodiscard_rs_api.rs | 35 ++- .../test/golden/noexcept_rs_api.rs | 13 +- .../test/golden/non_member_operator_rs_api.rs | 11 +- .../test/golden/nontrivial_type_rs_api.rs | 168 ++++++----- .../test/golden/operators_rs_api.rs | 269 ++++++++--------- .../test/golden/overloads_rs_api.rs | 11 +- .../overloads_unsupported_template_rs_api.rs | 1 + .../overloads_unsupported_type_rs_api.rs | 13 +- .../test/golden/polymorphic_rs_api.rs | 47 +-- .../test/golden/private_members_rs_api.rs | 21 +- .../test/golden/private_method_rs_api.rs | 11 +- .../test/golden/static_methods_rs_api.rs | 23 +- .../test/golden/template_inst_rs_api.rs | 15 +- .../test/golden/templates_rs_api.rs | 27 +- .../golden/templates_source_order_rs_api.rs | 23 +- .../test/golden/trivial_type_rs_api.rs | 19 +- .../test/golden/type_annotations_rs_api.rs | 3 +- .../test/golden/typedefs_rs_api.rs | 45 +-- .../test/golden/types_rs_api.rs | 108 ++++--- .../test/golden/unions_rs_api.rs | 149 ++++++---- .../test/golden/unsafe_attrs_rs_api.rs | 1 + .../golden/unsafe_types_transitive_rs_api.rs | 51 ++-- .../test/golden/unsupported_rs_api.rs | 19 +- .../test/golden/user_of_base_class_rs_api.rs | 27 +- .../golden/user_of_imported_type_rs_api.rs | 18 +- .../test/golden/user_of_unsupported_rs_api.rs | 5 +- .../golden/uses_not_crubit_exposed_rs_api.rs | 11 +- .../test/golden/using_function_rs_api.rs | 1 + .../test/namespace/inline/inline_rs_api.rs | 11 +- .../test/references/references_rs_api.rs | 23 +- .../constructors/constructors_rs_api.rs | 197 +++++++------ .../default_member_functions_rs_api.rs | 33 ++- .../struct/destructors/destructors_rs_api.rs | 45 +-- .../inheritance/inherited_methods_rs_api.rs | 35 ++- .../test/struct/methods/methods_rs_api.rs | 29 +- .../methods_qualifiers_rs_api.rs | 11 +- .../regression_401857961/repro_rs_api.rs | 15 +- .../templates/type_alias/type_alias_rs_api.rs | 21 +- .../type_alias_access_rule_rs_api.rs | 13 +- .../test/types_only/types_only_rs_api.rs | 82 +++--- .../fallback_types/wrapper_library_rs_api.rs | 1 + .../wrapper/impl_ctor/impl_ctor_rs_api.rs | 40 +-- .../pub_crate_types/pub_crate_types_rs_api.rs | 37 +-- 105 files changed, 2113 insertions(+), 1726 deletions(-) diff --git a/examples/cpp/enum/example_generated.rs b/examples/cpp/enum/example_generated.rs index b93ac15ec..c501cfa96 100644 --- a/examples/cpp/enum/example_generated.rs +++ b/examples/cpp/enum/example_generated.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: examples/cpp/enum/example.h;l=8 #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] diff --git a/examples/cpp/function/example_generated.rs b/examples/cpp/function/example_generated.rs index 49b1ac08e..05a691c1d 100644 --- a/examples/cpp/function/example_generated.rs +++ b/examples/cpp/function/example_generated.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod gshoe { /// Generated from: examples/cpp/function/example.h;l=12 #[inline(always)] diff --git a/examples/cpp/method/example_generated.rs b/examples/cpp/method/example_generated.rs index 4bc4be020..9f18c50e3 100644 --- a/examples/cpp/method/example_generated.rs +++ b/examples/cpp/method/example_generated.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod foo { /// Generated from: examples/cpp/method/example.h;l=12 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] @@ -45,7 +46,7 @@ pub mod foo { impl Default for Bar { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN3foo3BarC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -60,15 +61,15 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN3foo3BarC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN3foo3BarC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN3foo3Bar8MyMethodEv(__this: *mut crate::foo::Bar); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::foo::Bar: Copy,Clone); static_assertions::assert_not_impl_any!(crate::foo::Bar: Drop); - assert!(::core::mem::offset_of!(crate::foo::Bar, x) == 0); + assert!(::__rust_core::mem::offset_of!(crate::foo::Bar, x) == 0); }; diff --git a/examples/cpp/trivial_abi_struct/example_generated.rs b/examples/cpp/trivial_abi_struct/example_generated.rs index 28a5a630d..633cb0e82 100644 --- a/examples/cpp/trivial_abi_struct/example_generated.rs +++ b/examples/cpp/trivial_abi_struct/example_generated.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Because this class has a destructor, it will not receive Rust bindings /// without ABSL_ATTRIBUTE_TRIVIAL_ABI. /// @@ -36,7 +37,7 @@ unsafe impl ::cxx::ExternType for Position { impl Default for Position { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN8PositionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -74,7 +75,9 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN8PositionC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN8PositionC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN8PositionaSERKS_<'__return_lifetime>( __this: &mut crate::Position, __param_0: &crate::Position, @@ -84,12 +87,12 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Position: Clone,Drop); static_assertions::assert_not_impl_any!(crate::Position: Copy); - assert!(::core::mem::offset_of!(crate::Position, x) == 0); - assert!(::core::mem::offset_of!(crate::Position, y) == 4); + assert!(::__rust_core::mem::offset_of!(crate::Position, x) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Position, y) == 4); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); }; diff --git a/examples/cpp/trivial_struct/example_generated.rs b/examples/cpp/trivial_struct/example_generated.rs index 702772c43..42b4d9e55 100644 --- a/examples/cpp/trivial_struct/example_generated.rs +++ b/examples/cpp/trivial_struct/example_generated.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: examples/cpp/trivial_struct/example.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -33,7 +34,7 @@ unsafe impl ::cxx::ExternType for Position { impl Default for Position { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN8PositionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -45,15 +46,17 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN8PositionC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN8PositionC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); } } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Position: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Position: Drop); - assert!(::core::mem::offset_of!(crate::Position, x) == 0); - assert!(::core::mem::offset_of!(crate::Position, y) == 4); + assert!(::__rust_core::mem::offset_of!(crate::Position, x) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Position, y) == 4); }; diff --git a/examples/cpp/unsafe_attributes/example_generated.rs b/examples/cpp/unsafe_attributes/example_generated.rs index 6eacf75f3..cdef17f51 100644 --- a/examples/cpp/unsafe_attributes/example_generated.rs +++ b/examples/cpp/unsafe_attributes/example_generated.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: examples/cpp/unsafe_attributes/example.h;l=10 #[inline(always)] pub fn SafeSignatureWithoutAnnotation() { diff --git a/examples/cpp/virtual/example_generated.rs b/examples/cpp/virtual/example_generated.rs index d6003c7ff..d7e1b4ade 100644 --- a/examples/cpp/virtual/example_generated.rs +++ b/examples/cpp/virtual/example_generated.rs @@ -14,15 +14,16 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: examples/cpp/virtual/example.h;l=13 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=RustDerived pub struct RustDerived { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 8], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) rust_: [::core::cell::Cell<::core::mem::MaybeUninit>; 16], + pub(crate) rust_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 16], } impl !Send for RustDerived {} impl !Sync for RustDerived {} @@ -63,7 +64,7 @@ impl<'__unelided> ::ctor::CtorNew<::ctor::RvalueReference<'__unelided, Self>> fo unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN11RustDerivedC1EOS_( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, __param_0, ); }) @@ -83,7 +84,7 @@ impl<'__unelided> ::ctor::CtorNew<(::ctor::RvalueReference<'__unelided, Self>,)> /// Generated from: examples/cpp/virtual/example.h;l=13 impl ::ctor::PinnedDrop for RustDerived { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN11RustDerivedD1Ev(self) } } @@ -91,7 +92,10 @@ impl ::ctor::PinnedDrop for RustDerived { /// Generated from: examples/cpp/virtual/example.h;l=13 impl ::ctor::Assign<::ctor::RvalueReference<'_, Self>> for RustDerived { #[inline(always)] - fn assign(self: ::core::pin::Pin<&mut Self>, __param_0: ::ctor::RvalueReference<'_, Self>) { + fn assign( + self: ::__rust_core::pin::Pin<&mut Self>, + __param_0: ::ctor::RvalueReference<'_, Self>, + ) { unsafe { crate::detail::__rust_thunk___ZN11RustDerivedaSEOS_(self, __param_0); } @@ -108,7 +112,7 @@ impl ::ctor::CtorNew<::definition::RustDerived> for RustDerived { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN11RustDerivedC1EN10definition11RustDerivedE( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, &mut rust, ); }) @@ -185,18 +189,18 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN11RustDerivedC1EOS_<'__unelided>( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: ::ctor::RvalueReference<'__unelided, crate::RustDerived>, ); pub(crate) unsafe fn __rust_thunk___ZN11RustDerivedD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::RustDerived>, + __this: ::__rust_core::pin::Pin<&'a mut crate::RustDerived>, ); pub(crate) unsafe fn __rust_thunk___ZN11RustDerivedaSEOS_<'__return_lifetime>( - __this: ::core::pin::Pin<&mut crate::RustDerived>, + __this: ::__rust_core::pin::Pin<&mut crate::RustDerived>, __param_0: ::ctor::RvalueReference<'_, crate::RustDerived>, - ) -> ::core::pin::Pin<&'__return_lifetime mut crate::RustDerived>; + ) -> ::__rust_core::pin::Pin<&'__return_lifetime mut crate::RustDerived>; pub(crate) unsafe fn __rust_thunk___ZN11RustDerivedC1EN10definition11RustDerivedE( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, rust: &mut ::definition::RustDerived, ); pub(crate) unsafe fn __rust_thunk___ZNK11RustDerived7Method1Ev( @@ -212,9 +216,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 24); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 24); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::RustDerived: Drop); static_assertions::assert_not_impl_any!(crate::RustDerived: Copy); - assert!(::core::mem::offset_of!(crate::RustDerived, rust_) == 8); + assert!(::__rust_core::mem::offset_of!(crate::RustDerived, rust_) == 8); }; diff --git a/rs_bindings_from_cc/bazel_support/generate_bindings.bzl b/rs_bindings_from_cc/bazel_support/generate_bindings.bzl index c1016c3c5..4a968ef27 100644 --- a/rs_bindings_from_cc/bazel_support/generate_bindings.bzl +++ b/rs_bindings_from_cc/bazel_support/generate_bindings.bzl @@ -20,8 +20,11 @@ def escape_cpp_target_name(package_name, crate_name): string: escaped crate name """ - # Crubit generates assertions with `::core`, which would resolve to current crate, if current - # crate (i.e., cc_library) is named 'core'. + # Crubit used to generate assertions with `::core`, which would resolve to current crate, if + # current crate (i.e., cc_library) is named 'core'. Crubit now uses `::__rust_core` to avoid + # this issue, but we still rename 'core' targets: if a cc_library named "core" is built, + # Bazel passes `--extern core=...` to dependent rustc invocations. This shadows the sysroot + # `core` crate entirely, overriding `::__rust_core` aliases (e.g. `cannot find 'mem' in '__rust_core'`). if crate_name == "core": _, _, last_path_component = package_name.rpartition("/") crate_name = "core_" + last_path_component diff --git a/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs b/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs index f36925e2b..13da4bf22 100644 --- a/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs +++ b/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs @@ -619,9 +619,9 @@ pub fn generated_items_to_tokens<'db>( let n = Literal::usize_unsuffixed(n); // TODO(b/481405536): Do this unconditionally. if *internally_mutable_unknown_fields { - quote! { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; #n], } + quote! { __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; #n], } } else { - quote! { __non_field_data: [::core::mem::MaybeUninit; #n], } + quote! { __non_field_data: [::__rust_core::mem::MaybeUninit; #n], } } }); @@ -672,7 +672,7 @@ pub fn generated_items_to_tokens<'db>( __COMMENT__ "Generated due to CRUBIT_OWNED_POINTEE annotation." #[doc = #doc_comment] #[repr(transparent)] - pub struct #owned_type_name(::core::ptr::NonNull<#ident>); + pub struct #owned_type_name(::__rust_core::ptr::NonNull<#ident>); impl Drop for #owned_type_name { fn drop(&mut self) { @@ -699,7 +699,7 @@ pub fn generated_items_to_tokens<'db>( .iter() .map(|lt| { let field_name = format_ident!("__marker_{}", lt.ident); - quote! { #field_name: ::core::marker::PhantomData<& #lt ()> } + quote! { #field_name: ::__rust_core::marker::PhantomData<& #lt ()> } }) .collect(); @@ -1061,13 +1061,13 @@ impl ToTokens for DisplayImpl { fn to_tokens(&self, tokens: &mut TokenStream) { let Self { type_name, fmt_fn_name } = self; quote! { - impl ::core::fmt::Display for #type_name { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + impl ::__rust_core::fmt::Display for #type_name { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::#fmt_fn_name(self, &mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -1182,9 +1182,10 @@ impl ToTokens for BitPadding { fn to_tokens(&self, tokens: &mut TokenStream) { let n = Literal::usize_unsuffixed(self.padding_size_in_bytes()); if self.internally_mutable { - quote! { [::core::cell::Cell<::core::mem::MaybeUninit>; #n] }.to_tokens(tokens); + quote! { [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; #n] } + .to_tokens(tokens); } else { - quote! { [::core::mem::MaybeUninit; #n] }.to_tokens(tokens); + quote! { [::__rust_core::mem::MaybeUninit; #n] }.to_tokens(tokens); } } } @@ -1274,7 +1275,7 @@ impl ToTokens for FieldType { FieldType::Erased(padding) => padding.to_tokens(tokens), FieldType::Type { needs_manually_drop, ty } => { if *needs_manually_drop { - quote! { ::core::mem::ManuallyDrop<#ty> }.to_tokens(tokens) + quote! { ::__rust_core::mem::ManuallyDrop<#ty> }.to_tokens(tokens) } else { ty.to_tokens(tokens) } @@ -1391,8 +1392,8 @@ impl ToTokens for Assertion { let size = Literal::usize_unsuffixed(*size); let alignment = Literal::usize_unsuffixed(*alignment); quote! { - assert!(::core::mem::size_of::<#type_name>() == #size); - assert!(::core::mem::align_of::<#type_name>() == #alignment); + assert!(::__rust_core::mem::size_of::<#type_name>() == #size); + assert!(::__rust_core::mem::align_of::<#type_name>() == #alignment); } .to_tokens(tokens); } @@ -1420,7 +1421,7 @@ impl ToTokens for Assertion { for (field_ident, expected_offset) in fields_and_expected_offsets { let expected_offset = Literal::usize_unsuffixed(*expected_offset); quote! { - assert!(::core::mem::offset_of!(#qualified_ident, #field_ident) == #expected_offset); + assert!(::__rust_core::mem::offset_of!(#qualified_ident, #field_ident) == #expected_offset); } .to_tokens(tokens); } diff --git a/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs b/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs index e7d28e1b8..99e737495 100644 --- a/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs +++ b/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs @@ -535,9 +535,9 @@ pub enum FnTrait { impl ToTokens for FnTrait { fn to_tokens(&self, tokens: &mut TokenStream) { match self { - FnTrait::Fn => quote! { ::core::ops::Fn }, - FnTrait::FnMut => quote! { ::core::ops::FnMut }, - FnTrait::FnOnce => quote! { ::core::ops::FnOnce }, + FnTrait::Fn => quote! { ::__rust_core::ops::Fn }, + FnTrait::FnMut => quote! { ::__rust_core::ops::FnMut }, + FnTrait::FnOnce => quote! { ::__rust_core::ops::FnOnce }, } .to_tokens(tokens); } @@ -572,7 +572,7 @@ impl Callable { self.param_types.iter().map(|param_ty| param_ty.to_token_stream(db)); let fn_trait = self.fn_trait; quote! { - dyn #fn_trait(#(#param_type_tokens),*) #rust_return_type_fragment + ::core::marker::Send + ::core::marker::Sync + 'static + dyn #fn_trait(#(#param_type_tokens),*) #rust_return_type_fragment + ::__rust_core::marker::Send + ::__rust_core::marker::Sync + 'static } } @@ -1245,7 +1245,9 @@ impl RsTypeKind { let mut_ = mutability.format_for_reference(); let lifetime = lifetime.format_for_reference(); if mutability == &Mutability::Mut && !referent.is_unpin() { - Ok(RsSnippet::new(quote! {self: ::core::pin::Pin< & #lifetime #mut_ Self>})) + Ok(RsSnippet::new( + quote! {self: ::__rust_core::pin::Pin< & #lifetime #mut_ Self>}, + )) } else { Ok(RsSnippet::new(quote! { & #lifetime #mut_ self })) } @@ -1456,7 +1458,7 @@ impl RsTypeKind { let referent_ = referent.to_token_stream_replacing_by_self(db, self_record); let mut tokens = quote! {& #lifetime #mut_ #referent_}; if mutability == &Mutability::Mut && !referent.is_unpin() { - tokens = quote! {::core::pin::Pin< #tokens >}; + tokens = quote! {::__rust_core::pin::Pin< #tokens >}; } tokens } @@ -1726,7 +1728,7 @@ impl RsTypeKind { let referent_tokens = referent.to_token_stream(db); let mut tokens = quote! {& #lifetime #mut_ #referent_tokens}; if mutability == &Mutability::Mut && !referent.is_unpin() { - tokens = quote! { ::core::pin::Pin< #tokens > }; + tokens = quote! { ::__rust_core::pin::Pin< #tokens > }; } tokens } @@ -1831,7 +1833,7 @@ impl RsTypeKind { } BridgeRsTypeKind::StdOptional(inner) => { let inner = inner.to_token_stream(db); - quote! { ::core::option::Option< #inner > } + quote! { ::__rust_core::option::Option< #inner > } } BridgeRsTypeKind::StdPair(first, second) => { let first = first.to_token_stream(db); diff --git a/rs_bindings_from_cc/generate_bindings/generate_bindings_test.rs b/rs_bindings_from_cc/generate_bindings/generate_bindings_test.rs index d779116b1..4bbfdfdc4 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_bindings_test.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_bindings_test.rs @@ -385,7 +385,7 @@ fn test_impl_drop_user_defined_destructor() -> Result<()> { quote! { impl ::ctor::PinnedDrop for UserDefinedDestructor { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN21UserDefinedDestructorD1Ev(self) } } @@ -394,7 +394,7 @@ fn test_impl_drop_user_defined_destructor() -> Result<()> { assert_rs_matches!(rs_api, quote! {pub x: ::ffi_11::c_int,}); assert_rs_matches!( rs_api, - quote! {pub nts: ::core::mem::ManuallyDrop,} + quote! {pub nts: ::__rust_core::mem::ManuallyDrop,} ); Ok(()) } @@ -423,7 +423,7 @@ fn test_impl_drop_nontrivial_member_destructor() -> Result<()> { quote! { impl ::ctor::PinnedDrop for NontrivialMembers { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN17NontrivialMembersD1Ev(self) } } @@ -433,7 +433,7 @@ fn test_impl_drop_nontrivial_member_destructor() -> Result<()> { assert_rs_matches!(rs_api, quote! {pub ts: crate::TrivialStruct,}); assert_rs_matches!( rs_api, - quote! {pub udd: ::core::mem::ManuallyDrop,} + quote! {pub udd: ::__rust_core::mem::ManuallyDrop,} ); Ok(()) } @@ -825,10 +825,10 @@ fn test_assertions_outside_of_namespace_module() -> Result<()> { ... const _: () = { ... - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); ... - assert!(::core::mem::offset_of!(crate::test_namespace_bindings::S, i) == 0); + assert!(::__rust_core::mem::offset_of!(crate::test_namespace_bindings::S, i) == 0); ... }; } @@ -1170,7 +1170,7 @@ fn test_default_crubit_features_disabled_dependency_struct() -> Result<()> { quote! { pub struct Present { ... - pub(crate) field: [::core::mem::MaybeUninit; 1], + pub(crate) field: [::__rust_core::mem::MaybeUninit; 1], } } ); @@ -1229,14 +1229,14 @@ fn test_existing_rust_type_assert() -> Result<()> { assert_rs_matches!( rs_api, quote! { - assert!(::core::mem::size_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); } ); assert_rs_matches!( rs_api, quote! { - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); } ); Ok(()) @@ -1263,7 +1263,7 @@ fn test_existing_rust_type_c_abi_incompatible() -> Result<()> { assert_rs_matches!( rs_api, quote! { - pub(crate) unsafe fn __rust_thunk___Z4Makev(__return: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___Z4Makev(__return: *mut ::__rust_core::ffi::c_void); } ); Ok(()) @@ -1312,13 +1312,13 @@ fn test_existing_rust_type_assert_incomplete() -> Result<()> { assert_rs_not_matches!( rs_api, quote! { - const _: () = { ... ::core::mem::size_of::() ... } } + const _: () = { ... ::__rust_core::mem::size_of::() ... } } ); assert_rs_not_matches!( rs_api, quote! { - const _: () = { ... ::core::mem::align_of::() ... }} + const _: () = { ... ::__rust_core::mem::align_of::() ... }} ); Ok(()) } diff --git a/rs_bindings_from_cc/generate_bindings/generate_dyn_callable.rs b/rs_bindings_from_cc/generate_bindings/generate_dyn_callable.rs index a36c5cc27..56bd6b988 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_dyn_callable.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_dyn_callable.rs @@ -43,7 +43,7 @@ pub fn dyn_callable_crubit_abi_type( quote! { ::alloc::boxed::Box::new(|#(_: #param_type_tokens),*| #rust_return_type_fragment { - ::core::panic!("moved-from value") + ::__rust_core::panic!("moved-from value") }) } }; @@ -298,7 +298,7 @@ fn generate_make_cpp_invoker_tokens( c_param_types.push(param_ty.to_token_stream_with_owned_ptr_type(db)); arg_exprs.push(quote! { // SAFETY: Transmuting from a repr(transparent) struct that wraps the pointer. - unsafe { ::core::mem::transmute(#param_ident) } + unsafe { ::__rust_core::mem::transmute(#param_ident) } }); } PassingConvention::Void => bail!("parameter types cannot be void"), @@ -342,7 +342,7 @@ fn generate_make_cpp_invoker_tokens( } PassingConvention::LayoutCompatible => { invoke_ffi_and_transform_to_rust = quote! { - let out = ::core::mem::MaybeUninit::uninit(); + let out = ::__rust_core::mem::MaybeUninit::uninit(); #invoke_ffi_and_transform_to_rust; unsafe { out.assume_init() } } @@ -363,7 +363,7 @@ fn generate_make_cpp_invoker_tokens( PassingConvention::OwnedPtr => { invoke_ffi_and_transform_to_rust = quote! { // SAFETY: Transmuting to a repr(transparent) struct that wraps the pointer. - unsafe { ::core::mem::transmute(#invoke_ffi_and_transform_to_rust) } + unsafe { ::__rust_core::mem::transmute(#invoke_ffi_and_transform_to_rust) } }; } PassingConvention::Void => { @@ -380,7 +380,7 @@ fn generate_make_cpp_invoker_tokens( |managed: ::any_invocable::ManagedState, invoker: unsafe extern "C" fn()| -> ::alloc::boxed::Box<#dyn_fn_spelling> { let c_invoker = unsafe { - ::core::mem::transmute::< + ::__rust_core::mem::transmute::< unsafe extern "C" fn(), unsafe extern "C" fn( *mut ::any_invocable::TypeErasedState diff --git a/rs_bindings_from_cc/generate_bindings/generate_enum_test.rs b/rs_bindings_from_cc/generate_bindings/generate_enum_test.rs index 29c6404ac..787a6917f 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_enum_test.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_enum_test.rs @@ -342,7 +342,7 @@ fn test_display() -> Result<()> { assert_rs_matches!( rs_api, quote! { - impl ::core::fmt::Display for Enum { + impl ::__rust_core::fmt::Display for Enum { ... } } diff --git a/rs_bindings_from_cc/generate_bindings/generate_function.rs b/rs_bindings_from_cc/generate_bindings/generate_function.rs index 98310a2b8..ae630247e 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_function.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_function.rs @@ -586,7 +586,7 @@ fn api_func_shape_for_operator( let impl_kind = ImplKind::Trait { record: record.clone(), trait_name: TraitName::Other { - name: Rc::from(format!("::core::ops::{trait_name}")), + name: Rc::from(format!("::__rust_core::ops::{trait_name}")), params: Rc::from(¶m_types[1..]), is_unsafe_fn: false, }, @@ -606,7 +606,7 @@ fn api_func_shape_for_operator( let impl_kind = ImplKind::Trait { record, trait_name: TraitName::Other { - name: Rc::from(format!("::core::ops::{trait_name}")), + name: Rc::from(format!("::__rust_core::ops::{trait_name}")), params: Rc::from(¶m_types[1..]), is_unsafe_fn: false, }, @@ -1094,7 +1094,7 @@ fn generate_func_body( // we don't need to worry about them. Ok(quote! { #thunk_prepare - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { #crate_root_path::detail::#thunk_ident( &raw mut tmp as *mut _ #( , #thunk_args )* ); tmp.assume_init() @@ -1134,9 +1134,9 @@ fn generate_func_body( } PassingConvention::LayoutCompatible => { quote! { - let mut __return = ::core::mem::MaybeUninit::<#return_type_or_self>::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::<#return_type_or_self>::uninit(); #crate_root_path::detail::#thunk_ident( - &raw mut __return as *mut ::core::ffi::c_void + &raw mut __return as *mut ::__rust_core::ffi::c_void #( , #clone_prefixes #thunk_args #clone_suffixes )* ); __return.assume_init() @@ -1161,7 +1161,7 @@ fn generate_func_body( ::ctor::FnCtor::new( move |dest: *mut #return_type_or_self| { #crate_root_path::detail::#thunk_ident( - dest as *mut ::core::ffi::c_void + dest as *mut ::__rust_core::ffi::c_void #( , #thunk_args )* ); } @@ -1170,7 +1170,7 @@ fn generate_func_body( } PassingConvention::OwnedPtr => { quote! { - ::core::mem::transmute( + ::__rust_core::mem::transmute( #crate_root_path::detail::#thunk_ident( #( #clone_prefixes #thunk_args #clone_suffixes ),* ) @@ -2052,12 +2052,12 @@ fn function_signature( *features |= Feature::impl_trait_in_assoc_type; api_params.push(quote! {#ident: ::ctor::Ctor![#quoted_type_or_self]}); thunk_args.push( - quote! {::core::pin::Pin::into_inner_unchecked(::ctor::emplace!(#ident))}, + quote! {::__rust_core::pin::Pin::into_inner_unchecked(::ctor::emplace!(#ident))}, ); } PassingConvention::OwnedPtr => { api_params.push(quote! {#ident: #quoted_type_or_self}); - thunk_args.push(quote! {::core::mem::transmute(#ident)}); + thunk_args.push(quote! {::__rust_core::mem::transmute(#ident)}); } PassingConvention::Void => { unreachable!("parameter types should never be void") diff --git a/rs_bindings_from_cc/generate_bindings/generate_function_test.rs b/rs_bindings_from_cc/generate_bindings/generate_function_test.rs index e4756e389..afa94c21a 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_function_test.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_function_test.rs @@ -104,9 +104,9 @@ fn test_simple_function_with_types_from_other_target() -> Result<()> { #[inline(always)] pub fn DoSomething(mut param: ::dependency::ParamStruct) -> ::dependency::ReturnStruct { unsafe { - let mut __return = ::core::mem::MaybeUninit::<::dependency::ReturnStruct>::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::<::dependency::ReturnStruct>::uninit(); crate::detail::__rust_thunk___Z11DoSomething11ParamStruct( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, &mut param ); __return.assume_init() @@ -122,7 +122,7 @@ fn test_simple_function_with_types_from_other_target() -> Result<()> { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___Z11DoSomething11ParamStruct( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, param: &mut ::dependency::ParamStruct ); } @@ -408,7 +408,7 @@ fn test_impl_default_explicitly_defaulted_constructor() -> Result<()> { impl Default for DefaultedConstructor { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN20DefaultedConstructorC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -991,7 +991,7 @@ fn test_assign() -> Result<()> { quote! { impl<'b> ::ctor::Assign<&'b Self> for SomeStruct { #[inline(always)] - fn assign<'a>(self: ::core::pin::Pin<&'a mut Self>, other: &'b Self) { + fn assign<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>, other: &'b Self) { unsafe { crate::detail::__rust_thunk___ZN10SomeStructaSERKS_(self, other); } @@ -1018,7 +1018,7 @@ fn test_assign_nonreference_other() -> Result<()> { quote! { impl<'b> ::ctor::Assign<&'b Self> for SomeStruct { #[inline(always)] - fn assign<'a>(self: ::core::pin::Pin<&'a mut Self>, __param_0: &'b Self) { + fn assign<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>, __param_0: &'b Self) { unsafe { crate::detail::__rust_thunk___ZN10SomeStructaSERKS_(self, __param_0); } @@ -1045,7 +1045,7 @@ fn test_assign_nonreference_return() -> Result<()> { quote! { impl<'b> ::ctor::Assign<&'b Self> for SomeStruct { #[inline(always)] - fn assign<'a>(self: ::core::pin::Pin<&'a mut Self>, other: &'b Self) { + fn assign<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>, other: &'b Self) { unsafe { crate::detail::__rust_thunk___ZN10SomeStructaSERKS_(self, other); } @@ -1313,7 +1313,7 @@ fn test_nonunpin_mut_param() -> Result<()> { assert_rs_matches!( rs_api, quote! { - fn Function<'a>(s: ::core::pin::Pin<&'a mut crate::S>) { ... } + fn Function<'a>(s: ::__rust_core::pin::Pin<&'a mut crate::S>) { ... } } ); Ok(()) @@ -1357,7 +1357,7 @@ fn test_nonunpin_mut_self() -> Result<()> { assert_rs_matches!( rs_api, quote! { - fn Function<'a>(self: ::core::pin::Pin<&'a mut Self>) { ... } + fn Function<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { ... } } ); Ok(()) @@ -1375,7 +1375,7 @@ fn test_nonunpin_drop() -> Result<()> { assert_rs_matches!( rs_api, quote! { - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { ... } + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { ... } } ); Ok(()) @@ -1405,7 +1405,7 @@ fn test_nonunpin_0_arg_constructor() -> Result<()> { let () = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN14HasConstructorC1Ev(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___ZN14HasConstructorC1Ev(dest as *mut ::__rust_core::ffi::c_void); }) } } @@ -1439,7 +1439,7 @@ fn test_nonunpin_1_arg_constructor() -> Result<()> { let mut input = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN14HasConstructorC1Eh(dest as *mut ::core::ffi::c_void, input); + crate::detail::__rust_thunk___ZN14HasConstructorC1Eh(dest as *mut ::__rust_core::ffi::c_void, input); }) } } @@ -1473,7 +1473,7 @@ fn test_nonunpin_2_arg_constructor() -> Result<()> { let (mut input1, mut input2) = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN14HasConstructorC1Eha(dest as *mut ::core::ffi::c_void, input1, input2); + crate::detail::__rust_thunk___ZN14HasConstructorC1Eha(dest as *mut ::__rust_core::ffi::c_void, input1, input2); }) } } @@ -1525,7 +1525,7 @@ fn test_nonunpin_by_value_params() -> Result<()> { let (mut x, mut y, mut b) = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN14HasConstructorC1ERKiS_S_(dest as *mut ::core::ffi::c_void, x, y, b); + crate::detail::__rust_thunk___ZN14HasConstructorC1ERKiS_S_(dest as *mut ::__rust_core::ffi::c_void, x, y, b); }) } } @@ -1553,7 +1553,7 @@ fn test_nonunpin_return() -> Result<()> { -> impl ::ctor::Ctor + use<'a, 'b> { unsafe { ::ctor::FnCtor::new(move |dest: *mut crate::Nontrivial| { - crate::detail::__rust_thunk___Z14ReturnsByValueRKiS0_(dest as *mut ::core::ffi::c_void, x, y); + crate::detail::__rust_thunk___Z14ReturnsByValueRKiS0_(dest as *mut ::__rust_core::ffi::c_void, x, y); }) } @@ -1591,7 +1591,7 @@ fn test_nonunpin_const_return() -> Result<()> { -> impl ::ctor::Ctor + use<'a, 'b> { unsafe { ::ctor::FnCtor::new(move |dest: *mut crate::Nontrivial| { - crate::detail::__rust_thunk___Z14ReturnsByValueRKiS0_(dest as *mut ::core::ffi::c_void, x, y); + crate::detail::__rust_thunk___Z14ReturnsByValueRKiS0_(dest as *mut ::__rust_core::ffi::c_void, x, y); }) } @@ -1667,8 +1667,8 @@ fn test_unpin_by_value_return() -> Result<()> { #[inline(always)] pub fn foo() -> crate::Trivial { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); - crate::detail::__rust_thunk___Z3foov(&raw mut __return as *mut ::core::ffi::c_void); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); + crate::detail::__rust_thunk___Z3foov(&raw mut __return as *mut ::__rust_core::ffi::c_void); __return.assume_init() } } @@ -1678,7 +1678,7 @@ fn test_unpin_by_value_return() -> Result<()> { rs_api, quote! { pub(crate) unsafe fn __rust_thunk___Z3foov( - __return: *mut ::core::ffi::c_void + __return: *mut ::__rust_core::ffi::c_void ); } ); @@ -1776,12 +1776,12 @@ fn test_nonunpin_return_assign() -> Result<()> { quote! { impl<'b> ::ctor::Assign<&'b Self> for Nontrivial { #[inline(always)] - fn assign<'a>(self: ::core::pin::Pin<&'a mut Self>, other: &'b Self) { + fn assign<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>, other: &'b Self) { unsafe { let _ = ::ctor::emplace!(::ctor::FnCtor::new( move |dest: *mut Self| { crate::detail::__rust_thunk___ZN10NontrivialaSERKS_( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, self, other ); @@ -1826,7 +1826,7 @@ fn test_nonunpin_param() -> Result<()> { quote! { pub fn TakesByValue(x: ::ctor::Ctor![crate::Nontrivial]) { unsafe { - crate::detail::__rust_thunk___Z12TakesByValue10Nontrivial(::core::pin::Pin::into_inner_unchecked(::ctor::emplace!(x))) + crate::detail::__rust_thunk___Z12TakesByValue10Nontrivial(::__rust_core::pin::Pin::into_inner_unchecked(::ctor::emplace!(x))) } } } diff --git a/rs_bindings_from_cc/generate_bindings/generate_function_thunk.rs b/rs_bindings_from_cc/generate_bindings/generate_function_thunk.rs index 9c9df3f8d..c4942a5f7 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_function_thunk.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_function_thunk.rs @@ -167,18 +167,18 @@ pub fn generate_function_thunk( first_param.display(db) ) }; - out_param = Some(quote! { *mut ::core::ffi::c_void }); + out_param = Some(quote! { *mut ::__rust_core::ffi::c_void }); out_param_ident = Some(param_idents.next().unwrap().clone()); } else { match return_type.passing_convention() { PassingConvention::ComposablyBridged => { - out_param = Some(quote! { *mut ::core::ffi::c_uchar }); + out_param = Some(quote! { *mut ::__rust_core::ffi::c_uchar }); out_param_ident = Some(make_rs_ident("__return_abi_buffer")); return_type_fragment = None; } // For return types that can't be passed by value, create a new out parameter. PassingConvention::LayoutCompatible | PassingConvention::Ctor => { - out_param = Some(quote! { *mut ::core::ffi::c_void }); + out_param = Some(quote! { *mut ::__rust_core::ffi::c_void }); out_param_ident = Some(make_rs_ident("__return")); return_type_fragment = None; } @@ -202,7 +202,7 @@ pub fn generate_function_thunk( let param_types = out_param .into_iter() .chain(param_types.map(|param_type| match param_type.passing_convention() { - PassingConvention::ComposablyBridged => quote! { *const ::core::ffi::c_uchar }, + PassingConvention::ComposablyBridged => quote! { *const ::__rust_core::ffi::c_uchar }, PassingConvention::LayoutCompatible | PassingConvention::Ctor => { let param_type_tokens = param_type.to_token_stream(db); quote! {&mut #param_type_tokens} diff --git a/rs_bindings_from_cc/generate_bindings/generate_struct_and_union_test.rs b/rs_bindings_from_cc/generate_bindings/generate_struct_and_union_test.rs index b975659f0..741966b43 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_struct_and_union_test.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_struct_and_union_test.rs @@ -169,12 +169,12 @@ fn test_simple_struct() -> Result<()> { #[repr(C, align(4))] #[doc="CRUBIT_ANNOTATE: cpp_type=SomeStruct"] pub struct SomeStruct { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub public_int: ::ffi_11::c_int, #[doc = " Reason for representing this field as a blob of bytes:\n Types of non-public C++ fields can be elided away"] - pub(crate) protected_int: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) protected_int: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], #[doc = " Reason for representing this field as a blob of bytes:\n Types of non-public C++ fields can be elided away"] - pub(crate) private_int: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) private_int: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } } ); @@ -183,13 +183,13 @@ fn test_simple_struct() -> Result<()> { quote! { const _ : () = { ... - assert!(::core::mem::size_of::() == 12); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 12); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::SomeStruct: Drop); static_assertions::assert_not_impl_any!(crate::SomeStruct: Copy); - assert!(::core::mem::offset_of!(crate::SomeStruct, public_int) == 0); - assert!(::core::mem::offset_of!(crate::SomeStruct, protected_int) == 4); - assert!(::core::mem::offset_of!(crate::SomeStruct, private_int) == 8); + assert!(::__rust_core::mem::offset_of!(crate::SomeStruct, public_int) == 0); + assert!(::__rust_core::mem::offset_of!(crate::SomeStruct, protected_int) == 4); + assert!(::__rust_core::mem::offset_of!(crate::SomeStruct, private_int) == 8); ... }; } @@ -280,19 +280,19 @@ fn test_struct_vs_typedefed_struct() -> Result<()> { // In Rust, both have align == 16 and size == 16. assert_rs_matches!( rs_api, - quote! { assert!(::core::mem::size_of::() == 16); } + quote! { assert!(::__rust_core::mem::size_of::() == 16); } ); assert_rs_matches!( rs_api, - quote! { assert!(::core::mem::align_of::() == 16); } + quote! { assert!(::__rust_core::mem::align_of::() == 16); } ); assert_rs_matches!( rs_api, - quote! { assert!(::core::mem::size_of::() == 16); } + quote! { assert!(::__rust_core::mem::size_of::() == 16); } ); assert_rs_matches!( rs_api, - quote! { assert!(::core::mem::align_of::() == 16); } + quote! { assert!(::__rust_core::mem::align_of::() == 16); } ); Ok(()) @@ -318,13 +318,13 @@ fn test_record_with_unsupported_field_type() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=StructWithUnsupportedField"] pub struct StructWithUnsupportedField { #[doc = " Doc comment for `my_field`.\n \n Reason for representing this field as a blob of bytes:\n Unsupported `volatile` qualifier: volatile int"] - pub(crate) my_field: [::core::mem::MaybeUninit; 4], + pub(crate) my_field: [::__rust_core::mem::MaybeUninit; 4], } ... const _: () = { ... assert!( - ::core::mem::offset_of!(crate::StructWithUnsupportedField, my_field) == 0); + ::__rust_core::mem::offset_of!(crate::StructWithUnsupportedField, my_field) == 0); ... }; } @@ -363,8 +363,8 @@ fn test_struct_with_only_bitfields() -> Result<()> { quote! { const _: () = { ... - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); ... }; } @@ -392,14 +392,14 @@ fn test_struct_with_unnamed_bitfield_member() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=SomeStruct"] pub struct SomeStruct { pub first_field: ::ffi_11::c_int, ... - __bitfields1: [::core::mem::MaybeUninit; 4], + __bitfields1: [::__rust_core::mem::MaybeUninit; 4], pub last_field: ::ffi_11::c_int, } ... const _: () = { ... - assert!(::core::mem::offset_of!(crate::SomeStruct, first_field) == 0); - assert!(::core::mem::offset_of!(crate::SomeStruct, last_field) == 8); + assert!(::__rust_core::mem::offset_of!(crate::SomeStruct, first_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::SomeStruct, last_field) == 8); ... }; } @@ -564,21 +564,21 @@ fn test_struct_with_unnamed_struct_and_union_members() -> Result<()> { pub struct StructWithUnnamedMembers { pub first_field: ::ffi_11::c_int, #[doc =" Reason for representing this field as a blob of bytes:\n Unsupported type 'StructWithUnnamedMembers::(anonymous struct at ./ir_from_cc_virtual_header.h:7:11)': No generated bindings found for ''"] - pub(crate) __unnamed_field1: [::core::mem::MaybeUninit; 8], + pub(crate) __unnamed_field1: [::__rust_core::mem::MaybeUninit; 8], #[doc =" Reason for representing this field as a blob of bytes:\n Unsupported type 'StructWithUnnamedMembers::(anonymous union at ./ir_from_cc_virtual_header.h:11:11)': No generated bindings found for ''"] - pub(crate) __unnamed_field2: [::core::mem::MaybeUninit; 4], + pub(crate) __unnamed_field2: [::__rust_core::mem::MaybeUninit; 4], pub last_field: ::ffi_11::c_int, } ... const _: () = { ... - assert!(::core::mem::offset_of!( + assert!(::__rust_core::mem::offset_of!( crate::StructWithUnnamedMembers, first_field) == 0); - assert!(::core::mem::offset_of!( + assert!(::__rust_core::mem::offset_of!( crate::StructWithUnnamedMembers, __unnamed_field1) == 4); - assert!(::core::mem::offset_of!( + assert!(::__rust_core::mem::offset_of!( crate::StructWithUnnamedMembers, __unnamed_field2) == 12); - assert!(::core::mem::offset_of!( + assert!(::__rust_core::mem::offset_of!( crate::StructWithUnnamedMembers, last_field) == 16); ... }; @@ -686,7 +686,7 @@ fn test_base_class_subobject_layout() -> Result<()> { #[repr(C, align(8))] #[doc="CRUBIT_ANNOTATE: cpp_type=Derived"] pub struct Derived { - __non_field_data: [::core::mem::MaybeUninit; 10], + __non_field_data: [::__rust_core::mem::MaybeUninit; 10], pub z: ::ffi_11::c_short, } } @@ -712,7 +712,7 @@ fn test_base_class_multiple_inheritance_subobject_layout() -> Result<()> { #[repr(C, align(8))] #[doc="CRUBIT_ANNOTATE: cpp_type=Derived"] pub struct Derived { - __non_field_data: [::core::mem::MaybeUninit; 10], + __non_field_data: [::__rust_core::mem::MaybeUninit; 10], pub z: ::ffi_11::c_short, } } @@ -738,7 +738,7 @@ fn test_base_class_deep_inheritance_subobject_layout() -> Result<()> { #[repr(C, align(8))] #[doc="CRUBIT_ANNOTATE: cpp_type=Derived"] pub struct Derived { - __non_field_data: [::core::mem::MaybeUninit; 10], + __non_field_data: [::__rust_core::mem::MaybeUninit; 10], pub z: ::ffi_11::c_short, } } @@ -763,7 +763,7 @@ fn test_base_class_subobject_fieldless_layout() -> Result<()> { #[repr(C, align(8))] #[doc="CRUBIT_ANNOTATE: cpp_type=Derived"] pub struct Derived { - __non_field_data: [::core::mem::MaybeUninit; 16], + __non_field_data: [::__rust_core::mem::MaybeUninit; 16], } } ); @@ -786,7 +786,7 @@ fn test_base_class_subobject_empty_fieldless() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=Derived"] pub struct Derived { ... - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } } ); @@ -834,7 +834,7 @@ fn test_non_aggregate_struct_private_field() -> Result<()> { rs_api, quote! { pub struct NonAggregate { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub x: ::ffi_11::c_short, } } @@ -865,9 +865,9 @@ fn test_no_unique_address() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=Struct"] pub struct Struct { ... - pub(crate) field1: [::core::mem::MaybeUninit; 8], + pub(crate) field1: [::__rust_core::mem::MaybeUninit; 8], ... - pub(crate) field2: [::core::mem::MaybeUninit; 2], + pub(crate) field2: [::__rust_core::mem::MaybeUninit; 2], pub z: ::ffi_11::c_short, } } @@ -916,9 +916,9 @@ fn test_no_unique_address_last_field() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=Struct"] pub struct Struct { ... - pub(crate) field1: [::core::mem::MaybeUninit; 8], + pub(crate) field1: [::__rust_core::mem::MaybeUninit; 8], ... - pub(crate) field2: [::core::mem::MaybeUninit; 8], + pub(crate) field2: [::__rust_core::mem::MaybeUninit; 8], } } ); @@ -1085,7 +1085,7 @@ fn test_union_with_opaque_field() -> Result<()> { #[repr(C, align(4))] #[doc="CRUBIT_ANNOTATE: cpp_type=MyUnion"] pub union MyUnion { ... - first_field: [::core::mem::MaybeUninit; 56], + first_field: [::__rust_core::mem::MaybeUninit; 56], pub second_field: ::ffi_11::c_int, } } @@ -1096,8 +1096,8 @@ fn test_union_with_opaque_field() -> Result<()> { quote! { const _: () = { ... - assert!(::core::mem::size_of::() == 56); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 56); + assert!(::__rust_core::mem::align_of::() == 4); ... }; } @@ -1122,9 +1122,9 @@ fn test_currently_no_offset_assertions_for_unions() -> Result<()> { quote! { const _: () = { ... - assert!(::core::mem::offset_of!( + assert!(::__rust_core::mem::offset_of!( crate::SomeUnion, some_field) == 0); - assert!(::core::mem::offset_of!( + assert!(::__rust_core::mem::offset_of!( crate::SomeUnion, some_bigger_field) == 0); ... }; @@ -1156,7 +1156,7 @@ fn test_union_with_private_fields() -> Result<()> { pub union SomeUnionWithPrivateFields { pub public_field: ::ffi_11::c_int, #[doc = " Reason for representing this field as a blob of bytes:\n Types of non-public C++ fields can be elided away"] - pub(crate) private_field: [::core::mem::MaybeUninit; 8], + pub(crate) private_field: [::__rust_core::mem::MaybeUninit; 8], } } ); @@ -1166,8 +1166,8 @@ fn test_union_with_private_fields() -> Result<()> { quote! { const _: () = { ... - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::SomeUnionWithPrivateFields: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeUnionWithPrivateFields: Drop); ... @@ -1224,7 +1224,7 @@ fn test_empty_struct() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=EmptyStruct"] pub struct EmptyStruct { ... - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } } ); @@ -1234,8 +1234,8 @@ fn test_empty_struct() -> Result<()> { quote! { const _: () = { ... - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); ... }; } @@ -1261,7 +1261,7 @@ fn test_empty_union() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=EmptyUnion"] pub union EmptyUnion { ... - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } } ); @@ -1271,8 +1271,8 @@ fn test_empty_union() -> Result<()> { quote! { const _: () = { ... - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); ... }; } @@ -1301,7 +1301,7 @@ fn test_union_field_with_nontrivial_destructor() -> Result<()> { #[doc="CRUBIT_ANNOTATE: cpp_type=UnionWithNontrivialField"] pub union UnionWithNontrivialField { pub trivial_field: ::ffi_11::c_int, - pub nontrivial_field: ::core::mem::ManuallyDrop, + pub nontrivial_field: ::__rust_core::mem::ManuallyDrop, } } ); @@ -1311,8 +1311,8 @@ fn test_union_field_with_nontrivial_destructor() -> Result<()> { quote! { const _: () = { ... - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); ... }; } @@ -1349,7 +1349,7 @@ fn test_union_with_constructors() -> Result<()> { impl Default for UnionWithDefaultConstructors { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN28UnionWithDefaultConstructorsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -1560,11 +1560,11 @@ fn test_implicit_template_specializations_are_sorted_by_mangled_name() -> Result ... const _: () = { ... - assert!(::core::mem::size_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); ... - assert!(::core::mem::size_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); ... - assert!(::core::mem::size_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); ... } ... @@ -1767,7 +1767,7 @@ fn test_supported_suppressed_field_types() -> Result<()> { quote! { struct Trivial { ... - pub(crate) hidden_field: [::core::mem::MaybeUninit; 8], + pub(crate) hidden_field: [::__rust_core::mem::MaybeUninit; 8], ... }} ); @@ -1795,7 +1795,7 @@ fn test_supported_nontrivial_field() -> Result<()> { quote! { pub struct Outer { ... - pub(crate) inner_field: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], + pub(crate) inner_field: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 8], pub inner_ptr_field: *mut crate::Inner, }} ); @@ -1818,7 +1818,7 @@ fn test_supported_no_unique_address_field() -> Result<()> { quote! { pub struct Struct { ... - pub(crate) field: [::core::mem::MaybeUninit; 1], + pub(crate) field: [::__rust_core::mem::MaybeUninit; 1], } } ); @@ -1936,7 +1936,7 @@ fn test_display() -> Result<()> { assert_rs_matches!( rs_api, quote! { - impl ::core::fmt::Display for CanDisplay { + impl ::__rust_core::fmt::Display for CanDisplay { ... } } diff --git a/rs_bindings_from_cc/generate_bindings/lib.rs b/rs_bindings_from_cc/generate_bindings/lib.rs index ebb904b63..2248861ae 100644 --- a/rs_bindings_from_cc/generate_bindings/lib.rs +++ b/rs_bindings_from_cc/generate_bindings/lib.rs @@ -572,6 +572,8 @@ pub fn generate_bindings_tokens( #![allow(unused)] __NEWLINE__ #![deny(warnings)] __NEWLINE__ __NEWLINE__ + extern crate core as __rust_core; __NEWLINE__ + #extern_crate_alloc #main_api @@ -978,12 +980,12 @@ fn crubit_abi_type(db: &BindingsGenerator, rs_type_kind: RsTypeKind) -> Result bail!("values of type `void` cannot be bridged by value"), Primitive::Float => CrubitAbiType::transmute("f32", "float"), Primitive::Double => CrubitAbiType::transmute("f64", "double"), - Primitive::Char => CrubitAbiType::transmute("::core::ffi::c_char", "char"), + Primitive::Char => CrubitAbiType::transmute("::__rust_core::ffi::c_char", "char"), Primitive::SignedChar => CrubitAbiType::SignedChar, Primitive::UnsignedChar => CrubitAbiType::UnsignedChar, - Primitive::Short => CrubitAbiType::transmute("::core::ffi::c_short", "short"), - Primitive::Int => CrubitAbiType::transmute("::core::ffi::c_int", "int"), - Primitive::Long => CrubitAbiType::transmute("::core::ffi::c_long", "long"), + Primitive::Short => CrubitAbiType::transmute("::__rust_core::ffi::c_short", "short"), + Primitive::Int => CrubitAbiType::transmute("::__rust_core::ffi::c_int", "int"), + Primitive::Long => CrubitAbiType::transmute("::__rust_core::ffi::c_long", "long"), Primitive::LongLong => CrubitAbiType::LongLong, Primitive::UnsignedShort => CrubitAbiType::UnsignedShort, Primitive::UnsignedInt => CrubitAbiType::UnsignedInt, @@ -1113,7 +1115,7 @@ fn crubit_abi_type(db: &BindingsGenerator, rs_type_kind: RsTypeKind) -> Result #result_type_tokens { + context: *mut ::__rust_core::ffi::c_void| -> #result_type_tokens { ::bridge_rust::unstable_return!(@ // Crubit ABI details #result_type_crubit_abi_expr_tokens, @@ -1311,7 +1313,7 @@ fn generate_dyn_callable_invoker_and_manager_defs( } PassingConvention::LayoutCompatible => { ffi_to_rust_transforms.extend(quote! { - let #ident = ::core::ptr::read(#ident); + let #ident = ::__rust_core::ptr::read(#ident); }); let ty_tokens = ty.to_token_stream(db); Some(quote! { , #ident: *mut #ty_tokens }) @@ -1322,7 +1324,7 @@ fn generate_dyn_callable_invoker_and_manager_defs( ffi_to_rust_transforms.extend(quote! { let #ident = ::bridge_rust::internal::decode(#crubit_abi_type_expr_tokens, #ident); }); - Some(quote! { , #ident: *mut ::core::ffi::c_uchar }) + Some(quote! { , #ident: *mut ::__rust_core::ffi::c_uchar }) } PassingConvention::Ctor => None, PassingConvention::OwnedPtr => None, @@ -1344,9 +1346,9 @@ fn generate_dyn_callable_invoker_and_manager_defs( quote! { // SAFETY: f is guaranteed to be valid for reads and writes, is properly aligned, // and points to a properly initialized value of the correct type. - ::core::ptr::replace(f, ::alloc::boxed::Box::new( + ::__rust_core::ptr::replace(f, ::alloc::boxed::Box::new( |#(_: #param_type_tokens),*| #rust_return_type_fragment { - ::core::unreachable!("Called FnOnce after it was moved"); + ::__rust_core::unreachable!("Called FnOnce after it was moved"); } )) } @@ -1368,7 +1370,7 @@ fn generate_dyn_callable_invoker_and_manager_defs( invoke_rust_and_return_to_ffi = quote! { match #invoke_rust_and_return_to_ffi { result => unsafe { - ::core::ptr::write(out, result); + ::__rust_core::ptr::write(out, result); } } }; @@ -1389,7 +1391,7 @@ fn generate_dyn_callable_invoker_and_manager_defs( }; return_type_fragment = None; - out_param = Some(quote! { , bridge_buffer: *mut ::core::ffi::c_uchar }); + out_param = Some(quote! { , bridge_buffer: *mut ::__rust_core::ffi::c_uchar }); } PassingConvention::Ctor => { return None; diff --git a/rs_bindings_from_cc/test/annotations/do_not_bind_rs_api.rs b/rs_bindings_from_cc/test/annotations/do_not_bind_rs_api.rs index f106b6684..bd61d1f27 100644 --- a/rs_bindings_from_cc/test/annotations/do_not_bind_rs_api.rs +++ b/rs_bindings_from_cc/test/annotations/do_not_bind_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod crubit { pub mod test { /// Generated from: rs_bindings_from_cc/test/annotations/do_not_bind.h;l=12 @@ -21,7 +22,7 @@ pub mod crubit { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: ArgumentToBoundOverload pub struct ArgumentToBoundOverload { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ArgumentToBoundOverload {} impl !Sync for ArgumentToBoundOverload {} @@ -34,7 +35,7 @@ pub mod crubit { impl Default for ArgumentToBoundOverload { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6crubit4test23ArgumentToBoundOverloadC1Ev( &raw mut tmp as *mut _, @@ -49,7 +50,7 @@ pub mod crubit { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: ArgumentToUnboundOverload pub struct ArgumentToUnboundOverload { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ArgumentToUnboundOverload {} impl !Sync for ArgumentToUnboundOverload {} @@ -62,7 +63,7 @@ pub mod crubit { impl Default for ArgumentToUnboundOverload { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6crubit4test25ArgumentToUnboundOverloadC1Ev( &raw mut tmp as *mut _, @@ -89,7 +90,7 @@ pub mod crubit { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: StructWithDoNotBindConstructor pub struct StructWithDoNotBindConstructor { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for StructWithDoNotBindConstructor {} impl !Sync for StructWithDoNotBindConstructor {} @@ -103,7 +104,7 @@ pub mod crubit { #[inline(always)] fn from(args: crate::crubit::test::ArgumentToBoundOverload) -> Self { let mut __param_0 = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6crubit4test30StructWithDoNotBindConstructorC1ENS0_23ArgumentToBoundOverloadE(&raw mut tmp as*mut _,&mut __param_0); tmp.assume_init() @@ -126,7 +127,7 @@ pub mod crubit { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: StructWithDoNotBindMethod pub struct StructWithDoNotBindMethod { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for StructWithDoNotBindMethod {} impl !Sync for StructWithDoNotBindMethod {} @@ -154,7 +155,7 @@ pub mod crubit { impl Default for StructWithDoNotBindMethod { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6crubit4test25StructWithDoNotBindMethodC1Ev( &raw mut tmp as *mut _, @@ -181,20 +182,20 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN6crubit4test23ArgumentToBoundOverloadC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test25ArgumentToUnboundOverloadC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test11DoNotBindFnENS0_23ArgumentToBoundOverloadE( __param_0: &mut crate::crubit::test::ArgumentToBoundOverload, ); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test30StructWithDoNotBindConstructorC1ENS0_23ArgumentToBoundOverloadE( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: &mut crate::crubit::test::ArgumentToBoundOverload, ); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test25StructWithDoNotBindMethodC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test25StructWithDoNotBindMethod15DoNotBindMethodENS0_23ArgumentToBoundOverloadE( __this: *mut crate::crubit::test::StructWithDoNotBindMethod, @@ -204,23 +205,27 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::crubit::test::ArgumentToBoundOverload: Copy,Clone); static_assertions::assert_not_impl_any!(crate::crubit::test::ArgumentToBoundOverload: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::crubit::test::ArgumentToUnboundOverload: Copy,Clone); static_assertions::assert_not_impl_any!(crate::crubit::test::ArgumentToUnboundOverload: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!( + ::__rust_core::mem::size_of::() == 1 + ); + assert!( + ::__rust_core::mem::align_of::() == 1 + ); static_assertions::assert_impl_all!(crate::crubit::test::StructWithDoNotBindConstructor: Copy,Clone); static_assertions::assert_not_impl_any!(crate::crubit::test::StructWithDoNotBindConstructor: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::crubit::test::StructWithDoNotBindMethod: Copy,Clone); static_assertions::assert_not_impl_any!(crate::crubit::test::StructWithDoNotBindMethod: Drop); }; diff --git a/rs_bindings_from_cc/test/annotations/owned_ptr_rs_api.rs b/rs_bindings_from_cc/test/annotations/owned_ptr_rs_api.rs index 956403b70..ad993d8b3 100644 --- a/rs_bindings_from_cc/test/annotations/owned_ptr_rs_api.rs +++ b/rs_bindings_from_cc/test/annotations/owned_ptr_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// An example of a C++ struct that supports ownership via the raw pointer. /// /// The CRUBIT_OWNED_PTR_TYPE annotation is used to specify the Rust type that @@ -25,7 +26,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Thing pub struct RawThing { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub value: i32, } impl !Send for RawThing {} @@ -55,7 +56,7 @@ impl RawThing { /// THIS TYPE REQUIRES A MANUAL DROP IMPLEMENTATION. /// You MUST provide an `impl OwnedThing { pub fn DropImpl(&mut self) { /*...*/ } }` block in a separate Rust file (e.g., via `additional_rust_srcs`). Failure to do so will result in a compile-time error: `method not found in `OwnedThing``. #[repr(transparent)] -pub struct OwnedThing(::core::ptr::NonNull); +pub struct OwnedThing(::__rust_core::ptr::NonNull); impl Drop for OwnedThing { fn drop(&mut self) { // IMPORTANT: The DropImpl method for `{}` MUST be implemented in a user-written .rs file (e.g., using `additional_rust_srcs`). @@ -70,7 +71,7 @@ impl From for RawThing { #[inline(always)] fn from(args: i32) -> Self { let mut value = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5ThingC1Ei(&raw mut tmp as *mut _, value); tmp.assume_init() @@ -104,7 +105,7 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN5ThingC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, value: i32, ); pub(crate) unsafe fn __rust_thunk___ZN5Thing5CloseEv(__this: *mut crate::RawThing); @@ -112,9 +113,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::RawThing: Copy,Clone); static_assertions::assert_not_impl_any!(crate::RawThing: Drop); - assert!(::core::mem::offset_of!(crate::RawThing, value) == 0); + assert!(::__rust_core::mem::offset_of!(crate::RawThing, value) == 0); }; diff --git a/rs_bindings_from_cc/test/annotations/owned_ptr_user_rs_api.rs b/rs_bindings_from_cc/test/annotations/owned_ptr_user_rs_api.rs index 453c5b75c..85b1c4045 100644 --- a/rs_bindings_from_cc/test/annotations/owned_ptr_user_rs_api.rs +++ b/rs_bindings_from_cc/test/annotations/owned_ptr_user_rs_api.rs @@ -14,13 +14,16 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// An example of a C++ file that defines functions that create a /// CRUBIT_OWNED_PTR type as well as consume it. /// /// Generated from: rs_bindings_from_cc/test/annotations/owned_ptr_user.h;l=14 #[inline(always)] pub fn MakeOwnedThing(value: ::ffi_11::c_int) -> ::owned_ptr::OwnedThing { - unsafe { ::core::mem::transmute(crate::detail::__rust_thunk___Z14MakeOwnedThingi(value)) } + unsafe { + ::__rust_core::mem::transmute(crate::detail::__rust_thunk___Z14MakeOwnedThingi(value)) + } } /// Generated from: rs_bindings_from_cc/test/annotations/owned_ptr_user.h;l=16 @@ -37,7 +40,7 @@ pub fn MakeThing(value: ::ffi_11::c_int) -> *mut ::owned_ptr::RawThing { /// Generated from: rs_bindings_from_cc/test/annotations/owned_ptr_user.h;l=18 #[inline(always)] pub unsafe fn ThingToValue(thingptr: ::owned_ptr::OwnedThing) -> ::ffi_11::c_int { - crate::detail::__rust_thunk___Z12ThingToValueP5Thing(::core::mem::transmute(thingptr)) + crate::detail::__rust_thunk___Z12ThingToValueP5Thing(::__rust_core::mem::transmute(thingptr)) } /// # Safety diff --git a/rs_bindings_from_cc/test/annotations/rust_name_rs_api.rs b/rs_bindings_from_cc/test/annotations/rust_name_rs_api.rs index c1ea4cfc2..ea400e207 100644 --- a/rs_bindings_from_cc/test/annotations/rust_name_rs_api.rs +++ b/rs_bindings_from_cc/test/annotations/rust_name_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod crubit { pub mod test { /// Generated from: rs_bindings_from_cc/test/annotations/rust_name.h;l=13 @@ -27,7 +28,7 @@ pub mod crubit { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: StructOldName pub struct StructNewName { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for StructNewName {} impl !Sync for StructNewName {} @@ -40,7 +41,7 @@ pub mod crubit { impl Default for StructNewName { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6crubit4test13StructOldNameC1Ev( &raw mut tmp as *mut _, @@ -55,7 +56,7 @@ pub mod crubit { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: SomeStruct pub struct SomeStruct { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub field_new_name: ::ffi_11::c_int, } impl !Send for SomeStruct {} @@ -73,7 +74,7 @@ pub mod crubit { b: ::ffi_11::c_int, c: ::ffi_11::c_int, ) -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6crubit4test10SomeStructC1Eiii( &raw mut tmp as *mut _, @@ -101,7 +102,7 @@ pub mod crubit { impl Default for SomeStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6crubit4test10SomeStructC1Ev( &raw mut tmp as *mut _, @@ -129,10 +130,10 @@ mod detail { unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN6crubit4test13FreeFnOldNameEv(); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test13StructOldNameC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test10SomeStructC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN6crubit4test10SomeStructC1Eiii( __this: *mut crate::crubit::test::SomeStruct, @@ -147,14 +148,14 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::crubit::test::StructNewName: Copy,Clone); static_assertions::assert_not_impl_any!(crate::crubit::test::StructNewName: Drop); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::crubit::test::SomeStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::crubit::test::SomeStruct: Drop); - assert!(::core::mem::offset_of!(crate::crubit::test::SomeStruct, field_new_name) == 0); + assert!(::__rust_core::mem::offset_of!(crate::crubit::test::SomeStruct, field_new_name) == 0); }; diff --git a/rs_bindings_from_cc/test/assume_lifetimes/free_function_rs_api.rs b/rs_bindings_from_cc/test/assume_lifetimes/free_function_rs_api.rs index caeea03c2..9a3c4f962 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/free_function_rs_api.rs +++ b/rs_bindings_from_cc/test/assume_lifetimes/free_function_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/free_function.h;l=8 #[inline(always)] pub fn increment_int_ref<'a>(a: &'a mut ::ffi_11::c_int) -> &'a mut ::ffi_11::c_int { diff --git a/rs_bindings_from_cc/test/assume_lifetimes/member_function_rs_api.rs b/rs_bindings_from_cc/test/assume_lifetimes/member_function_rs_api.rs index d493d4b66..3630bec4f 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/member_function_rs_api.rs +++ b/rs_bindings_from_cc/test/assume_lifetimes/member_function_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/member_function.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -44,7 +45,7 @@ impl S { impl Default for S { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN1SC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -56,7 +57,7 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN1SC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN1SC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZNK1S12int_accessorEv<'__this>( __this: &'__this crate::S, ) -> &'__this ::ffi_11::c_int; @@ -67,9 +68,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::S: Copy,Clone); static_assertions::assert_not_impl_any!(crate::S: Drop); - assert!(::core::mem::offset_of!(crate::S, int_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::S, int_field) == 0); }; diff --git a/rs_bindings_from_cc/test/assume_lifetimes/simple_string_view_rs_api.rs b/rs_bindings_from_cc/test/assume_lifetimes/simple_string_view_rs_api.rs index ca0b3ff40..a860aa3a3 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/simple_string_view_rs_api.rs +++ b/rs_bindings_from_cc/test/assume_lifetimes/simple_string_view_rs_api.rs @@ -14,13 +14,14 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/simple_string_view.h;l=10 #[derive(Clone, Copy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SV pub struct SV<'a> { - __non_field_data: [::core::mem::MaybeUninit; 1], - __marker_a: ::core::marker::PhantomData<&'a ()>, + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], + __marker_a: ::__rust_core::marker::PhantomData<&'a ()>, } impl<'a> !Send for SV<'a> {} impl<'a> !Sync for SV<'a> {} @@ -34,7 +35,7 @@ forward_declare::unsafe_define!(forward_declare::symbol!("SV"), crate::SV<'_>); impl<'a> Default for SV<'a> { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN2SVC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -46,13 +47,13 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN2SVC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN2SVC1Ev(__this: *mut ::__rust_core::ffi::c_void); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SV: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SV: Drop); }; diff --git a/rs_bindings_from_cc/test/assume_lifetimes/string_view_rs_api.rs b/rs_bindings_from_cc/test/assume_lifetimes/string_view_rs_api.rs index d465aa6a3..427e7abf5 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/string_view_rs_api.rs +++ b/rs_bindings_from_cc/test/assume_lifetimes/string_view_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/string_view.h;l=12 #[inline(always)] pub fn string_view_sink<'s>(mut s: ::cc_std::std::string_view<'s>) { @@ -28,8 +29,9 @@ pub fn string_view_return<'s>( mut s: ::cc_std::std::string_view<'s>, ) -> ::cc_std::std::string_view<'s> { unsafe { - let mut __return = ::core::mem::MaybeUninit::<::cc_std::std::string_view<'s>>::uninit(); - crate::detail::__rust_thunk___Z18string_view_returnNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEE(&raw mut __return as*mut::core::ffi::c_void,&mut s); + let mut __return = + ::__rust_core::mem::MaybeUninit::<::cc_std::std::string_view<'s>>::uninit(); + crate::detail::__rust_thunk___Z18string_view_returnNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEE(&raw mut __return as*mut::__rust_core::ffi::c_void,&mut s); __return.assume_init() } } @@ -42,8 +44,8 @@ pub fn ambiguous_string_view_return<'a, 'b>( ) -> ::cc_std::std::__u::raw_string_view { unsafe { let mut __return = - ::core::mem::MaybeUninit::<::cc_std::std::__u::raw_string_view>::uninit(); - crate::detail::__rust_thunk___Z28ambiguous_string_view_returnNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEES3_(&raw mut __return as*mut::core::ffi::c_void,&mut a,&mut b); + ::__rust_core::mem::MaybeUninit::<::cc_std::std::__u::raw_string_view>::uninit(); + crate::detail::__rust_thunk___Z28ambiguous_string_view_returnNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEES3_(&raw mut __return as*mut::__rust_core::ffi::c_void,&mut a,&mut b); __return.assume_init() } } @@ -63,8 +65,9 @@ pub fn unambiguous_string_view_return_annotated<'a>( mut y: ::cc_std::std::string_view<'a>, ) -> ::cc_std::std::string_view<'a> { unsafe { - let mut __return = ::core::mem::MaybeUninit::<::cc_std::std::string_view<'a>>::uninit(); - crate::detail::__rust_thunk___Z40unambiguous_string_view_return_annotatedNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEES3_(&raw mut __return as*mut::core::ffi::c_void,&mut x,&mut y); + let mut __return = + ::__rust_core::mem::MaybeUninit::<::cc_std::std::string_view<'a>>::uninit(); + crate::detail::__rust_thunk___Z40unambiguous_string_view_return_annotatedNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEES3_(&raw mut __return as*mut::__rust_core::ffi::c_void,&mut x,&mut y); __return.assume_init() } } @@ -272,14 +275,14 @@ mod detail { pub(crate) unsafe fn __rust_thunk___Z18string_view_returnNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEE< 's, >( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, s: &mut ::cc_std::std::string_view<'s>, ); pub(crate) unsafe fn __rust_thunk___Z28ambiguous_string_view_returnNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEES3_< 'a, 'b, >( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, a: &mut ::cc_std::std::string_view<'a>, b: &mut ::cc_std::std::string_view<'b>, ); @@ -291,7 +294,7 @@ mod detail { pub(crate) unsafe fn __rust_thunk___Z40unambiguous_string_view_return_annotatedNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEES3_< 'a, >( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, x: &mut ::cc_std::std::string_view<'a>, y: &mut ::cc_std::std::string_view<'a>, ); diff --git a/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs b/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs index d00153ce3..c38030d82 100644 --- a/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs +++ b/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs @@ -15,6 +15,7 @@ #![deny(warnings)] extern crate alloc; +extern crate core as __rust_core; pub mod absl_functional_internal { /// Calls the invocable and returns void. @@ -23,11 +24,14 @@ pub mod absl_functional_internal { #[inline(always)] pub fn CallVoidVoid( f: ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { unsafe { - crate::detail::__rust_thunk___ZN24absl_functional_internal12CallVoidVoidEN4absl12AnyInvocableIFvvOEEE(::bridge_rust::unstable_encode!(@::any_invocable::AnyInvocableAbi::::new(::alloc::boxed::Box::new(||{ ::core::panic!("moved-from value") }),|managed: ::any_invocable::ManagedState,invoker: unsafe extern "C" fn()|->::alloc::boxed::Box{ let c_invoker=unsafe{ ::core::mem::transmute::(invoker) };::alloc::boxed::Box::new(move||{ unsafe{ c_invoker(managed.state()) }; }) },),::any_invocable::AnyInvocableAbi,f).as_ptr()as*const u8) + crate::detail::__rust_thunk___ZN24absl_functional_internal12CallVoidVoidEN4absl12AnyInvocableIFvvOEEE(::bridge_rust::unstable_encode!(@::any_invocable::AnyInvocableAbi::::new(::alloc::boxed::Box::new(||{ ::__rust_core::panic!("moved-from value") }),|managed: ::any_invocable::ManagedState,invoker: unsafe extern "C" fn()|->::alloc::boxed::Box{ let c_invoker=unsafe{ ::__rust_core::mem::transmute::(invoker) };::alloc::boxed::Box::new(move||{ unsafe{ c_invoker(managed.state()) }; }) },),::any_invocable::AnyInvocableAbi,f).as_ptr()as*const u8) } } @@ -36,13 +40,13 @@ pub mod absl_functional_internal { /// Generated from: rs_bindings_from_cc/test/consume_absl/absl_functional.h;l=16 #[inline(always)] pub fn ReturnIntVoid() -> ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, > { unsafe { - ::bridge_rust::unstable_return!(@::any_invocable::AnyInvocableAbi::::ffi_11::c_int+::core::marker::Send+::core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: ::ffi_11::c_int|->::ffi_11::c_int{ ::core::panic!("moved-from value") }),|managed: ::any_invocable::ManagedState,invoker: unsafe extern "C" fn()|->::alloc::boxed::Box::ffi_11::c_int+::core::marker::Send+::core::marker::Sync+'static>{ let c_invoker=unsafe{ ::core::mem::transmute::::ffi_11::c_int>(invoker) };::alloc::boxed::Box::new(move|param_0: ::ffi_11::c_int|->::ffi_11::c_int{ unsafe{ c_invoker(managed.state(),param_0) } }) },),::any_invocable::AnyInvocableAbi::ffi_11::c_int+::core::marker::Send+::core::marker::Sync+'static>,|__return_abi_buffer|{ crate::detail::__rust_thunk___ZN24absl_functional_internal13ReturnIntVoidEv(__return_abi_buffer,); }) + ::bridge_rust::unstable_return!(@::any_invocable::AnyInvocableAbi::::ffi_11::c_int+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: ::ffi_11::c_int|->::ffi_11::c_int{ ::__rust_core::panic!("moved-from value") }),|managed: ::any_invocable::ManagedState,invoker: unsafe extern "C" fn()|->::alloc::boxed::Box::ffi_11::c_int+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>{ let c_invoker=unsafe{ ::__rust_core::mem::transmute::::ffi_11::c_int>(invoker) };::alloc::boxed::Box::new(move|param_0: ::ffi_11::c_int|->::ffi_11::c_int{ unsafe{ c_invoker(managed.state(),param_0) } }) },),::any_invocable::AnyInvocableAbi::ffi_11::c_int+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>,|__return_abi_buffer|{ crate::detail::__rust_thunk___ZN24absl_functional_internal13ReturnIntVoidEv(__return_abi_buffer,); }) } } } @@ -485,23 +489,26 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN24absl_functional_internal12CallVoidVoidEN4absl12AnyInvocableIFvvOEEE( - f: *const ::core::ffi::c_uchar, + f: *const ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___ZN24absl_functional_internal13ReturnIntVoidEv( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); } #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN4absl12AnyInvocableIFvvOEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { (unsafe { - ::core::ptr::replace( + ::__rust_core::ptr::replace( f, ::alloc::boxed::Box::new(|| { - ::core::unreachable!("Called FnOnce after it was moved"); + ::__rust_core::unreachable!("Called FnOnce after it was moved"); }), ) })(); @@ -510,10 +517,16 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN4absl12AnyInvocableIFvvOEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { ::dyn_callable_rs::manager(operation, from, to); @@ -521,9 +534,9 @@ mod detail { #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN4absl12AnyInvocableIKFiiEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, param_0: ::ffi_11::c_int, @@ -534,15 +547,15 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN4absl12AnyInvocableIKFiiEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, ) { diff --git a/rs_bindings_from_cc/test/display/displayables_api.rs b/rs_bindings_from_cc/test/display/displayables_api.rs index 831dafbfa..284fb0e28 100644 --- a/rs_bindings_from_cc/test/display/displayables_api.rs +++ b/rs_bindings_from_cc/test/display/displayables_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=15 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -27,15 +28,15 @@ unsafe impl ::cxx::ExternType for CanAbslStringify { type Id = ::cxx::type_id!("CanAbslStringify"); type Kind = ::cxx::kind::Trivial; } -impl ::core::fmt::Display for CanAbslStringify { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +impl ::__rust_core::fmt::Display for CanAbslStringify { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::__crubit_fmt__16CanAbslStringify___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables(self,&mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -44,7 +45,7 @@ impl ::core::fmt::Display for CanAbslStringify { impl Default for CanAbslStringify { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN16CanAbslStringifyC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -66,15 +67,15 @@ unsafe impl ::cxx::ExternType for CanAbslStringifyByFill { type Id = ::cxx::type_id!("CanAbslStringifyByFill"); type Kind = ::cxx::kind::Trivial; } -impl ::core::fmt::Display for CanAbslStringifyByFill { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +impl ::__rust_core::fmt::Display for CanAbslStringifyByFill { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::__crubit_fmt__22CanAbslStringifyByFill___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables(self,&mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -83,7 +84,7 @@ impl ::core::fmt::Display for CanAbslStringifyByFill { impl Default for CanAbslStringifyByFill { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN22CanAbslStringifyByFillC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -104,15 +105,15 @@ unsafe impl ::cxx::ExternType for CanAbslStringifyByFormat { type Id = ::cxx::type_id!("CanAbslStringifyByFormat"); type Kind = ::cxx::kind::Trivial; } -impl ::core::fmt::Display for CanAbslStringifyByFormat { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +impl ::__rust_core::fmt::Display for CanAbslStringifyByFormat { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::__crubit_fmt__24CanAbslStringifyByFormat___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables(self,&mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -121,7 +122,7 @@ impl ::core::fmt::Display for CanAbslStringifyByFormat { impl Default for CanAbslStringifyByFormat { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN24CanAbslStringifyByFormatC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -142,15 +143,15 @@ unsafe impl ::cxx::ExternType for CanOstream { type Id = ::cxx::type_id!("CanOstream"); type Kind = ::cxx::kind::Trivial; } -impl ::core::fmt::Display for CanOstream { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +impl ::__rust_core::fmt::Display for CanOstream { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::__crubit_fmt__10CanOstream___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables(self,&mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -159,7 +160,7 @@ impl ::core::fmt::Display for CanOstream { impl Default for CanOstream { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN10CanOstreamC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -186,15 +187,15 @@ unsafe impl ::cxx::ExternType for CanAbslStringifyAndOstream { type Id = ::cxx::type_id!("CanAbslStringifyAndOstream"); type Kind = ::cxx::kind::Trivial; } -impl ::core::fmt::Display for CanAbslStringifyAndOstream { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +impl ::__rust_core::fmt::Display for CanAbslStringifyAndOstream { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::__crubit_fmt__26CanAbslStringifyAndOstream___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables(self,&mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -203,7 +204,7 @@ impl ::core::fmt::Display for CanAbslStringifyAndOstream { impl Default for CanAbslStringifyAndOstream { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN26CanAbslStringifyAndOstreamC1Ev( &raw mut tmp as *mut _, @@ -236,15 +237,15 @@ impl From for ::ffi_11::c_int { value.0 } } -impl ::core::fmt::Display for DisplayableEnum { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +impl ::__rust_core::fmt::Display for DisplayableEnum { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::__crubit_fmt__DisplayableEnum___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables(self,&mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -266,7 +267,7 @@ impl ::core::fmt::Display for DisplayableEnum { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NotDisplayable pub struct NotDisplayable { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for NotDisplayable {} impl !Sync for NotDisplayable {} @@ -279,7 +280,7 @@ unsafe impl ::cxx::ExternType for NotDisplayable { impl Default for NotDisplayable { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN14NotDisplayableC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -292,7 +293,7 @@ impl Default for NotDisplayable { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=TemplatedStringView pub struct TemplatedStringView { - __non_field_data: [::core::mem::MaybeUninit; 16], + __non_field_data: [::__rust_core::mem::MaybeUninit; 16], } impl !Send for TemplatedStringView {} impl !Sync for TemplatedStringView {} @@ -300,15 +301,15 @@ unsafe impl ::cxx::ExternType for TemplatedStringView { type Id = ::cxx::type_id!("TemplatedStringView"); type Kind = ::cxx::kind::Trivial; } -impl ::core::fmt::Display for TemplatedStringView { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +impl ::__rust_core::fmt::Display for TemplatedStringView { + fn fmt(&self, f: &mut ::__rust_core::fmt::Formatter<'_>) -> ::__rust_core::fmt::Result { let mut f = ::lossy_formatter::LossyFormatter::new(f); if unsafe { crate::detail::__crubit_fmt__19TemplatedStringView___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables(self,&mut f) } { - ::core::result::Result::Ok(()) + ::__rust_core::result::Result::Ok(()) } else { - ::core::result::Result::Err(::core::fmt::Error) + ::__rust_core::result::Result::Err(::__rust_core::fmt::Error) } } } @@ -318,7 +319,7 @@ impl From<::cc_std::std::__u::raw_string_view> for TemplatedStringView { #[inline(always)] fn from(args: ::cc_std::std::__u::raw_string_view) -> Self { let mut v = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19TemplatedStringViewC1ENSt3__u17basic_string_viewIcNS0_11char_traitsIcEEEE(&raw mut tmp as*mut _,&mut v); tmp.assume_init() @@ -339,7 +340,7 @@ impl ::ctor::CtorNew<::cc_std::std::__u::raw_string_view> for TemplatedStringVie #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TemplatedNotDisplayable pub struct TemplatedNotDisplayable { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for TemplatedNotDisplayable {} impl !Sync for TemplatedNotDisplayable {} @@ -352,7 +353,7 @@ unsafe impl ::cxx::ExternType for TemplatedNotDisplayable { impl Default for TemplatedNotDisplayable { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23TemplatedNotDisplayableC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -379,7 +380,7 @@ unsafe impl ::cxx::ExternType for DisplayInRust { impl Default for DisplayInRust { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13DisplayInRustC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -1421,33 +1422,35 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN16CanAbslStringifyC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __crubit_fmt__16CanAbslStringify___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( value: &crate::CanAbslStringify, formatter: &mut ::lossy_formatter::LossyFormatter, ) -> bool; pub(crate) unsafe fn __rust_thunk___ZN22CanAbslStringifyByFillC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __crubit_fmt__22CanAbslStringifyByFill___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( value: &crate::CanAbslStringifyByFill, formatter: &mut ::lossy_formatter::LossyFormatter, ) -> bool; pub(crate) unsafe fn __rust_thunk___ZN24CanAbslStringifyByFormatC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __crubit_fmt__24CanAbslStringifyByFormat___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( value: &crate::CanAbslStringifyByFormat, formatter: &mut ::lossy_formatter::LossyFormatter, ) -> bool; - pub(crate) unsafe fn __rust_thunk___ZN10CanOstreamC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10CanOstreamC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __crubit_fmt__10CanOstream___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( value: &crate::CanOstream, formatter: &mut ::lossy_formatter::LossyFormatter, ) -> bool; pub(crate) unsafe fn __rust_thunk___ZN26CanAbslStringifyAndOstreamC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __crubit_fmt__26CanAbslStringifyAndOstream___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( value: &crate::CanAbslStringifyAndOstream, @@ -1458,10 +1461,10 @@ mod detail { formatter: &mut ::lossy_formatter::LossyFormatter, ) -> bool; pub(crate) unsafe fn __rust_thunk___ZN14NotDisplayableC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19TemplatedStringViewC1ENSt3__u17basic_string_viewIcNS0_11char_traitsIcEEEE( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, v: &mut ::cc_std::std::__u::raw_string_view, ); pub(crate) unsafe fn __crubit_fmt__19TemplatedStringView___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( @@ -1469,59 +1472,61 @@ mod detail { formatter: &mut ::lossy_formatter::LossyFormatter, ) -> bool; pub(crate) unsafe fn __rust_thunk___ZN23TemplatedNotDisplayableC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN13DisplayInRustC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN13DisplayInRustC1Ev(__this: *mut ::core::ffi::c_void); } } const _: () = { - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::CanAbslStringify: Copy,Clone); static_assertions::assert_not_impl_any!(crate::CanAbslStringify: Drop); - assert!(::core::mem::offset_of!(crate::CanAbslStringify, value) == 0); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::CanAbslStringify, value) == 0); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::CanAbslStringifyByFill: Copy,Clone); static_assertions::assert_not_impl_any!(crate::CanAbslStringifyByFill: Drop); - assert!(::core::mem::offset_of!(crate::CanAbslStringifyByFill, count) == 0); - assert!(::core::mem::offset_of!(crate::CanAbslStringifyByFill, ch) == 8); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::CanAbslStringifyByFill, count) == 0); + assert!(::__rust_core::mem::offset_of!(crate::CanAbslStringifyByFill, ch) == 8); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::CanAbslStringifyByFormat: Copy,Clone); static_assertions::assert_not_impl_any!(crate::CanAbslStringifyByFormat: Drop); - assert!(::core::mem::offset_of!(crate::CanAbslStringifyByFormat, value) == 0); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::CanAbslStringifyByFormat, value) == 0); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::CanOstream: Copy,Clone); static_assertions::assert_not_impl_any!(crate::CanOstream: Drop); - assert!(::core::mem::offset_of!(crate::CanOstream, value) == 0); - assert!(::core::mem::size_of::() == 32); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::CanOstream, value) == 0); + assert!(::__rust_core::mem::size_of::() == 32); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::CanAbslStringifyAndOstream: Copy,Clone); static_assertions::assert_not_impl_any!(crate::CanAbslStringifyAndOstream: Drop); - assert!(::core::mem::offset_of!(crate::CanAbslStringifyAndOstream, stringify) == 0); - assert!(::core::mem::offset_of!(crate::CanAbslStringifyAndOstream, ostream) == 16); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::CanAbslStringifyAndOstream, stringify) == 0); + assert!(::__rust_core::mem::offset_of!(crate::CanAbslStringifyAndOstream, ostream) == 16); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::NotDisplayable: Copy,Clone); static_assertions::assert_not_impl_any!(crate::NotDisplayable: Drop); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::TemplatedStringView: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TemplatedStringView: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::TemplatedNotDisplayable: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TemplatedNotDisplayable: Drop); - assert!(::core::mem::size_of::() == 32); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 32); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::DisplayInRust: Copy,Clone); static_assertions::assert_not_impl_any!(crate::DisplayInRust: Drop); - assert!(::core::mem::offset_of!(crate::DisplayInRust, cc_value) == 0); - assert!(::core::mem::offset_of!(crate::DisplayInRust, rust_value) == 16); + assert!(::__rust_core::mem::offset_of!(crate::DisplayInRust, cc_value) == 0); + assert!(::__rust_core::mem::offset_of!(crate::DisplayInRust, rust_value) == 16); }; diff --git a/rs_bindings_from_cc/test/function/inline/inline_rs_api.rs b/rs_bindings_from_cc/test/function/inline/inline_rs_api.rs index 4145eba47..45cf460b0 100644 --- a/rs_bindings_from_cc/test/function/inline/inline_rs_api.rs +++ b/rs_bindings_from_cc/test/function/inline/inline_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/function/inline/inline.h;l=8 #[inline(always)] pub fn hello_world_inline() -> ::ffi_11::c_int { @@ -41,7 +42,7 @@ unsafe impl ::cxx::ExternType for SomeStruct { impl Default for SomeStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN10SomeStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -87,7 +88,9 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___Z18hello_world_inlinev() -> ::ffi_11::c_int; - pub(crate) unsafe fn __rust_thunk___ZN10SomeStructC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10SomeStructC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___Z24take_struct_by_const_ptrPK10SomeStruct( s: *const crate::SomeStruct, ) -> ::ffi_11::c_int; @@ -101,9 +104,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::SomeStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeStruct: Drop); - assert!(::core::mem::offset_of!(crate::SomeStruct, int_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::SomeStruct, int_field) == 0); }; diff --git a/rs_bindings_from_cc/test/function/simple/simple_rs_api.rs b/rs_bindings_from_cc/test/function/simple/simple_rs_api.rs index 6ca65c23c..7d1aafcc0 100644 --- a/rs_bindings_from_cc/test/function/simple/simple_rs_api.rs +++ b/rs_bindings_from_cc/test/function/simple/simple_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/function/simple/simple.h;l=10 #[inline(always)] pub fn return_value() -> ::ffi_11::c_int { diff --git a/rs_bindings_from_cc/test/global/global_rs_api.rs b/rs_bindings_from_cc/test/global/global_rs_api.rs index f2158c325..ed8020a7a 100644 --- a/rs_bindings_from_cc/test/global/global_rs_api.rs +++ b/rs_bindings_from_cc/test/global/global_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; extern "C" { pub static mut extern_int: ::ffi_11::c_int; } @@ -96,7 +97,7 @@ pub mod foo { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithAnonEnum pub struct StructWithAnonEnum { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for StructWithAnonEnum {} impl !Sync for StructWithAnonEnum {} @@ -109,7 +110,7 @@ unsafe impl ::cxx::ExternType for StructWithAnonEnum { impl Default for StructWithAnonEnum { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18StructWithAnonEnumC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -138,14 +139,14 @@ mod detail { #[link_name = "_Z15GetInlineIntValv"] pub(crate) unsafe fn __rust_thunk___Z15GetInlineIntValv() -> ::ffi_11::c_int; pub(crate) unsafe fn __rust_thunk___ZN18StructWithAnonEnumC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::StructWithAnonEnum: Copy,Clone); static_assertions::assert_not_impl_any!(crate::StructWithAnonEnum: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs b/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs index c28147c74..4abf8fc3b 100644 --- a/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs @@ -13,25 +13,26 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=WithBitfields pub struct WithBitfields { // f1 : 2 bits - __bitfields0: [::core::mem::MaybeUninit; 1], + __bitfields0: [::__rust_core::mem::MaybeUninit; 1], pub f2: ::ffi_11::c_int, // f3 : 4 bits // f4 : 8 bits // : 45 bits - __bitfields2: [::core::mem::MaybeUninit; 10], + __bitfields2: [::__rust_core::mem::MaybeUninit; 10], pub f5: ::ffi_11::c_int, // f6 : 23 bits - __bitfields4: [::core::mem::MaybeUninit; 3], + __bitfields4: [::__rust_core::mem::MaybeUninit; 3], /// Reason for representing this field as a blob of bytes: /// `[[no_unique_address]]` attribute was present. - pub(crate) f7: [::core::mem::MaybeUninit; 1], + pub(crate) f7: [::__rust_core::mem::MaybeUninit; 1], // f8 : 2 bits - __bitfields6: [::core::mem::MaybeUninit; 1], + __bitfields6: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for WithBitfields {} impl !Sync for WithBitfields {} @@ -43,7 +44,7 @@ unsafe impl ::cxx::ExternType for WithBitfields { impl Default for WithBitfields { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13WithBitfieldsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -65,7 +66,7 @@ impl Default for WithBitfields { pub struct AlignmentRegressionTest { // code_point : 31 bits // status : 1 bits - __bitfields0: [::core::mem::MaybeUninit; 4], + __bitfields0: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for AlignmentRegressionTest {} impl !Sync for AlignmentRegressionTest {} @@ -77,7 +78,7 @@ unsafe impl ::cxx::ExternType for AlignmentRegressionTest { impl Default for AlignmentRegressionTest { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23AlignmentRegressionTestC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -98,23 +99,25 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN13WithBitfieldsC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN13WithBitfieldsC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN23AlignmentRegressionTestC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 32); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 32); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::WithBitfields: Copy,Clone); static_assertions::assert_not_impl_any!(crate::WithBitfields: Drop); - assert!(::core::mem::offset_of!(crate::WithBitfields, f2) == 4); - assert!(::core::mem::offset_of!(crate::WithBitfields, f5) == 20); - assert!(::core::mem::offset_of!(crate::WithBitfields, f7) == 27); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::WithBitfields, f2) == 4); + assert!(::__rust_core::mem::offset_of!(crate::WithBitfields, f5) == 20); + assert!(::__rust_core::mem::offset_of!(crate::WithBitfields, f7) == 27); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::AlignmentRegressionTest: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AlignmentRegressionTest: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/bridge_type_rs_api.rs b/rs_bindings_from_cc/test/golden/bridge_type_rs_api.rs index 8129a8682..323c76cb6 100644 --- a/rs_bindings_from_cc/test/golden/bridge_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/bridge_type_rs_api.rs @@ -13,12 +13,13 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[inline(always)] pub fn ReturnCppStruct() -> crate::RustStruct { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___Z15ReturnCppStructv( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, ); __return.assume_init() } @@ -39,7 +40,9 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___Z15ReturnCppStructv(__return: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___Z15ReturnCppStructv( + __return: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___Z13TakeCppStruct9CppStruct( __param_0: &mut crate::RustStruct, ); diff --git a/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api.rs b/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api.rs index 140d18818..f47ed0f15 100644 --- a/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // Type bindings for MyI8 suppressed due to being mapped to an existing Rust type (i8) #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] @@ -31,7 +32,7 @@ unsafe impl ::cxx::ExternType for X { impl Default for X { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN1XC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -59,7 +60,7 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN1XC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN1XC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___Z3ffi4MyI81X(a: i8, b: &mut crate::X) -> i8; pub(crate) unsafe fn __rust_thunk___Z1fiPvi( a: crate::MyTypedefDecl, @@ -70,11 +71,11 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::X: Copy,Clone); static_assertions::assert_not_impl_any!(crate::X: Drop); - assert!(::core::mem::offset_of!(crate::X, a) == 0); + assert!(::__rust_core::mem::offset_of!(crate::X, a) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/callables_rs_api.rs b/rs_bindings_from_cc/test/golden/callables_rs_api.rs index 9bbeb79f9..45842f632 100644 --- a/rs_bindings_from_cc/test/golden/callables_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/callables_rs_api.rs @@ -14,67 +14,77 @@ #![deny(warnings)] extern crate alloc; +extern crate core as __rust_core; #[inline(always)] pub fn invoke_once( f: ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { unsafe { - crate::detail::__rust_thunk___Z11invoke_onceN6rs_std11DynCallableIFvvOEEE(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::new(::alloc::boxed::Box::new(||{ ::core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi,f).as_ptr()as*const u8) + crate::detail::__rust_thunk___Z11invoke_onceN6rs_std11DynCallableIFvvOEEE(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::new(::alloc::boxed::Box::new(||{ ::__rust_core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi,f).as_ptr()as*const u8) } } #[inline(always)] pub fn invoke( f: ::alloc::boxed::Box< - dyn ::core::ops::FnMut() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnMut() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { unsafe { - crate::detail::__rust_thunk___Z6invokeN6rs_std11DynCallableIFvvEEE(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::new(::alloc::boxed::Box::new(||{ ::core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi,f).as_ptr()as*const u8) + crate::detail::__rust_thunk___Z6invokeN6rs_std11DynCallableIFvvEEE(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::new(::alloc::boxed::Box::new(||{ ::__rust_core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi,f).as_ptr()as*const u8) } } #[inline(always)] pub fn invoke_const( f: ::alloc::boxed::Box< - dyn ::core::ops::Fn() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::Fn() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { unsafe { - crate::detail::__rust_thunk___Z12invoke_constN6rs_std11DynCallableIKFvvEEE(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::new(::alloc::boxed::Box::new(||{ ::core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi,f).as_ptr()as*const u8) + crate::detail::__rust_thunk___Z12invoke_constN6rs_std11DynCallableIKFvvEEE(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::new(::alloc::boxed::Box::new(||{ ::__rust_core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi,f).as_ptr()as*const u8) } } #[inline(always)] pub fn map_int( f: ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, arg: ::ffi_11::c_int, ) -> ::ffi_11::c_int { unsafe { - crate::detail::__rust_thunk___Z7map_intN6rs_std11DynCallableIKFiiEEEi(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::ffi_11::c_int+::core::marker::Send+::core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: ::ffi_11::c_int|->::ffi_11::c_int{ ::core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi::ffi_11::c_int+::core::marker::Send+::core::marker::Sync+'static>,f).as_ptr()as*const u8,arg) + crate::detail::__rust_thunk___Z7map_intN6rs_std11DynCallableIKFiiEEEi(::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::::ffi_11::c_int+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: ::ffi_11::c_int|->::ffi_11::c_int{ ::__rust_core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbi::ffi_11::c_int+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>,f).as_ptr()as*const u8,arg) } } #[inline(always)] pub fn map_bridged( f: ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::RustBridged) -> crate::RustBridged - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::RustBridged) -> crate::RustBridged + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, arg: crate::RustBridged, ) -> crate::RustBridged { unsafe { - ::bridge_rust::unstable_return!(@crate::RustBridgedAbi,crate::RustBridgedAbi,|__return_abi_buffer|{ crate::detail::__rust_thunk___Z11map_bridgedN6rs_std11DynCallableIKF7BridgedS1_EEES1_(__return_abi_buffer,::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::crate::RustBridged+::core::marker::Send+::core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: crate::RustBridged|->crate::RustBridged{ ::core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbicrate::RustBridged+::core::marker::Send+::core::marker::Sync+'static>,f).as_ptr()as*const u8,::bridge_rust::unstable_encode!(@crate::RustBridgedAbi,crate::RustBridgedAbi,arg).as_ptr()as*const u8); }) + ::bridge_rust::unstable_return!(@crate::RustBridgedAbi,crate::RustBridgedAbi,|__return_abi_buffer|{ crate::detail::__rust_thunk___Z11map_bridgedN6rs_std11DynCallableIKF7BridgedS1_EEES1_(__return_abi_buffer,::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::crate::RustBridged+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: crate::RustBridged|->crate::RustBridged{ ::__rust_core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbicrate::RustBridged+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>,f).as_ptr()as*const u8,::bridge_rust::unstable_encode!(@crate::RustBridgedAbi,crate::RustBridgedAbi,arg).as_ptr()as*const u8); }) } } @@ -94,7 +104,7 @@ unsafe impl ::cxx::ExternType for ABICompatible { impl Default for ABICompatible { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13ABICompatibleC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -105,16 +115,16 @@ impl Default for ABICompatible { #[inline(always)] pub fn map_abi_compatible( f: ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, mut arg: crate::ABICompatible, ) -> crate::ABICompatible { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); - crate::detail::__rust_thunk___Z18map_abi_compatibleN6rs_std11DynCallableIKF13ABICompatibleS1_EEES1_(&raw mut __return as*mut::core::ffi::c_void,::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::crate::ABICompatible+::core::marker::Send+::core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: crate::ABICompatible|->crate::ABICompatible{ ::core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbicrate::ABICompatible+::core::marker::Send+::core::marker::Sync+'static>,f).as_ptr()as*const u8,&mut arg); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); + crate::detail::__rust_thunk___Z18map_abi_compatibleN6rs_std11DynCallableIKF13ABICompatibleS1_EEES1_(&raw mut __return as*mut::__rust_core::ffi::c_void,::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::crate::ABICompatible+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: crate::ABICompatible|->crate::ABICompatible{ ::__rust_core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbicrate::ABICompatible+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>,f).as_ptr()as*const u8,&mut arg); __return.assume_init() } } @@ -123,10 +133,10 @@ pub fn map_abi_compatible( #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=LayoutCompatible pub struct LayoutCompatible { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) private_: [::core::mem::MaybeUninit; 4], + pub(crate) private_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for LayoutCompatible {} impl !Sync for LayoutCompatible {} @@ -138,9 +148,9 @@ impl LayoutCompatible { #[inline(always)] pub fn Create(x: ::ffi_11::c_int) -> crate::LayoutCompatible { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN16LayoutCompatible6CreateEi( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, x, ); __return.assume_init() @@ -159,16 +169,16 @@ impl LayoutCompatible { #[inline(always)] pub fn map_layout_compatible( f: ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, mut arg: crate::LayoutCompatible, ) -> crate::LayoutCompatible { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); - crate::detail::__rust_thunk___Z21map_layout_compatibleN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEES1_(&raw mut __return as*mut::core::ffi::c_void,::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::crate::LayoutCompatible+::core::marker::Send+::core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: crate::LayoutCompatible|->crate::LayoutCompatible{ ::core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbicrate::LayoutCompatible+::core::marker::Send+::core::marker::Sync+'static>,f).as_ptr()as*const u8,&mut arg); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); + crate::detail::__rust_thunk___Z21map_layout_compatibleN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEES1_(&raw mut __return as*mut::__rust_core::ffi::c_void,::bridge_rust::unstable_encode!(@::dyn_callable_rs::DynCallableAbi::crate::LayoutCompatible+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>::new(::alloc::boxed::Box::new(|_: crate::LayoutCompatible|->crate::LayoutCompatible{ ::__rust_core::panic!("moved-from value") }),),::dyn_callable_rs::DynCallableAbicrate::LayoutCompatible+::__rust_core::marker::Send+::__rust_core::marker::Sync+'static>,f).as_ptr()as*const u8,&mut arg); __return.assume_init() } } @@ -514,46 +524,51 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___Z11invoke_onceN6rs_std11DynCallableIFvvOEEE( - f: *const ::core::ffi::c_uchar, + f: *const ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z6invokeN6rs_std11DynCallableIFvvEEE( - f: *const ::core::ffi::c_uchar, + f: *const ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z12invoke_constN6rs_std11DynCallableIKFvvEEE( - f: *const ::core::ffi::c_uchar, + f: *const ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z7map_intN6rs_std11DynCallableIKFiiEEEi( - f: *const ::core::ffi::c_uchar, + f: *const ::__rust_core::ffi::c_uchar, arg: ::ffi_11::c_int, ) -> ::ffi_11::c_int; pub(crate) unsafe fn __rust_thunk___Z11map_bridgedN6rs_std11DynCallableIKF7BridgedS1_EEES1_( - __return_abi_buffer: *mut ::core::ffi::c_uchar, - f: *const ::core::ffi::c_uchar, - arg: *const ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, + f: *const ::__rust_core::ffi::c_uchar, + arg: *const ::__rust_core::ffi::c_uchar, + ); + pub(crate) unsafe fn __rust_thunk___ZN13ABICompatibleC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN13ABICompatibleC1Ev(__this: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___Z18map_abi_compatibleN6rs_std11DynCallableIKF13ABICompatibleS1_EEES1_( - __return: *mut ::core::ffi::c_void, - f: *const ::core::ffi::c_uchar, + __return: *mut ::__rust_core::ffi::c_void, + f: *const ::__rust_core::ffi::c_uchar, arg: &mut crate::ABICompatible, ); pub(crate) unsafe fn __rust_thunk___ZN16LayoutCompatible6CreateEi( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, x: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZNK16LayoutCompatible3getEv( __this: *const crate::LayoutCompatible, ) -> ::ffi_11::c_int; pub(crate) unsafe fn __rust_thunk___Z21map_layout_compatibleN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEES1_( - __return: *mut ::core::ffi::c_void, - f: *const ::core::ffi::c_uchar, + __return: *mut ::__rust_core::ffi::c_void, + f: *const ::__rust_core::ffi::c_uchar, arg: &mut crate::LayoutCompatible, ); } #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIFvvEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnMut() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnMut() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { (unsafe { &mut *f })(); @@ -562,10 +577,16 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN6rs_std11DynCallableIFvvEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnMut() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnMut() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnMut() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnMut() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { ::dyn_callable_rs::manager(operation, from, to); @@ -573,14 +594,17 @@ mod detail { #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIFvvOEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { (unsafe { - ::core::ptr::replace( + ::__rust_core::ptr::replace( f, ::alloc::boxed::Box::new(|| { - ::core::unreachable!("Called FnOnce after it was moved"); + ::__rust_core::unreachable!("Called FnOnce after it was moved"); }), ) })(); @@ -589,10 +613,16 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN6rs_std11DynCallableIFvvOEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::FnOnce() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::FnOnce() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { ::dyn_callable_rs::manager(operation, from, to); @@ -600,18 +630,18 @@ mod detail { #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKF13ABICompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, param_0: *mut crate::ABICompatible, out: *mut crate::ABICompatible, ) { - let param_0 = ::core::ptr::read(param_0); + let param_0 = ::__rust_core::ptr::read(param_0); match (unsafe { &*f })(param_0) { result => unsafe { - ::core::ptr::write(out, result); + ::__rust_core::ptr::write(out, result); }, } } @@ -619,15 +649,15 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF13ABICompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::ABICompatible) -> crate::ABICompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, ) { @@ -636,18 +666,18 @@ mod detail { #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, param_0: *mut crate::LayoutCompatible, out: *mut crate::LayoutCompatible, ) { - let param_0 = ::core::ptr::read(param_0); + let param_0 = ::__rust_core::ptr::read(param_0); match (unsafe { &*f })(param_0) { result => unsafe { - ::core::ptr::write(out, result); + ::__rust_core::ptr::write(out, result); }, } } @@ -655,15 +685,15 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::LayoutCompatible) -> crate::LayoutCompatible + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, ) { @@ -672,13 +702,13 @@ mod detail { #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKF7BridgedS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::RustBridged) -> crate::RustBridged - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::RustBridged) -> crate::RustBridged + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, - param_0: *mut ::core::ffi::c_uchar, - bridge_buffer: *mut ::core::ffi::c_uchar, + param_0: *mut ::__rust_core::ffi::c_uchar, + bridge_buffer: *mut ::__rust_core::ffi::c_uchar, ) { let param_0 = ::bridge_rust::internal::decode(crate::RustBridgedAbi, param_0); ::bridge_rust::internal::encode( @@ -691,15 +721,15 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF7BridgedS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::RustBridged) -> crate::RustBridged - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::RustBridged) -> crate::RustBridged + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(crate::RustBridged) -> crate::RustBridged - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(crate::RustBridged) -> crate::RustBridged + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, ) { @@ -708,9 +738,9 @@ mod detail { #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKFiiEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, param_0: ::ffi_11::c_int, @@ -721,15 +751,15 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKFiiEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int - + ::core::marker::Send - + ::core::marker::Sync + dyn ::__rust_core::ops::Fn(::ffi_11::c_int) -> ::ffi_11::c_int + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + 'static, >, ) { @@ -738,7 +768,10 @@ mod detail { #[unsafe(no_mangle)] unsafe extern "C" fn __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKFvvEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( f: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::Fn() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { (unsafe { &*f })(); @@ -747,10 +780,16 @@ mod detail { unsafe extern "C" fn __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKFvvEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( operation: ::dyn_callable_rs::FunctionToCall, from: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::Fn() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, to: *mut ::alloc::boxed::Box< - dyn ::core::ops::Fn() + ::core::marker::Send + ::core::marker::Sync + 'static, + dyn ::__rust_core::ops::Fn() + + ::__rust_core::marker::Send + + ::__rust_core::marker::Sync + + 'static, >, ) { ::dyn_callable_rs::manager(operation, from, to); @@ -758,14 +797,14 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::ABICompatible: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ABICompatible: Drop); - assert!(::core::mem::offset_of!(crate::ABICompatible, x) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::ABICompatible, x) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::LayoutCompatible: Copy,Clone); static_assertions::assert_not_impl_any!(crate::LayoutCompatible: Drop); - assert!(::core::mem::offset_of!(crate::LayoutCompatible, private_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::LayoutCompatible, private_) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/callables_supported_rs_api.rs b/rs_bindings_from_cc/test/golden/callables_supported_rs_api.rs index 0dcc5e6e2..6f1cbbf39 100644 --- a/rs_bindings_from_cc/test/golden/callables_supported_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/callables_supported_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: function `invoke_once` could not be bound // while generating bridge param 'f': callables (e.g. `AnyInvocable`) are not yet supported @@ -44,7 +45,7 @@ unsafe impl ::cxx::ExternType for ABICompatible { impl Default for ABICompatible { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13ABICompatibleC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -59,10 +60,10 @@ impl Default for ABICompatible { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=LayoutCompatible pub struct LayoutCompatible { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) private_: [::core::mem::MaybeUninit; 4], + pub(crate) private_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for LayoutCompatible {} impl !Sync for LayoutCompatible {} @@ -74,9 +75,9 @@ impl LayoutCompatible { #[inline(always)] pub fn Create(x: ::ffi_11::c_int) -> crate::LayoutCompatible { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN16LayoutCompatible6CreateEi( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, x, ); __return.assume_init() @@ -435,9 +436,11 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN13ABICompatibleC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN13ABICompatibleC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN16LayoutCompatible6CreateEi( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, x: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZNK16LayoutCompatible3getEv( @@ -447,14 +450,14 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::ABICompatible: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ABICompatible: Drop); - assert!(::core::mem::offset_of!(crate::ABICompatible, x) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::ABICompatible, x) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::LayoutCompatible: Copy,Clone); static_assertions::assert_not_impl_any!(crate::LayoutCompatible: Drop); - assert!(::core::mem::offset_of!(crate::LayoutCompatible, private_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::LayoutCompatible, private_) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs index 66b8e1dc4..8afcfeff8 100644 --- a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(64))] ///CRUBIT_ANNOTATE: cpp_type=HasCustomAlignment pub struct HasCustomAlignment { - __non_field_data: [::core::mem::MaybeUninit; 64], + __non_field_data: [::__rust_core::mem::MaybeUninit; 64], } impl !Send for HasCustomAlignment {} impl !Sync for HasCustomAlignment {} @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for HasCustomAlignment { impl Default for HasCustomAlignment { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18HasCustomAlignmentC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -53,7 +54,7 @@ unsafe impl ::cxx::ExternType for HasFieldWithCustomAlignment { impl Default for HasFieldWithCustomAlignment { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN27HasFieldWithCustomAlignmentC1Ev( &raw mut tmp as *mut _, @@ -67,7 +68,7 @@ impl Default for HasFieldWithCustomAlignment { #[repr(C, align(64))] ///CRUBIT_ANNOTATE: cpp_type=InheritsFromBaseWithCustomAlignment pub struct InheritsFromBaseWithCustomAlignment { - __non_field_data: [::core::mem::MaybeUninit; 64], + __non_field_data: [::__rust_core::mem::MaybeUninit; 64], } impl !Send for InheritsFromBaseWithCustomAlignment {} impl !Sync for InheritsFromBaseWithCustomAlignment {} @@ -79,7 +80,7 @@ unsafe impl ::cxx::ExternType for InheritsFromBaseWithCustomAlignment { impl Default for InheritsFromBaseWithCustomAlignment { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN35InheritsFromBaseWithCustomAlignmentC1Ev( &raw mut tmp as *mut _, @@ -93,7 +94,7 @@ impl Default for InheritsFromBaseWithCustomAlignment { #[repr(C, align(64))] ///CRUBIT_ANNOTATE: cpp_type=HasCustomAlignmentWithGnuAttr pub struct HasCustomAlignmentWithGnuAttr { - __non_field_data: [::core::mem::MaybeUninit; 64], + __non_field_data: [::__rust_core::mem::MaybeUninit; 64], } impl !Send for HasCustomAlignmentWithGnuAttr {} impl !Sync for HasCustomAlignmentWithGnuAttr {} @@ -105,7 +106,7 @@ unsafe impl ::cxx::ExternType for HasCustomAlignmentWithGnuAttr { impl Default for HasCustomAlignmentWithGnuAttr { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN29HasCustomAlignmentWithGnuAttrC1Ev( &raw mut tmp as *mut _, @@ -138,38 +139,38 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN18HasCustomAlignmentC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN27HasFieldWithCustomAlignmentC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN35InheritsFromBaseWithCustomAlignmentC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN29HasCustomAlignmentWithGnuAttrC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 64); - assert!(::core::mem::align_of::() == 64); + assert!(::__rust_core::mem::size_of::() == 64); + assert!(::__rust_core::mem::align_of::() == 64); static_assertions::assert_impl_all!(crate::HasCustomAlignment: Copy,Clone); static_assertions::assert_not_impl_any!(crate::HasCustomAlignment: Drop); - assert!(::core::mem::size_of::() == 64); - assert!(::core::mem::align_of::() == 64); + assert!(::__rust_core::mem::size_of::() == 64); + assert!(::__rust_core::mem::align_of::() == 64); static_assertions::assert_impl_all!(crate::HasFieldWithCustomAlignment: Copy,Clone); static_assertions::assert_not_impl_any!(crate::HasFieldWithCustomAlignment: Drop); - assert!(::core::mem::offset_of!(crate::HasFieldWithCustomAlignment, field) == 0); - assert!(::core::mem::size_of::() == 64); - assert!(::core::mem::align_of::() == 64); + assert!(::__rust_core::mem::offset_of!(crate::HasFieldWithCustomAlignment, field) == 0); + assert!(::__rust_core::mem::size_of::() == 64); + assert!(::__rust_core::mem::align_of::() == 64); static_assertions::assert_impl_all!(crate::InheritsFromBaseWithCustomAlignment: Copy,Clone); static_assertions::assert_not_impl_any!(crate::InheritsFromBaseWithCustomAlignment: Drop); - assert!(::core::mem::size_of::() == 64); - assert!(::core::mem::align_of::() == 64); + assert!(::__rust_core::mem::size_of::() == 64); + assert!(::__rust_core::mem::align_of::() == 64); static_assertions::assert_impl_all!(crate::HasCustomAlignmentWithGnuAttr: Copy,Clone); static_assertions::assert_not_impl_any!(crate::HasCustomAlignmentWithGnuAttr: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/comment_rs_api.rs b/rs_bindings_from_cc/test/golden/comment_rs_api.rs index cf81a9b17..a21c610d0 100644 --- a/rs_bindings_from_cc/test/golden/comment_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/comment_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // File comment pub mod ns { @@ -38,7 +39,7 @@ pub mod ns { impl Default for Foo { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN2ns3FooC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -85,7 +86,7 @@ unsafe impl ::cxx::ExternType for Bar { impl Default for Bar { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN3BarC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -110,7 +111,7 @@ unsafe impl ::cxx::ExternType for HasNoComments { impl Default for HasNoComments { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13HasNoCommentsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -124,28 +125,30 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN2ns3FooC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN2ns3FooC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___Z3foov(); - pub(crate) unsafe fn __rust_thunk___ZN3BarC1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN13HasNoCommentsC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN3BarC1Ev(__this: *mut ::__rust_core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN13HasNoCommentsC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); } } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::ns::Foo: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ns::Foo: Drop); - assert!(::core::mem::offset_of!(crate::ns::Foo, i) == 0); - assert!(::core::mem::offset_of!(crate::ns::Foo, j) == 4); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::ns::Foo, i) == 0); + assert!(::__rust_core::mem::offset_of!(crate::ns::Foo, j) == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Bar: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Bar: Drop); - assert!(::core::mem::offset_of!(crate::Bar, i) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::Bar, i) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::HasNoComments: Copy,Clone); static_assertions::assert_not_impl_any!(crate::HasNoComments: Drop); - assert!(::core::mem::offset_of!(crate::HasNoComments, i) == 0); + assert!(::__rust_core::mem::offset_of!(crate::HasNoComments, i) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs b/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs index 2575ef0ed..726a179fe 100644 --- a/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// This type renames the special member functions so that they can be /// overridden in Rust instead -- this is proof that you can write bindings /// that are forward-compatible, as described in @@ -21,7 +22,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=CompatibleType pub struct CompatibleType { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 1], } impl !Send for CompatibleType {} impl !Sync for CompatibleType {} @@ -31,12 +32,12 @@ unsafe impl ::cxx::ExternType for CompatibleType { } impl CompatibleType { #[inline(always)] - pub fn renamed_default_constructor<'a>(self: ::core::pin::Pin<&'a mut Self>) { + pub fn renamed_default_constructor<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { unsafe { crate::detail::__rust_thunk___ZN14CompatibleTypeC1Ev(self) } } #[inline(always)] pub fn renamed_constructor<'a>( - self: ::core::pin::Pin<&'a mut Self>, + self: ::__rust_core::pin::Pin<&'a mut Self>, __param_0: ::ffi_11::c_int, ) { unsafe { crate::detail::__rust_thunk___ZN14CompatibleTypeC1Ei(self, __param_0) } @@ -56,18 +57,18 @@ mod detail { unsafe extern "C" { #[link_name = "_ZN14CompatibleTypeC1Ev"] pub(crate) unsafe fn __rust_thunk___ZN14CompatibleTypeC1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::CompatibleType>, + __this: ::__rust_core::pin::Pin<&'a mut crate::CompatibleType>, ); #[link_name = "_ZN14CompatibleTypeC1Ei"] pub(crate) unsafe fn __rust_thunk___ZN14CompatibleTypeC1Ei<'a>( - __this: ::core::pin::Pin<&'a mut crate::CompatibleType>, + __this: ::__rust_core::pin::Pin<&'a mut crate::CompatibleType>, __param_0: ::ffi_11::c_int, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_not_impl_any!(crate::CompatibleType: Copy,Drop); }; diff --git a/rs_bindings_from_cc/test/golden/composable_bridging_rs_api.rs b/rs_bindings_from_cc/test/golden/composable_bridging_rs_api.rs index e6beed7b8..f0b5a517b 100644 --- a/rs_bindings_from_cc/test/golden/composable_bridging_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/composable_bridging_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // Note: a real example would require that Crubit implements CrubitAbiTrait in // order for the generated code to properly compile. This example just serves to // illustrate what the generated code will look like. @@ -55,7 +56,7 @@ unsafe impl ::cxx::ExternType for Vec3 { impl Default for Vec3 { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN4Vec3C1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -564,65 +565,65 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___Z15ReturnCppStructv( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z13TakeCppStruct9CppStruct( - __param_0: *const ::core::ffi::c_uchar, + __param_0: *const ::__rust_core::ffi::c_uchar, ); - pub(crate) unsafe fn __rust_thunk___ZN4Vec3C1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN4Vec3C1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___Z16MakeOptionalVec3fffb( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, x: f32, y: f32, z: f32, is_present: bool, ); pub(crate) unsafe fn __rust_thunk___Z11MapMultiply8MyOptionI4Vec3Ef( - __return_abi_buffer: *mut ::core::ffi::c_uchar, - v: *const ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, + v: *const ::__rust_core::ffi::c_uchar, factor: f32, ); pub(crate) unsafe fn __rust_thunk___Z14MakeMyI8Structv( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); #[link_name = "_Z18InspectStringViewsN6rs_std8SliceRefINSt3__u17basic_string_viewIcNS1_11char_traitsIcEEEEEE"] pub(crate) unsafe fn __rust_thunk___Z18InspectStringViewsN6rs_std8SliceRefINSt3__u17basic_string_viewIcNS1_11char_traitsIcEEEEEE( slice: *mut [::cc_std::std::__u::raw_string_view], ); pub(crate) unsafe fn __rust_thunk___Z12MaybeVoidPtrv( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z40AcceptsSliceAndReturnsStatusErrorIfEmptyN6rs_std8SliceRefIKiEE( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, slice: *const [::ffi_11::c_int], ); pub(crate) unsafe fn __rust_thunk___Z16ReturnsCStrArrayv( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z40ReturnsDefaultEnumInComposableBridgeTypev( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z36ReturnsI64EnumInComposableBridgeTypev( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); pub(crate) unsafe fn __rust_thunk___Z44ReturnsEnumInNamespaceInComposableBridgeTypev( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); } } const _: () = { - assert!(::core::mem::size_of::() == 12); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 12); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Vec3: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Vec3: Drop); - assert!(::core::mem::offset_of!(crate::Vec3, x) == 0); - assert!(::core::mem::offset_of!(crate::Vec3, y) == 4); - assert!(::core::mem::offset_of!(crate::Vec3, z) == 8); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); - assert!(::core::mem::size_of::<*const [::ffi_11::c_int]>() == 16); - assert!(::core::mem::align_of::<*const [::ffi_11::c_int]>() == 8); - assert!(::core::mem::size_of::<*mut [::cc_std::std::__u::raw_string_view]>() == 16); - assert!(::core::mem::align_of::<*mut [::cc_std::std::__u::raw_string_view]>() == 8); + assert!(::__rust_core::mem::offset_of!(crate::Vec3, x) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Vec3, y) == 4); + assert!(::__rust_core::mem::offset_of!(crate::Vec3, z) == 8); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::<*const [::ffi_11::c_int]>() == 16); + assert!(::__rust_core::mem::align_of::<*const [::ffi_11::c_int]>() == 8); + assert!(::__rust_core::mem::size_of::<*mut [::cc_std::std::__u::raw_string_view]>() == 16); + assert!(::__rust_core::mem::align_of::<*mut [::cc_std::std::__u::raw_string_view]>() == 8); }; diff --git a/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api.rs b/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api.rs index 6f951e005..ead27a28a 100644 --- a/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: class `MyOption` could not be bound // Class templates are not yet supported @@ -60,15 +61,15 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___Z12ReturnsValuev( - __return_abi_buffer: *mut ::core::ffi::c_uchar, + __return_abi_buffer: *mut ::__rust_core::ffi::c_uchar, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::__CcTemplateInst5ValueIiE: Copy,Clone); static_assertions::assert_not_impl_any!(crate::__CcTemplateInst5ValueIiE: Drop); - assert!(::core::mem::offset_of!(crate::__CcTemplateInst5ValueIiE, value) == 0); + assert!(::__rust_core::mem::offset_of!(crate::__CcTemplateInst5ValueIiE, value) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api.rs b/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api.rs index 219f3735d..43de6c768 100644 --- a/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod crubit { pub mod rust_type { // error: class `crubit::rust_type::Args` could not be bound // Class templates are not yet supported @@ -68,7 +69,7 @@ unsafe impl ::cxx::ExternType for ExistingRustTypeFieldTypes { impl Default for ExistingRustTypeFieldTypes { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN26ExistingRustTypeFieldTypesC1Ev( &raw mut tmp as *mut _, @@ -144,7 +145,7 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN26ExistingRustTypeFieldTypesC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___Z12AcceptPtrInt3PtrIiE( ptr: &mut crate::RustPtr<::ffi_11::c_int>, @@ -166,39 +167,43 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); - assert!(::core::mem::size_of::() == 5); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 5); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::ExistingRustTypeFieldTypes: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ExistingRustTypeFieldTypes: Drop); - assert!(::core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_struct) == 0); - assert!(::core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_class) == 1); - assert!(::core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_enum) == 2); - assert!(::core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_alias) == 3); - assert!(::core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, error) == 4); - assert!(::core::mem::size_of::>() == 8); - assert!(::core::mem::align_of::>() == 8); + assert!(::__rust_core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_struct) == 0); + assert!(::__rust_core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_class) == 1); + assert!(::__rust_core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_enum) == 2); + assert!(::__rust_core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, my_i8_alias) == 3); + assert!(::__rust_core::mem::offset_of!(crate::ExistingRustTypeFieldTypes, error) == 4); + assert!(::__rust_core::mem::size_of::>() == 8); + assert!(::__rust_core::mem::align_of::>() == 8); assert!( - ::core::mem::size_of::>() - == 16 + ::__rust_core::mem::size_of::< + crate::RustTypeWithReorderedGenerics<::ffi_11::c_int, f32, true>, + >() == 16 ); assert!( - ::core::mem::align_of::>() - == 8 + ::__rust_core::mem::align_of::< + crate::RustTypeWithReorderedGenerics<::ffi_11::c_int, f32, true>, + >() == 8 ); - assert!(::core::mem::size_of::>() == 1); - assert!(::core::mem::align_of::>() == 1); - assert!(::core::mem::size_of::>() == 1); - assert!(::core::mem::align_of::>() == 1); - assert!(::core::mem::size_of::>() == 1); - assert!(::core::mem::align_of::>() == 1); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::>() == 1); + assert!(::__rust_core::mem::align_of::>() == 1); + assert!(::__rust_core::mem::size_of::>() == 1); + assert!( + ::__rust_core::mem::align_of::>() == 1 + ); + assert!(::__rust_core::mem::size_of::>() == 1); + assert!(::__rust_core::mem::align_of::>() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); }; diff --git a/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api.rs b/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api.rs index 7d9a08062..5ce3ab583 100644 --- a/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=ForwardDeclaredStruct pub struct ForwardDeclaredStruct { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ForwardDeclaredStruct {} impl !Sync for ForwardDeclaredStruct {} @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for ForwardDeclaredStruct { impl Default for ForwardDeclaredStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN21ForwardDeclaredStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -42,14 +43,14 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN21ForwardDeclaredStructC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::ForwardDeclaredStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ForwardDeclaredStruct: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/depends_on_nested_types_rs_api.rs b/rs_bindings_from_cc/test/golden/depends_on_nested_types_rs_api.rs index aac0ca54a..4e8ba971f 100644 --- a/rs_bindings_from_cc/test/golden/depends_on_nested_types_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/depends_on_nested_types_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// This should have bindings because Bar is a nested item of Foo, and the module /// "foo" can be generated because it wouldn't conflict with anything else. pub type FooBar = ::nested_types_cc::foo::Bar; diff --git a/rs_bindings_from_cc/test/golden/deprecated_rs_api.rs b/rs_bindings_from_cc/test/golden/deprecated_rs_api.rs index f2a965606..06a22ac10 100644 --- a/rs_bindings_from_cc/test/golden/deprecated_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/deprecated_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: function `deprecated_function` could not be bound // [[deprecated]] attribute @@ -75,11 +76,11 @@ pub struct DeprecatedFields { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/unknown_attribute: unknown field attributes are only supported with experimental features enabled on //rs_bindings_from_cc/test/golden:deprecated_cc /// Unknown attribute: deprecated` - pub(crate) no_message: [::core::mem::MaybeUninit; 4], + pub(crate) no_message: [::__rust_core::mem::MaybeUninit; 4], /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/unknown_attribute: unknown field attributes are only supported with experimental features enabled on //rs_bindings_from_cc/test/golden:deprecated_cc /// Unknown attribute: deprecated` - pub(crate) message: [::core::mem::MaybeUninit; 4], + pub(crate) message: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for DeprecatedFields {} impl !Sync for DeprecatedFields {} @@ -91,7 +92,7 @@ unsafe impl ::cxx::ExternType for DeprecatedFields { impl Default for DeprecatedFields { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN16DeprecatedFieldsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -122,16 +123,16 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN16DeprecatedFieldsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::DeprecatedFields: Copy,Clone); static_assertions::assert_not_impl_any!(crate::DeprecatedFields: Drop); - assert!(::core::mem::offset_of!(crate::DeprecatedFields, no_message) == 0); - assert!(::core::mem::offset_of!(crate::DeprecatedFields, message) == 4); + assert!(::__rust_core::mem::offset_of!(crate::DeprecatedFields, no_message) == 0); + assert!(::__rust_core::mem::offset_of!(crate::DeprecatedFields, message) == 4); }; diff --git a/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs b/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs index 41f95055f..f647196cb 100644 --- a/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: class `DoesNotUse` could not be bound // Class templates are not yet supported diff --git a/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs b/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs index 75af87bc6..78fe9bd8a 100644 --- a/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Doc comment /// /// * with three slashes @@ -20,7 +21,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=DocCommentSlashes pub struct DocCommentSlashes { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// A field. pub i: ::ffi_11::c_int, } @@ -69,7 +70,7 @@ impl DocCommentSlashes { impl Default for DocCommentSlashes { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN17DocCommentSlashesC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -83,7 +84,7 @@ impl From<::ffi_11::c_int> for DocCommentSlashes { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut __param_0 = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN17DocCommentSlashesC1Ei( &raw mut tmp as *mut _, @@ -122,7 +123,7 @@ unsafe impl ::cxx::ExternType for DocCommentBang { impl Default for DocCommentBang { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN14DocCommentBangC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -164,7 +165,7 @@ unsafe impl ::cxx::ExternType for MultilineCommentTwoStars { impl Default for MultilineCommentTwoStars { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN24MultilineCommentTwoStarsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -206,7 +207,7 @@ unsafe impl ::cxx::ExternType for LineComment { impl Default for LineComment { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN11LineCommentC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -248,7 +249,7 @@ unsafe impl ::cxx::ExternType for MultilineOneStar { impl Default for MultilineOneStar { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN16MultilineOneStarC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -320,11 +321,11 @@ mod detail { unsafe extern "C" { #[link_name = "_ZN17DocCommentSlashesC1Ev"] pub(crate) unsafe fn __rust_thunk___ZN17DocCommentSlashesC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN17DocCommentSlashesC1Ei"] pub(crate) unsafe fn __rust_thunk___ZN17DocCommentSlashesC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: ::ffi_11::c_int, ); #[link_name = "_ZNK17DocCommentSlashes15get_field_valueEv"] @@ -340,43 +341,45 @@ mod detail { pub(crate) unsafe fn __rust_thunk___ZN17DocCommentSlashes13static_methodEv( ) -> ::ffi_11::c_int; pub(crate) unsafe fn __rust_thunk___ZN14DocCommentBangC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN24MultilineCommentTwoStarsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN11LineCommentC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN11LineCommentC1Ev(__this: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN16MultilineOneStarC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___Z3foov() -> ::ffi_11::c_int; } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::DocCommentSlashes: Copy,Clone); static_assertions::assert_not_impl_any!(crate::DocCommentSlashes: Drop); - assert!(::core::mem::offset_of!(crate::DocCommentSlashes, i) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::DocCommentSlashes, i) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::DocCommentBang: Copy,Clone); static_assertions::assert_not_impl_any!(crate::DocCommentBang: Drop); - assert!(::core::mem::offset_of!(crate::DocCommentBang, i) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::DocCommentBang, i) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::MultilineCommentTwoStars: Copy,Clone); static_assertions::assert_not_impl_any!(crate::MultilineCommentTwoStars: Drop); - assert!(::core::mem::offset_of!(crate::MultilineCommentTwoStars, i) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::MultilineCommentTwoStars, i) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::LineComment: Copy,Clone); static_assertions::assert_not_impl_any!(crate::LineComment: Drop); - assert!(::core::mem::offset_of!(crate::LineComment, i) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::LineComment, i) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::MultilineOneStar: Copy,Clone); static_assertions::assert_not_impl_any!(crate::MultilineOneStar: Drop); - assert!(::core::mem::offset_of!(crate::MultilineOneStar, i) == 0); + assert!(::__rust_core::mem::offset_of!(crate::MultilineOneStar, i) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/enums_rs_api.rs b/rs_bindings_from_cc/test/golden/enums_rs_api.rs index a3c427834..db6f8cf4f 100644 --- a/rs_bindings_from_cc/test/golden/enums_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/enums_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] ///CRUBIT_ANNOTATE: cpp_type=Color diff --git a/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api.rs b/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api.rs index 54b1457ea..f74ad1027 100644 --- a/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=type @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for r#type { impl Default for r#type { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN4typeC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -52,16 +53,16 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN4typeC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN4typeC1Ev(__this: *mut ::__rust_core::ffi::c_void); #[link_name = "_Z4impli"] pub(crate) unsafe fn __rust_thunk___Z4impli(r#match: ::ffi_11::c_int); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::r#type: Copy,Clone); static_assertions::assert_not_impl_any!(crate::r#type: Drop); - assert!(::core::mem::offset_of!(crate::r#type, r#dyn) == 0); + assert!(::__rust_core::mem::offset_of!(crate::r#type, r#dyn) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/forward_declaration_rs_api.rs b/rs_bindings_from_cc/test/golden/forward_declaration_rs_api.rs index b9a6ae863..1710a81b3 100644 --- a/rs_bindings_from_cc/test/golden/forward_declaration_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/forward_declaration_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: struct `ForwardDeclaredStruct` could not be bound // incomplete type diff --git a/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs b/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs index 1c07e7a84..938d2f064 100644 --- a/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeClass pub struct SomeClass { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeClass {} impl !Sync for SomeClass {} @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for SomeClass { impl Default for SomeClass { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9SomeClassC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -47,7 +48,9 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___Z11visible_val9SomeClass( __param_0: &mut crate::SomeClass, ); @@ -55,8 +58,8 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeClass: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeClass: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/function_annotations_rs_api.rs b/rs_bindings_from_cc/test/golden/function_annotations_rs_api.rs index 97aade759..076c22f5e 100644 --- a/rs_bindings_from_cc/test/golden/function_annotations_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/function_annotations_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/golden/function_annotations.h;l=8[355,377] #[inline(always)] pub fn function_returning_int() -> ::ffi_11::c_int { @@ -28,4 +29,4 @@ mod detail { } } -// This file contains Kythe metadata. eyJ0eXBlIjoia3l0aGUwIiwibWV0YSI6W3sidHlwZSI6ImFuY2hvcl9hbmNob3IiLCJzb3VyY2VfYmVnaW4iOjM1NSwic291cmNlX2VuZCI6Mzc3LCJ0YXJnZXRfYmVnaW4iOjQ2OSwidGFyZ2V0X2VuZCI6NDkxLCJlZGdlIjoiL2t5dGhlL2VkZ2UvaW1wdXRlcyIsInNvdXJjZV92bmFtZSI6eyJjb3JwdXMiOiJjb3JwdXMiLCJwYXRoIjoidGhpcmRfcGFydHkvY3J1Yml0L3JzX2JpbmRpbmdzX2Zyb21fY2MvdGVzdC9nb2xkZW4vZnVuY3Rpb25fYW5ub3RhdGlvbnMuaCIsImxhbmd1YWdlIjoiYysrIn19XX0= +// This file contains Kythe metadata. eyJ0eXBlIjoia3l0aGUwIiwibWV0YSI6W3sidHlwZSI6ImFuY2hvcl9hbmNob3IiLCJzb3VyY2VfYmVnaW4iOjM1NSwic291cmNlX2VuZCI6Mzc3LCJ0YXJnZXRfYmVnaW4iOjUwMywidGFyZ2V0X2VuZCI6NTI1LCJlZGdlIjoiL2t5dGhlL2VkZ2UvaW1wdXRlcyIsInNvdXJjZV92bmFtZSI6eyJjb3JwdXMiOiJjb3JwdXMiLCJwYXRoIjoidGhpcmRfcGFydHkvY3J1Yml0L3JzX2JpbmRpbmdzX2Zyb21fY2MvdGVzdC9nb2xkZW4vZnVuY3Rpb25fYW5ub3RhdGlvbnMuaCIsImxhbmd1YWdlIjoiYysrIn19XX0= diff --git a/rs_bindings_from_cc/test/golden/includes_rs_api.rs b/rs_bindings_from_cc/test/golden/includes_rs_api.rs index e948e2d9a..587549c26 100644 --- a/rs_bindings_from_cc/test/golden/includes_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/includes_rs_api.rs @@ -12,3 +12,5 @@ #![allow(nonstandard_style)] #![allow(unused)] #![deny(warnings)] + +extern crate core as __rust_core; diff --git a/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs b/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs index cb1a0edc7..3d2d8bb4a 100644 --- a/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Using classes to force these to be non-POD. /// In the Itanium ABI, the tail padding of POD types cannot be reused by other /// objects, even if the POD type is potentially-overlapping. @@ -20,7 +21,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Base0 pub struct Base0 { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Base0 {} impl !Sync for Base0 {} @@ -32,7 +33,7 @@ unsafe impl ::cxx::ExternType for Base0 { impl Default for Base0 { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5Base0C1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -58,13 +59,13 @@ impl Default for Base0 { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=Base1 pub struct Base1 { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) b1_1_: [::core::mem::MaybeUninit; 8], + pub(crate) b1_1_: [::__rust_core::mem::MaybeUninit; 8], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) b1_2_: [::core::mem::MaybeUninit; 8], + pub(crate) b1_2_: [::__rust_core::mem::MaybeUninit; 8], } impl !Send for Base1 {} impl !Sync for Base1 {} @@ -76,7 +77,7 @@ unsafe impl ::cxx::ExternType for Base1 { impl Default for Base1 { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5Base1C1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -102,10 +103,10 @@ impl Default for Base1 { #[repr(C, align(2))] ///CRUBIT_ANNOTATE: cpp_type=Base2 pub struct Base2 { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) b2_1_: [::core::mem::MaybeUninit; 2], + pub(crate) b2_1_: [::__rust_core::mem::MaybeUninit; 2], } impl !Send for Base2 {} impl !Sync for Base2 {} @@ -117,7 +118,7 @@ unsafe impl ::cxx::ExternType for Base2 { impl Default for Base2 { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5Base2C1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -143,7 +144,7 @@ impl Default for Base2 { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=Derived pub struct Derived { - __non_field_data: [::core::mem::MaybeUninit; 12], + __non_field_data: [::__rust_core::mem::MaybeUninit; 12], pub derived_1: ::ffi_11::c_char, } impl !Send for Derived {} @@ -156,7 +157,7 @@ unsafe impl ::cxx::ExternType for Derived { impl Default for Derived { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN7DerivedC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -182,7 +183,7 @@ impl Default for Derived { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=VirtualBase1 pub struct VirtualBase1 { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 24], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 24], } impl !Send for VirtualBase1 {} impl !Sync for VirtualBase1 {} @@ -200,7 +201,7 @@ impl ::ctor::CtorNew<()> for VirtualBase1 { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN12VirtualBase1C1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -225,7 +226,7 @@ impl ::ctor::CtorNew<()> for VirtualBase1 { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=VirtualBase2 pub struct VirtualBase2 { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 24], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 24], } impl !Send for VirtualBase2 {} impl !Sync for VirtualBase2 {} @@ -243,7 +244,7 @@ impl ::ctor::CtorNew<()> for VirtualBase2 { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN12VirtualBase2C1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -268,7 +269,7 @@ impl ::ctor::CtorNew<()> for VirtualBase2 { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=VirtualDerived pub struct VirtualDerived { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 32], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 32], } impl !Send for VirtualDerived {} impl !Sync for VirtualDerived {} @@ -286,7 +287,7 @@ impl ::ctor::CtorNew<()> for VirtualDerived { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN14VirtualDerivedC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -311,7 +312,7 @@ impl ::ctor::CtorNew<()> for VirtualDerived { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=MyAbstractClass pub struct MyAbstractClass { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 8], } impl !Send for MyAbstractClass {} impl !Sync for MyAbstractClass {} @@ -335,7 +336,7 @@ unsafe impl ::cxx::ExternType for MyAbstractClass { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=MethodBase1 pub struct MethodBase1 { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for MethodBase1 {} impl !Sync for MethodBase1 {} @@ -369,7 +370,7 @@ impl MethodBase1 { impl Default for MethodBase1 { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN11MethodBase1C1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -395,7 +396,7 @@ impl Default for MethodBase1 { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=MethodBase2 pub struct MethodBase2 { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for MethodBase2 {} impl !Sync for MethodBase2 {} @@ -417,7 +418,7 @@ impl MethodBase2 { impl Default for MethodBase2 { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN11MethodBase2C1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -443,7 +444,7 @@ impl Default for MethodBase2 { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=MethodDerived pub struct MethodDerived { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for MethodDerived {} impl !Sync for MethodDerived {} @@ -455,7 +456,7 @@ unsafe impl ::cxx::ExternType for MethodDerived { impl Default for MethodDerived { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13MethodDerivedC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -487,16 +488,22 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN5Base0C1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN5Base1C1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN5Base2C1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN7DerivedC1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN12VirtualBase1C1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN12VirtualBase2C1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN5Base0C1Ev(__this: *mut ::__rust_core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN5Base1C1Ev(__this: *mut ::__rust_core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN5Base2C1Ev(__this: *mut ::__rust_core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN7DerivedC1Ev(__this: *mut ::__rust_core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN12VirtualBase1C1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN12VirtualBase2C1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN14VirtualDerivedC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN11MethodBase1C1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN11MethodBase1C1Ev(__this: *mut ::core::ffi::c_void); #[link_name = "_ZN11MethodBase16PublicEv"] pub(crate) unsafe fn __rust_thunk___ZN11MethodBase16PublicEv<'a>( __this: &'a mut crate::MethodBase1, @@ -514,7 +521,9 @@ mod detail { pub(crate) unsafe fn __rust_thunk___ZN11MethodBase110Colliding2Ev<'a>( __this: &'a mut crate::MethodBase1, ); - pub(crate) unsafe fn __rust_thunk___ZN11MethodBase2C1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN11MethodBase2C1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); #[link_name = "_ZN11MethodBase210Colliding1Ev"] pub(crate) unsafe fn __rust_thunk___ZN11MethodBase210Colliding1Ev<'a>( __this: &'a mut crate::MethodBase2, @@ -523,60 +532,62 @@ mod detail { pub(crate) unsafe fn __rust_thunk___ZN11MethodBase210Colliding2Ev<'a>( __this: &'a mut crate::MethodBase2, ); - pub(crate) unsafe fn __rust_thunk___ZN13MethodDerivedC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN13MethodDerivedC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Base0: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Base0: Drop); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::Base1: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Base1: Drop); - assert!(::core::mem::offset_of!(crate::Base1, b1_1_) == 0); - assert!(::core::mem::offset_of!(crate::Base1, b1_2_) == 8); - assert!(::core::mem::size_of::() == 2); - assert!(::core::mem::align_of::() == 2); + assert!(::__rust_core::mem::offset_of!(crate::Base1, b1_1_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Base1, b1_2_) == 8); + assert!(::__rust_core::mem::size_of::() == 2); + assert!(::__rust_core::mem::align_of::() == 2); static_assertions::assert_impl_all!(crate::Base2: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Base2: Drop); - assert!(::core::mem::offset_of!(crate::Base2, b2_1_) == 0); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::Base2, b2_1_) == 0); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::Derived: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Derived: Drop); - assert!(::core::mem::offset_of!(crate::Derived, derived_1) == 12); - assert!(::core::mem::size_of::() == 24); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::Derived, derived_1) == 12); + assert!(::__rust_core::mem::size_of::() == 24); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_not_impl_any!(crate::VirtualBase1: Copy,Drop); - assert!(::core::mem::size_of::() == 24); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 24); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_not_impl_any!(crate::VirtualBase2: Copy,Drop); - assert!(::core::mem::size_of::() == 32); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 32); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_not_impl_any!(crate::VirtualDerived: Copy,Drop); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_not_impl_any!(crate::MyAbstractClass: Copy,Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::MethodBase1: Copy,Clone); static_assertions::assert_not_impl_any!(crate::MethodBase1: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::MethodBase2: Copy,Clone); static_assertions::assert_not_impl_any!(crate::MethodBase2: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::MethodDerived: Copy,Clone); static_assertions::assert_not_impl_any!(crate::MethodDerived: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/item_order_rs_api.rs b/rs_bindings_from_cc/test/golden/item_order_rs_api.rs index da838c14b..f189ee636 100644 --- a/rs_bindings_from_cc/test/golden/item_order_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/item_order_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=FirstStruct @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for FirstStruct { impl Default for FirstStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN11FirstStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -58,7 +59,7 @@ unsafe impl ::cxx::ExternType for SecondStruct { impl Default for SecondStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN12SecondStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -75,22 +76,26 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN11FirstStructC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN11FirstStructC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___Z10first_funcv() -> ::ffi_11::c_int; - pub(crate) unsafe fn __rust_thunk___ZN12SecondStructC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN12SecondStructC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___Z11second_funcv() -> ::ffi_11::c_int; } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::FirstStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::FirstStruct: Drop); - assert!(::core::mem::offset_of!(crate::FirstStruct, field) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::FirstStruct, field) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::SecondStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SecondStruct: Drop); - assert!(::core::mem::offset_of!(crate::SecondStruct, field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::SecondStruct, field) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs b/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs index f6b2bca06..b022af435 100644 --- a/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[inline(always)] pub fn AddHook(__param_0: Option) { unsafe { crate::detail::__rust_thunk___Z7AddHookPFvvE(__param_0) } diff --git a/rs_bindings_from_cc/test/golden/method_access_rs_api.rs b/rs_bindings_from_cc/test/golden/method_access_rs_api.rs index 17eeab532..6aa09d7b9 100644 --- a/rs_bindings_from_cc/test/golden/method_access_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/method_access_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Struct pub struct Struct { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Struct {} impl !Sync for Struct {} @@ -47,7 +48,7 @@ impl Struct { impl Default for Struct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6StructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -59,7 +60,7 @@ impl Default for Struct { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Class pub struct Class { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Class {} impl !Sync for Class {} @@ -81,7 +82,7 @@ impl Class { impl Default for Class { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5ClassC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -93,25 +94,25 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN6StructC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN6StructC1Ev(__this: *mut ::__rust_core::ffi::c_void); #[link_name = "_ZN6Struct10AccessNoneEv"] pub(crate) unsafe fn __rust_thunk___ZN6Struct10AccessNoneEv(__this: *mut crate::Struct); #[link_name = "_ZN6Struct12AccessPublicEv"] pub(crate) unsafe fn __rust_thunk___ZN6Struct12AccessPublicEv(__this: *mut crate::Struct); - pub(crate) unsafe fn __rust_thunk___ZN5ClassC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN5ClassC1Ev(__this: *mut ::__rust_core::ffi::c_void); #[link_name = "_ZN5Class12AccessPublicEv"] pub(crate) unsafe fn __rust_thunk___ZN5Class12AccessPublicEv(__this: *mut crate::Class); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Struct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Struct: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Class: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Class: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api.rs b/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api.rs index bcd9c58df..90bb16257 100644 --- a/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Noninline pub struct Noninline { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Noninline {} impl !Sync for Noninline {} @@ -71,7 +72,7 @@ impl Noninline { impl Default for Noninline { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9NoninlineC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -83,7 +84,7 @@ impl Default for Noninline { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Inline pub struct Inline { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Inline {} impl !Sync for Inline {} @@ -137,7 +138,7 @@ impl Inline { impl Default for Inline { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6InlineC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -149,7 +150,9 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN9NoninlineC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN9NoninlineC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); #[link_name = "_ZN9Noninline17UnqualifiedMethodEv"] pub(crate) unsafe fn __rust_thunk___ZN9Noninline17UnqualifiedMethodEv( __this: *mut crate::Noninline, @@ -170,7 +173,7 @@ mod detail { pub(crate) unsafe fn __rust_thunk___ZNKO9Noninline17RvalueMethodConstEv( __this: *const crate::Noninline, ); - pub(crate) unsafe fn __rust_thunk___ZN6InlineC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN6InlineC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN6Inline17UnqualifiedMethodEv( __this: *mut crate::Inline, ); @@ -186,13 +189,13 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Noninline: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Noninline: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Inline: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Inline: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/namespace_rs_api.rs b/rs_bindings_from_cc/test/golden/namespace_rs_api.rs index 2bb7d8843..0e5a1d876 100644 --- a/rs_bindings_from_cc/test/golden/namespace_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/namespace_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod test_namespace_bindings { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -30,7 +31,7 @@ pub mod test_namespace_bindings { impl Default for S { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings1SC1Ev( &raw mut tmp as *mut _, @@ -66,9 +67,10 @@ pub mod test_namespace_bindings { #[inline(always)] pub fn identity(mut s: crate::test_namespace_bindings::S) -> crate::test_namespace_bindings::S { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = + ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___Z8identityN23test_namespace_bindings1SE( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, &mut s, ); __return.assume_init() @@ -95,7 +97,7 @@ pub mod test_namespace_bindings_reopened { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings_reopened :: inner :: S pub struct S { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for S {} impl !Sync for S {} @@ -107,7 +109,7 @@ pub mod test_namespace_bindings_reopened { impl Default for S { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN32test_namespace_bindings_reopened5inner1SC1Ev( &raw mut tmp as *mut _, @@ -138,7 +140,7 @@ pub mod test_namespace_bindings_inline { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings_inline :: inner :: StructInInlineNamespace pub struct StructInInlineNamespace { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for StructInInlineNamespace {} impl !Sync for StructInInlineNamespace {} @@ -152,7 +154,7 @@ pub mod test_namespace_bindings_inline { impl Default for StructInInlineNamespace { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1Ev(&raw mut tmp as*mut _); tmp.assume_init() @@ -202,7 +204,7 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN23test_namespace_bindings1SC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN23test_namespace_bindings1fENS_1SE( s: &mut crate::test_namespace_bindings::S, @@ -211,13 +213,13 @@ mod detail { #[link_name = "_ZN23test_namespace_bindings5inner1iEv"] pub(crate) unsafe fn __rust_thunk___ZN23test_namespace_bindings5inner1iEv(); pub(crate) unsafe fn __rust_thunk___Z8identityN23test_namespace_bindings1SE( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, s: &mut crate::test_namespace_bindings::S, ); #[link_name = "_ZN32test_namespace_bindings_reopened1xEv"] pub(crate) unsafe fn __rust_thunk___ZN32test_namespace_bindings_reopened1xEv(); pub(crate) unsafe fn __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN32test_namespace_bindings_reopened1yEv"] pub(crate) unsafe fn __rust_thunk___ZN32test_namespace_bindings_reopened1yEv(); @@ -225,7 +227,7 @@ mod detail { s: &mut crate::test_namespace_bindings_reopened::inner::S, ); pub(crate) unsafe fn __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___Z43useStructInInlineNamespaceWithFullQualifierN30test_namespace_bindings_inline5inner23StructInInlineNamespaceE( s: &mut crate::test_namespace_bindings_inline::inner::StructInInlineNamespace, @@ -238,22 +240,27 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::test_namespace_bindings::S: Copy,Clone); static_assertions::assert_not_impl_any!(crate::test_namespace_bindings::S: Drop); - assert!(::core::mem::offset_of!(crate::test_namespace_bindings::S, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::test_namespace_bindings::S, i) == 0); + assert!( + ::__rust_core::mem::size_of::() == 1 + ); + assert!( + ::__rust_core::mem::align_of::() == 1 + ); static_assertions::assert_impl_all!(crate::test_namespace_bindings_reopened::inner::S: Copy,Clone); static_assertions::assert_not_impl_any!(crate::test_namespace_bindings_reopened::inner::S: Drop); assert!( - ::core::mem::size_of::( - ) == 1 + ::__rust_core::mem::size_of::< + crate::test_namespace_bindings_inline::inner::StructInInlineNamespace, + >() == 1 ); assert!( - ::core::mem::align_of::< + ::__rust_core::mem::align_of::< crate::test_namespace_bindings_inline::inner::StructInInlineNamespace, >() == 1 ); diff --git a/rs_bindings_from_cc/test/golden/nested_types_rs_api.rs b/rs_bindings_from_cc/test/golden/nested_types_rs_api.rs index 98b823753..6f7844266 100644 --- a/rs_bindings_from_cc/test/golden/nested_types_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/nested_types_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Foo @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for Foo { impl Default for Foo { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN3FooC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -57,7 +58,7 @@ pub mod foo { impl Default for Bar { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN3Foo3BarC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -85,7 +86,7 @@ pub mod foo { impl Default for Baz { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN3Foo3Bar3BazC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -106,7 +107,7 @@ pub mod foo { pub struct already_snake_case { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: parent record has nested items, but the module to contain them could not be generated because another item named `already_snake_case` already exists - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for already_snake_case {} impl !Sync for already_snake_case {} @@ -118,7 +119,7 @@ unsafe impl ::cxx::ExternType for already_snake_case { impl Default for already_snake_case { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18already_snake_caseC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -140,7 +141,7 @@ impl Default for already_snake_case { pub struct ConflictingSnakeCaseNames { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: records ["ConflictingSnakeCaseNames", "ConflictingSnakeCaseNames_"] all have nested items, but all map to the same nested module name: `conflicting_snake_case_names` - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ConflictingSnakeCaseNames {} impl !Sync for ConflictingSnakeCaseNames {} @@ -152,7 +153,7 @@ unsafe impl ::cxx::ExternType for ConflictingSnakeCaseNames { impl Default for ConflictingSnakeCaseNames { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN25ConflictingSnakeCaseNamesC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -174,7 +175,7 @@ impl Default for ConflictingSnakeCaseNames { pub struct ConflictingSnakeCaseNames_ { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: records ["ConflictingSnakeCaseNames", "ConflictingSnakeCaseNames_"] all have nested items, but all map to the same nested module name: `conflicting_snake_case_names` - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ConflictingSnakeCaseNames_ {} impl !Sync for ConflictingSnakeCaseNames_ {} @@ -186,7 +187,7 @@ unsafe impl ::cxx::ExternType for ConflictingSnakeCaseNames_ { impl Default for ConflictingSnakeCaseNames_ { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN26ConflictingSnakeCaseNames_C1Ev( &raw mut tmp as *mut _, @@ -215,7 +216,7 @@ unsafe impl ::cxx::ExternType for OnlyOneHasNestedItems { impl Default for OnlyOneHasNestedItems { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN21OnlyOneHasNestedItemsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -231,7 +232,7 @@ pub mod only_one_has_nested_items { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=OnlyOneHasNestedItems :: Inner pub struct Inner { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} @@ -243,7 +244,7 @@ pub mod only_one_has_nested_items { impl Default for Inner { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN21OnlyOneHasNestedItems5InnerC1Ev( &raw mut tmp as *mut _, @@ -258,7 +259,7 @@ pub mod only_one_has_nested_items { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=OnlyOneHasNestedItems_ pub struct OnlyOneHasNestedItems_ { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for OnlyOneHasNestedItems_ {} impl !Sync for OnlyOneHasNestedItems_ {} @@ -270,7 +271,7 @@ unsafe impl ::cxx::ExternType for OnlyOneHasNestedItems_ { impl Default for OnlyOneHasNestedItems_ { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN22OnlyOneHasNestedItems_C1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -291,7 +292,7 @@ impl Default for OnlyOneHasNestedItems_ { pub struct SameNameAsNamespace { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: parent record has nested items, but the module to contain them could not be generated because another item named `same_name_as_namespace` already exists - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SameNameAsNamespace {} impl !Sync for SameNameAsNamespace {} @@ -303,7 +304,7 @@ unsafe impl ::cxx::ExternType for SameNameAsNamespace { impl Default for SameNameAsNamespace { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19SameNameAsNamespaceC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -321,7 +322,7 @@ pub mod same_name_as_namespace { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=same_name_as_namespace :: Foo pub struct Foo { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Foo {} impl !Sync for Foo {} @@ -333,7 +334,7 @@ pub mod same_name_as_namespace { impl Default for Foo { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN22same_name_as_namespace3FooC1Ev( &raw mut tmp as *mut _, @@ -347,7 +348,7 @@ pub mod same_name_as_namespace { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=same_name_as_namespace :: Bar pub struct Bar { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Bar {} impl !Sync for Bar {} @@ -359,7 +360,7 @@ pub mod same_name_as_namespace { impl Default for Bar { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN22same_name_as_namespace3BarC1Ev( &raw mut tmp as *mut _, @@ -384,7 +385,7 @@ pub mod no_longer_top_level { pub struct already_snake_case { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: parent record has nested items, but the module to contain them could not be generated because another item named `already_snake_case` already exists - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for already_snake_case {} impl !Sync for already_snake_case {} @@ -396,7 +397,7 @@ pub mod no_longer_top_level { impl Default for already_snake_case { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level18already_snake_caseC1Ev( &raw mut tmp as *mut _, @@ -420,7 +421,7 @@ pub mod no_longer_top_level { pub struct ConflictingSnakeCaseNames { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: records ["ConflictingSnakeCaseNames", "ConflictingSnakeCaseNames_"] all have nested items, but all map to the same nested module name: `conflicting_snake_case_names` - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ConflictingSnakeCaseNames {} impl !Sync for ConflictingSnakeCaseNames {} @@ -432,7 +433,7 @@ pub mod no_longer_top_level { impl Default for ConflictingSnakeCaseNames { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level25ConflictingSnakeCaseNamesC1Ev(&raw mut tmp as*mut _); tmp.assume_init() @@ -454,7 +455,7 @@ pub mod no_longer_top_level { pub struct ConflictingSnakeCaseNames_ { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: records ["ConflictingSnakeCaseNames", "ConflictingSnakeCaseNames_"] all have nested items, but all map to the same nested module name: `conflicting_snake_case_names` - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ConflictingSnakeCaseNames_ {} impl !Sync for ConflictingSnakeCaseNames_ {} @@ -466,7 +467,7 @@ pub mod no_longer_top_level { impl Default for ConflictingSnakeCaseNames_ { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level26ConflictingSnakeCaseNames_C1Ev(&raw mut tmp as*mut _); tmp.assume_init() @@ -493,7 +494,7 @@ pub mod no_longer_top_level { impl Default for OnlyOneHasNestedItems { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level21OnlyOneHasNestedItemsC1Ev( &raw mut tmp as *mut _, @@ -511,7 +512,7 @@ pub mod no_longer_top_level { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: OnlyOneHasNestedItems :: Inner pub struct Inner { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} @@ -523,7 +524,7 @@ pub mod no_longer_top_level { impl Default for Inner { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level21OnlyOneHasNestedItems5InnerC1Ev(&raw mut tmp as*mut _); tmp.assume_init() @@ -536,7 +537,7 @@ pub mod no_longer_top_level { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: OnlyOneHasNestedItems_ pub struct OnlyOneHasNestedItems_ { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for OnlyOneHasNestedItems_ {} impl !Sync for OnlyOneHasNestedItems_ {} @@ -548,7 +549,7 @@ pub mod no_longer_top_level { impl Default for OnlyOneHasNestedItems_ { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level22OnlyOneHasNestedItems_C1Ev( &raw mut tmp as *mut _, @@ -571,7 +572,7 @@ pub mod no_longer_top_level { pub struct SameNameAsNamespace { /// Reason for representing this field as a blob of bytes: /// crubit.rs/errors/nested_type: parent record has nested items, but the module to contain them could not be generated because another item named `same_name_as_namespace` already exists - pub(crate) i: [::core::mem::MaybeUninit; 1], + pub(crate) i: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SameNameAsNamespace {} impl !Sync for SameNameAsNamespace {} @@ -583,7 +584,7 @@ pub mod no_longer_top_level { impl Default for SameNameAsNamespace { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level19SameNameAsNamespaceC1Ev( &raw mut tmp as *mut _, @@ -603,7 +604,7 @@ pub mod no_longer_top_level { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: same_name_as_namespace :: Foo pub struct Foo { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Foo {} impl !Sync for Foo {} @@ -615,7 +616,7 @@ pub mod no_longer_top_level { impl Default for Foo { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level22same_name_as_namespace3FooC1Ev(&raw mut tmp as*mut _); tmp.assume_init() @@ -627,7 +628,7 @@ pub mod no_longer_top_level { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: same_name_as_namespace :: Bar pub struct Bar { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Bar {} impl !Sync for Bar {} @@ -639,7 +640,7 @@ pub mod no_longer_top_level { impl Default for Bar { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19no_longer_top_level22same_name_as_namespace3BarC1Ev(&raw mut tmp as*mut _); tmp.assume_init() @@ -658,7 +659,7 @@ pub mod no_longer_top_level { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=ContainsForwardDeclared pub struct ContainsForwardDeclared { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ContainsForwardDeclared {} impl !Sync for ContainsForwardDeclared {} @@ -670,7 +671,7 @@ unsafe impl ::cxx::ExternType for ContainsForwardDeclared { impl Default for ContainsForwardDeclared { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23ContainsForwardDeclaredC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -689,188 +690,226 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN3FooC1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN3Foo3BarC1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN3Foo3Bar3BazC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN3FooC1Ev(__this: *mut ::__rust_core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN3Foo3BarC1Ev(__this: *mut ::__rust_core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN3Foo3Bar3BazC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN18already_snake_caseC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN25ConflictingSnakeCaseNamesC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN26ConflictingSnakeCaseNames_C1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN21OnlyOneHasNestedItemsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN21OnlyOneHasNestedItems5InnerC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN22OnlyOneHasNestedItems_C1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19SameNameAsNamespaceC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN22same_name_as_namespace3FooC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN22same_name_as_namespace3BarC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level18already_snake_caseC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level25ConflictingSnakeCaseNamesC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level26ConflictingSnakeCaseNames_C1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level21OnlyOneHasNestedItemsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level21OnlyOneHasNestedItems5InnerC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level22OnlyOneHasNestedItems_C1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level19SameNameAsNamespaceC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level22same_name_as_namespace3FooC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19no_longer_top_level22same_name_as_namespace3BarC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN23ContainsForwardDeclaredC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::foo::bar::Baz: Copy,Clone); static_assertions::assert_not_impl_any!(crate::foo::bar::Baz: Drop); - assert!(::core::mem::offset_of!(crate::foo::bar::Baz, baz) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::foo::bar::Baz, baz) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::foo::Bar: Copy,Clone); static_assertions::assert_not_impl_any!(crate::foo::Bar: Drop); - assert!(::core::mem::offset_of!(crate::foo::Bar, bar) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::foo::Bar, bar) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Foo: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Foo: Drop); - assert!(::core::mem::offset_of!(crate::Foo, foo) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::Foo, foo) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::already_snake_case: Copy,Clone); static_assertions::assert_not_impl_any!(crate::already_snake_case: Drop); - assert!(::core::mem::offset_of!(crate::already_snake_case, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::already_snake_case, i) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::ConflictingSnakeCaseNames: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ConflictingSnakeCaseNames: Drop); - assert!(::core::mem::offset_of!(crate::ConflictingSnakeCaseNames, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::ConflictingSnakeCaseNames, i) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::ConflictingSnakeCaseNames_: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ConflictingSnakeCaseNames_: Drop); - assert!(::core::mem::offset_of!(crate::ConflictingSnakeCaseNames_, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::ConflictingSnakeCaseNames_, i) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::only_one_has_nested_items::Inner: Copy,Clone); static_assertions::assert_not_impl_any!(crate::only_one_has_nested_items::Inner: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::OnlyOneHasNestedItems: Copy,Clone); static_assertions::assert_not_impl_any!(crate::OnlyOneHasNestedItems: Drop); - assert!(::core::mem::offset_of!(crate::OnlyOneHasNestedItems, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::OnlyOneHasNestedItems, i) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::OnlyOneHasNestedItems_: Copy,Clone); static_assertions::assert_not_impl_any!(crate::OnlyOneHasNestedItems_: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SameNameAsNamespace: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SameNameAsNamespace: Drop); - assert!(::core::mem::offset_of!(crate::SameNameAsNamespace, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::SameNameAsNamespace, i) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::same_name_as_namespace::Foo: Copy,Clone); static_assertions::assert_not_impl_any!(crate::same_name_as_namespace::Foo: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::same_name_as_namespace::Bar: Copy,Clone); static_assertions::assert_not_impl_any!(crate::same_name_as_namespace::Bar: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::no_longer_top_level::already_snake_case: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::already_snake_case: Drop); - assert!(::core::mem::offset_of!(crate::no_longer_top_level::already_snake_case, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::no_longer_top_level::already_snake_case, i) == 0); + assert!( + ::__rust_core::mem::size_of::() == 1 + ); + assert!( + ::__rust_core::mem::align_of::() + == 1 + ); static_assertions::assert_impl_all!(crate::no_longer_top_level::ConflictingSnakeCaseNames: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::ConflictingSnakeCaseNames: Drop); - assert!(::core::mem::offset_of!(crate::no_longer_top_level::ConflictingSnakeCaseNames, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!( + ::__rust_core::mem::offset_of!(crate::no_longer_top_level::ConflictingSnakeCaseNames, i) + == 0 + ); + assert!( + ::__rust_core::mem::size_of::() + == 1 + ); + assert!( + ::__rust_core::mem::align_of::() + == 1 + ); static_assertions::assert_impl_all!(crate::no_longer_top_level::ConflictingSnakeCaseNames_: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::ConflictingSnakeCaseNames_: Drop); assert!( - ::core::mem::offset_of!(crate::no_longer_top_level::ConflictingSnakeCaseNames_, i) == 0 + ::__rust_core::mem::offset_of!(crate::no_longer_top_level::ConflictingSnakeCaseNames_, i) + == 0 ); assert!( - ::core::mem::size_of::() == 1 + ::__rust_core::mem::size_of::( + ) == 1 ); assert!( - ::core::mem::align_of::() - == 1 + ::__rust_core::mem::align_of::( + ) == 1 ); static_assertions::assert_impl_all!(crate::no_longer_top_level::only_one_has_nested_items::Inner: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::only_one_has_nested_items::Inner: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!( + ::__rust_core::mem::size_of::() == 1 + ); + assert!( + ::__rust_core::mem::align_of::() == 1 + ); static_assertions::assert_impl_all!(crate::no_longer_top_level::OnlyOneHasNestedItems: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::OnlyOneHasNestedItems: Drop); - assert!(::core::mem::offset_of!(crate::no_longer_top_level::OnlyOneHasNestedItems, i) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!( + ::__rust_core::mem::offset_of!(crate::no_longer_top_level::OnlyOneHasNestedItems, i) == 0 + ); + assert!( + ::__rust_core::mem::size_of::() == 1 + ); + assert!( + ::__rust_core::mem::align_of::() == 1 + ); static_assertions::assert_impl_all!(crate::no_longer_top_level::OnlyOneHasNestedItems_: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::OnlyOneHasNestedItems_: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::no_longer_top_level::SameNameAsNamespace: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::SameNameAsNamespace: Drop); - assert!(::core::mem::offset_of!(crate::no_longer_top_level::SameNameAsNamespace, i) == 0); - assert!(::core::mem::size_of::() == 1); assert!( - ::core::mem::align_of::() == 1 + ::__rust_core::mem::offset_of!(crate::no_longer_top_level::SameNameAsNamespace, i) == 0 + ); + assert!( + ::__rust_core::mem::size_of::() + == 1 + ); + assert!( + ::__rust_core::mem::align_of::() + == 1 ); static_assertions::assert_impl_all!(crate::no_longer_top_level::same_name_as_namespace::Foo: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::same_name_as_namespace::Foo: Drop); - assert!(::core::mem::size_of::() == 1); assert!( - ::core::mem::align_of::() == 1 + ::__rust_core::mem::size_of::() + == 1 + ); + assert!( + ::__rust_core::mem::align_of::() + == 1 ); static_assertions::assert_impl_all!(crate::no_longer_top_level::same_name_as_namespace::Bar: Copy,Clone); static_assertions::assert_not_impl_any!(crate::no_longer_top_level::same_name_as_namespace::Bar: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::ContainsForwardDeclared: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ContainsForwardDeclared: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api.rs b/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api.rs index eeaf60a09..377036a8e 100644 --- a/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// # Safety /// /// The caller must ensure that the following unsafe arguments are not misused by the function: @@ -26,7 +27,7 @@ pub unsafe fn free_function(p1: *mut ::ffi_11::c_int) -> *mut ::ffi_11::c_int { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=S pub struct S { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for S {} impl !Sync for S {} @@ -68,7 +69,7 @@ impl S { impl Default for S { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN1SC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -80,7 +81,7 @@ impl Default for S { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TriviallyCopyableButNontriviallyDestructible pub struct TriviallyCopyableButNontriviallyDestructible { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 1], } impl !Send for TriviallyCopyableButNontriviallyDestructible {} impl !Sync for TriviallyCopyableButNontriviallyDestructible {} @@ -91,7 +92,7 @@ unsafe impl ::cxx::ExternType for TriviallyCopyableButNontriviallyDestructible { impl ::ctor::Assign<&Self> for TriviallyCopyableButNontriviallyDestructible { #[inline(always)] - fn assign(self: ::core::pin::Pin<&mut Self>, __param_0: &Self) { + fn assign(self: ::__rust_core::pin::Pin<&mut Self>, __param_0: &Self) { unsafe { crate::detail::__rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleaSERKS_( self, __param_0, @@ -110,7 +111,7 @@ impl<'__unelided> ::ctor::CtorNew<&'__unelided Self> let mut __param_0 = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleC1ERKS_(dest as*mut::core::ffi::c_void,__param_0); + crate::detail::__rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleC1ERKS_(dest as*mut::__rust_core::ffi::c_void,__param_0); }) } } @@ -129,7 +130,7 @@ impl<'__unelided> ::ctor::CtorNew<(&'__unelided Self,)> impl ::ctor::PinnedDrop for TriviallyCopyableButNontriviallyDestructible { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleD1Ev(self) } } @@ -147,10 +148,10 @@ pub unsafe fn take_pointer(p: *mut ::ffi_11::c_int) { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=WrappedValue pub struct WrappedValue { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) value_: [::core::mem::MaybeUninit; 4], + pub(crate) value_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for WrappedValue {} impl !Sync for WrappedValue {} @@ -163,7 +164,7 @@ impl From<::ffi_11::c_int> for WrappedValue { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut value = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN12WrappedValueC1Ei(&raw mut tmp as *mut _, value); tmp.assume_init() @@ -179,14 +180,14 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for WrappedValue { } } -impl ::core::ops::Add<&crate::WrappedValue> for &crate::WrappedValue { +impl ::__rust_core::ops::Add<&crate::WrappedValue> for &crate::WrappedValue { type Output = crate::WrappedValue; #[inline(always)] fn add(self, rhs: &crate::WrappedValue) -> Self::Output { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZNK12WrappedValueplERKS_( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, self, rhs, ); @@ -203,7 +204,7 @@ mod detail { pub(crate) unsafe fn __rust_thunk___Z13free_functionRi( p1: *mut ::ffi_11::c_int, ) -> *mut ::ffi_11::c_int; - pub(crate) unsafe fn __rust_thunk___ZN1SC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN1SC1Ev(__this: *mut ::__rust_core::ffi::c_void); #[link_name = "_ZNK1S12const_methodERiS0_"] pub(crate) unsafe fn __rust_thunk___ZNK1S12const_methodERiS0_( __this: *const crate::S, @@ -219,31 +220,35 @@ mod detail { pub(crate) unsafe fn __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleaSERKS_< '__return_lifetime, >( - __this: ::core::pin::Pin<&mut crate::TriviallyCopyableButNontriviallyDestructible>, + __this: ::__rust_core::pin::Pin< + &mut crate::TriviallyCopyableButNontriviallyDestructible, + >, __param_0: &crate::TriviallyCopyableButNontriviallyDestructible, - ) -> ::core::pin::Pin< + ) -> ::__rust_core::pin::Pin< &'__return_lifetime mut crate::TriviallyCopyableButNontriviallyDestructible, >; pub(crate) unsafe fn __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleC1ERKS_< '__unelided, >( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: &'__unelided crate::TriviallyCopyableButNontriviallyDestructible, ); #[link_name = "_ZN44TriviallyCopyableButNontriviallyDestructibleD1Ev"] pub(crate) unsafe fn __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleD1Ev< 'a, >( - __this: ::core::pin::Pin<&'a mut crate::TriviallyCopyableButNontriviallyDestructible>, + __this: ::__rust_core::pin::Pin< + &'a mut crate::TriviallyCopyableButNontriviallyDestructible, + >, ); #[link_name = "_Z12take_pointerPi"] pub(crate) unsafe fn __rust_thunk___Z12take_pointerPi(p: *mut ::ffi_11::c_int); pub(crate) unsafe fn __rust_thunk___ZN12WrappedValueC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, value: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZNK12WrappedValueplERKS_( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, __this: &crate::WrappedValue, rhs: &crate::WrappedValue, ); @@ -251,19 +256,23 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::S: Copy,Clone); static_assertions::assert_not_impl_any!(crate::S: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!( + ::__rust_core::mem::size_of::() == 1 + ); + assert!( + ::__rust_core::mem::align_of::() == 1 + ); static_assertions::assert_impl_all!(crate::TriviallyCopyableButNontriviallyDestructible: Drop); static_assertions::assert_not_impl_any!(crate::TriviallyCopyableButNontriviallyDestructible: Copy); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::WrappedValue: Copy,Clone); static_assertions::assert_not_impl_any!(crate::WrappedValue: Drop); - assert!(::core::mem::offset_of!(crate::WrappedValue, value_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::WrappedValue, value_) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs index c0704f53b..9f29efadd 100644 --- a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// The no_unique_address.h header is present both in /// rs_bindings_from_cc/test/struct/no_unique_address/ and in /// rs_bindings_from_cc/test/golden/ because the format provides end-to-end @@ -27,10 +28,10 @@ pub struct Struct { /// /// Reason for representing this field as a blob of bytes: /// `[[no_unique_address]]` attribute was present. - pub(crate) field1: [::core::mem::MaybeUninit; 4], + pub(crate) field1: [::__rust_core::mem::MaybeUninit; 4], /// Reason for representing this field as a blob of bytes: /// `[[no_unique_address]]` attribute was present. - pub(crate) field2: [::core::mem::MaybeUninit; 4], + pub(crate) field2: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for Struct {} impl !Sync for Struct {} @@ -42,9 +43,9 @@ impl Struct { #[inline(always)] pub fn Make(f1: ::ffi_11::c_int, f2: ::ffi_11::c_char) -> crate::Struct { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN6Struct4MakeEic( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, f1, f2, ); @@ -56,7 +57,7 @@ impl Struct { impl Default for Struct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN6StructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -89,12 +90,12 @@ impl Default for Struct { pub struct PaddingBetweenFields { /// size: 1, alignment: 1 => offset: 0 pub field1: ::ffi_11::c_char, - __padding1: [::core::mem::MaybeUninit; 3], + __padding1: [::__rust_core::mem::MaybeUninit; 3], /// size: 4, alignment: 4 => offset: 4 /// /// Reason for representing this field as a blob of bytes: /// `[[no_unique_address]]` attribute was present. - pub(crate) field2: [::core::mem::MaybeUninit; 4], + pub(crate) field2: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for PaddingBetweenFields {} impl !Sync for PaddingBetweenFields {} @@ -106,9 +107,9 @@ impl PaddingBetweenFields { #[inline(always)] pub fn Make(f1: ::ffi_11::c_char, f2: ::ffi_11::c_int) -> crate::PaddingBetweenFields { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN20PaddingBetweenFields4MakeEci( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, f1, f2, ); @@ -120,7 +121,7 @@ impl PaddingBetweenFields { impl Default for PaddingBetweenFields { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN20PaddingBetweenFieldsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -172,7 +173,7 @@ impl ::ctor::CtorNew<()> for FieldInTailPadding_InnerStruct { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN30FieldInTailPadding_InnerStructC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -190,7 +191,7 @@ impl ::ctor::CtorNew<()> for FieldInTailPadding_InnerStruct { /// layout. impl ::ctor::PinnedDrop for FieldInTailPadding_InnerStruct { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN30FieldInTailPadding_InnerStructD1Ev(self) } } @@ -207,10 +208,10 @@ impl ::ctor::PinnedDrop for FieldInTailPadding_InnerStruct { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=FieldInTailPadding pub struct FieldInTailPadding { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// `[[no_unique_address]]` attribute was present. - pub(crate) inner_struct: [::core::cell::Cell<::core::mem::MaybeUninit>; 5], + pub(crate) inner_struct: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 5], /// offset: 5 (dsize of `s`). pub char_in_tail_padding_of_prev_field: ::ffi_11::c_char, } @@ -229,7 +230,7 @@ unsafe impl ::cxx::ExternType for FieldInTailPadding { impl ::ctor::PinnedDrop for FieldInTailPadding { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN18FieldInTailPaddingD1Ev(self) } } @@ -251,7 +252,7 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_char, ::ffi_11::c_char)> for unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN18FieldInTailPaddingC1Eicc( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, inner_int, inner_char, outer_char, @@ -265,31 +266,31 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN6StructC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN6StructC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN6Struct4MakeEic( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, f1: ::ffi_11::c_int, f2: ::ffi_11::c_char, ); pub(crate) unsafe fn __rust_thunk___ZN20PaddingBetweenFieldsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN20PaddingBetweenFields4MakeEci( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, f1: ::ffi_11::c_char, f2: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN30FieldInTailPadding_InnerStructC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN30FieldInTailPadding_InnerStructD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::FieldInTailPadding_InnerStruct>, + __this: ::__rust_core::pin::Pin<&'a mut crate::FieldInTailPadding_InnerStruct>, ); pub(crate) unsafe fn __rust_thunk___ZN18FieldInTailPaddingD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::FieldInTailPadding>, + __this: ::__rust_core::pin::Pin<&'a mut crate::FieldInTailPadding>, ); pub(crate) unsafe fn __rust_thunk___ZN18FieldInTailPaddingC1Eicc( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, inner_int: ::ffi_11::c_int, inner_char: ::ffi_11::c_char, outer_char: ::ffi_11::c_char, @@ -298,33 +299,41 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Struct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Struct: Drop); - assert!(::core::mem::offset_of!(crate::Struct, field1) == 0); - assert!(::core::mem::offset_of!(crate::Struct, field2) == 4); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::Struct, field1) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Struct, field2) == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::PaddingBetweenFields: Copy,Clone); static_assertions::assert_not_impl_any!(crate::PaddingBetweenFields: Drop); - assert!(::core::mem::offset_of!(crate::PaddingBetweenFields, field1) == 0); - assert!(::core::mem::offset_of!(crate::PaddingBetweenFields, field2) == 4); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::PaddingBetweenFields, field1) == 0); + assert!(::__rust_core::mem::offset_of!(crate::PaddingBetweenFields, field2) == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::FieldInTailPadding_InnerStruct: Drop); static_assertions::assert_not_impl_any!(crate::FieldInTailPadding_InnerStruct: Copy); - assert!(::core::mem::offset_of!(crate::FieldInTailPadding_InnerStruct, inner_int_field) == 0); - assert!(::core::mem::offset_of!(crate::FieldInTailPadding_InnerStruct, inner_char_field) == 4); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldInTailPadding_InnerStruct, inner_int_field) == 0 + ); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldInTailPadding_InnerStruct, inner_char_field) + == 4 + ); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); static_assertions::assert_impl_all!(::ffi_11::c_char: Copy); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::FieldInTailPadding: Drop); static_assertions::assert_not_impl_any!(crate::FieldInTailPadding: Copy); - assert!(::core::mem::offset_of!(crate::FieldInTailPadding, inner_struct) == 0); + assert!(::__rust_core::mem::offset_of!(crate::FieldInTailPadding, inner_struct) == 0); assert!( - ::core::mem::offset_of!(crate::FieldInTailPadding, char_in_tail_padding_of_prev_field) == 5 + ::__rust_core::mem::offset_of!( + crate::FieldInTailPadding, + char_in_tail_padding_of_prev_field + ) == 5 ); static_assertions::assert_impl_all!(::ffi_11::c_char: Copy); }; diff --git a/rs_bindings_from_cc/test/golden/nodiscard_rs_api.rs b/rs_bindings_from_cc/test/golden/nodiscard_rs_api.rs index 67b433773..9b91eb96c 100644 --- a/rs_bindings_from_cc/test/golden/nodiscard_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/nodiscard_rs_api.rs @@ -13,12 +13,13 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[must_use] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NoDiscard pub struct NoDiscard { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for NoDiscard {} impl !Sync for NoDiscard {} @@ -30,7 +31,7 @@ unsafe impl ::cxx::ExternType for NoDiscard { impl Default for NoDiscard { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9NoDiscardC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -43,7 +44,7 @@ impl Default for NoDiscard { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NoDiscardWithMessage pub struct NoDiscardWithMessage { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for NoDiscardWithMessage {} impl !Sync for NoDiscardWithMessage {} @@ -55,7 +56,7 @@ unsafe impl ::cxx::ExternType for NoDiscardWithMessage { impl Default for NoDiscardWithMessage { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN20NoDiscardWithMessageC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -79,7 +80,7 @@ impl Default for NoDiscardWithMessage { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NodiscardCtor pub struct NodiscardCtor { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for NodiscardCtor {} impl !Sync for NodiscardCtor {} @@ -95,7 +96,7 @@ unsafe impl ::cxx::ExternType for NodiscardCtor { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NodiscardCtorWithMessage pub struct NodiscardCtorWithMessage { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for NodiscardCtorWithMessage {} impl !Sync for NodiscardCtorWithMessage {} @@ -111,31 +112,33 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN9NoDiscardC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN9NoDiscardC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN20NoDiscardWithMessageC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::NoDiscard: Copy,Clone); static_assertions::assert_not_impl_any!(crate::NoDiscard: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::NoDiscardWithMessage: Copy,Clone); static_assertions::assert_not_impl_any!(crate::NoDiscardWithMessage: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::NodiscardCtor: Copy,Clone); static_assertions::assert_not_impl_any!(crate::NodiscardCtor: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::NodiscardCtorWithMessage: Copy,Clone); static_assertions::assert_not_impl_any!(crate::NodiscardCtorWithMessage: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/noexcept_rs_api.rs b/rs_bindings_from_cc/test/golden/noexcept_rs_api.rs index d7a5ec44e..299cb2516 100644 --- a/rs_bindings_from_cc/test/golden/noexcept_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/noexcept_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeClass pub struct SomeClass { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeClass {} impl !Sync for SomeClass {} @@ -59,7 +60,7 @@ impl SomeClass { impl Default for SomeClass { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9SomeClassC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -86,7 +87,9 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); #[link_name = "_ZN9SomeClass6createEic"] pub(crate) unsafe fn __rust_thunk___ZN9SomeClass6createEic( i: ::ffi_11::c_int, @@ -114,8 +117,8 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeClass: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeClass: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/non_member_operator_rs_api.rs b/rs_bindings_from_cc/test/golden/non_member_operator_rs_api.rs index 228edaff4..cbf314878 100644 --- a/rs_bindings_from_cc/test/golden/non_member_operator_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/non_member_operator_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod ns { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -30,7 +31,7 @@ pub mod ns { impl Default for X { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN2ns1XC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -52,7 +53,7 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN2ns1XC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN2ns1XC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZeqN2ns1XES0_( a: &mut crate::ns::X, b: &mut crate::ns::X, @@ -61,9 +62,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::ns::X: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ns::X: Drop); - assert!(::core::mem::offset_of!(crate::ns::X, f) == 0); + assert!(::__rust_core::mem::offset_of!(crate::ns::X, f) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs index 17b83485c..3fc022916 100644 --- a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Nontrivial due to (declared, but not yet defined) user-specified constructor /// and destructor. /// @@ -22,7 +23,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Nontrivial pub struct Nontrivial { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, } impl !Send for Nontrivial {} @@ -33,7 +34,7 @@ unsafe impl ::cxx::ExternType for Nontrivial { } impl Nontrivial { #[inline(always)] - pub fn Unqualified<'a>(self: ::core::pin::Pin<&'a mut Self>) { + pub fn Unqualified<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { unsafe { crate::detail::__rust_thunk___ZN10Nontrivial11UnqualifiedEv(self) } } #[inline(always)] @@ -41,7 +42,7 @@ impl Nontrivial { unsafe { crate::detail::__rust_thunk___ZNK10Nontrivial14ConstQualifiedEv(self) } } #[inline(always)] - pub fn LvalueRefQualified<'a>(self: ::core::pin::Pin<&'a mut Self>) { + pub fn LvalueRefQualified<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { unsafe { crate::detail::__rust_thunk___ZNR10Nontrivial18LvalueRefQualifiedEv(self) } } #[inline(always)] @@ -58,7 +59,9 @@ impl ::ctor::CtorNew<()> for Nontrivial { let () = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN10NontrivialC1Ev(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___ZN10NontrivialC1Ev( + dest as *mut ::__rust_core::ffi::c_void, + ); }) } } @@ -73,7 +76,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for Nontrivial { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN10NontrivialC1Ei( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, field, ); }) @@ -99,7 +102,7 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for Nontrivial { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN10NontrivialC1Eii( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, field, unused, ); @@ -127,11 +130,11 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for Nontrivial { impl ::ctor::Assign for Nontrivial { #[inline(always)] - fn assign<'a>(self: ::core::pin::Pin<&'a mut Self>, __param_0: f32) { + fn assign<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>, __param_0: f32) { unsafe { let _ = ::ctor::emplace!(::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN10NontrivialaSEf( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, self, __param_0, ); @@ -142,7 +145,7 @@ impl ::ctor::Assign for Nontrivial { impl ::ctor::PinnedDrop for Nontrivial { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN10NontrivialD1Ev(self) } } @@ -166,7 +169,7 @@ impl ::ctor::PinnedDrop for Nontrivial { // Unsupported parameter #1 (rhs): references are not yet supported // error: function `Nontrivial::operator+=` could not be bound -// Compound assignment operators are not supported for non-Unpin types, found ::core::pin::Pin<&'a mut crate::Nontrivial> +// Compound assignment operators are not supported for non-Unpin types, found ::__rust_core::pin::Pin<&'a mut crate::Nontrivial> /// Nontrivial due to (inline) user-specified constructor and destructor. /// @@ -176,7 +179,7 @@ impl ::ctor::PinnedDrop for Nontrivial { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NontrivialInline pub struct NontrivialInline { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, } impl !Send for NontrivialInline {} @@ -187,7 +190,7 @@ unsafe impl ::cxx::ExternType for NontrivialInline { } impl NontrivialInline { #[inline(always)] - pub fn MemberFunction<'a>(self: ::core::pin::Pin<&'a mut Self>) { + pub fn MemberFunction<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { unsafe { crate::detail::__rust_thunk___ZN16NontrivialInline14MemberFunctionEv(self) } } } @@ -201,7 +204,7 @@ impl ::ctor::CtorNew<()> for NontrivialInline { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN16NontrivialInlineC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -217,7 +220,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for NontrivialInline { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN16NontrivialInlineC1Ei( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, field, ); }) @@ -243,7 +246,7 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for NontrivialInline { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN16NontrivialInlineC1Eii( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, field, unused, ); @@ -271,7 +274,7 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for NontrivialInline { impl ::ctor::PinnedDrop for NontrivialInline { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN16NontrivialInlineD1Ev(self) } } @@ -287,7 +290,8 @@ impl ::ctor::PinnedDrop for NontrivialInline { pub struct NontrivialMembers { /// Reason for representing this field as a blob of bytes: /// nontrivial fields would be destroyed in the wrong order - pub(crate) nontrivial_member: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) nontrivial_member: + [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } impl !Send for NontrivialMembers {} impl !Sync for NontrivialMembers {} @@ -305,7 +309,7 @@ impl ::ctor::CtorNew<()> for NontrivialMembers { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN17NontrivialMembersC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -320,7 +324,7 @@ impl ::ctor::CtorNew<()> for NontrivialMembers { impl ::ctor::PinnedDrop for NontrivialMembers { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN17NontrivialMembersD1Ev(self) } } @@ -337,7 +341,7 @@ impl ::ctor::PinnedDrop for NontrivialMembers { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NontrivialUnpin pub struct NontrivialUnpin { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, } impl !Send for NontrivialUnpin {} @@ -356,7 +360,7 @@ impl NontrivialUnpin { impl Default for NontrivialUnpin { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN15NontrivialUnpinC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -368,7 +372,7 @@ impl From<::ffi_11::c_int> for NontrivialUnpin { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut field = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN15NontrivialUnpinC1Ei(&raw mut tmp as *mut _, field); tmp.assume_init() @@ -388,7 +392,7 @@ impl From<(::ffi_11::c_int, ::ffi_11::c_int)> for NontrivialUnpin { #[inline(always)] fn from(args: (::ffi_11::c_int, ::ffi_11::c_int)) -> Self { let (mut field, mut unused) = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN15NontrivialUnpinC1Eii( &raw mut tmp as *mut _, @@ -442,8 +446,8 @@ pub fn TakesByValue( unsafe { ::ctor::FnCtor::new(move |dest: *mut crate::Nontrivial| { crate::detail::__rust_thunk___Z12TakesByValue10Nontrivial( - dest as *mut ::core::ffi::c_void, - ::core::pin::Pin::into_inner_unchecked(::ctor::emplace!(nontrivial)), + dest as *mut ::__rust_core::ffi::c_void, + ::__rust_core::pin::Pin::into_inner_unchecked(::ctor::emplace!(nontrivial)), ); }) } @@ -456,8 +460,8 @@ pub fn TakesByValueInline( unsafe { ::ctor::FnCtor::new(move |dest: *mut crate::NontrivialInline| { crate::detail::__rust_thunk___Z18TakesByValueInline16NontrivialInline( - dest as *mut ::core::ffi::c_void, - ::core::pin::Pin::into_inner_unchecked(::ctor::emplace!(nontrivial)), + dest as *mut ::__rust_core::ffi::c_void, + ::__rust_core::pin::Pin::into_inner_unchecked(::ctor::emplace!(nontrivial)), ); }) } @@ -466,9 +470,9 @@ pub fn TakesByValueInline( #[inline(always)] pub fn TakesByValueUnpin(mut nontrivial: crate::NontrivialUnpin) -> crate::NontrivialUnpin { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___Z17TakesByValueUnpin15NontrivialUnpin( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, &mut nontrivial, ); __return.assume_init() @@ -512,7 +516,7 @@ pub fn TakesByValueUnpin(mut nontrivial: crate::NontrivialUnpin) -> crate::Nontr #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NontrivialByValue pub struct NontrivialByValue { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for NontrivialByValue {} impl !Sync for NontrivialByValue {} @@ -541,9 +545,9 @@ impl<'other> ::ctor::UnpinAssign<::ctor::RvalueReference<'other, crate::Nontrivi #[inline(always)] fn unpin_assign<'a>(&'a mut self, other: ::ctor::RvalueReference<'other, crate::Nontrivial>) { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN17NontrivialByValueaSE10Nontrivial( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, self, other, ); @@ -574,7 +578,7 @@ where #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Nonmovable pub struct Nonmovable { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 1], } impl !Send for Nonmovable {} impl !Sync for Nonmovable {} @@ -584,7 +588,7 @@ unsafe impl ::cxx::ExternType for Nonmovable { } impl Nonmovable { #[inline(always)] - pub fn MemberFunction<'a>(self: ::core::pin::Pin<&'a mut Self>) { + pub fn MemberFunction<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { unsafe { crate::detail::__rust_thunk___ZN10Nonmovable14MemberFunctionEv(self) } } } @@ -597,7 +601,9 @@ impl ::ctor::CtorNew<()> for Nonmovable { let () = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN10NonmovableC1Ev(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___ZN10NonmovableC1Ev( + dest as *mut ::__rust_core::ffi::c_void, + ); }) } } @@ -605,7 +611,7 @@ impl ::ctor::CtorNew<()> for Nonmovable { impl ::ctor::PinnedDrop for Nonmovable { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN10NonmovableD1Ev(self) } } @@ -631,7 +637,7 @@ pub fn ReturnsNonmovableByValue() -> ::ctor::Ctor![crate::Nonmovable] { unsafe { ::ctor::FnCtor::new(move |dest: *mut crate::Nonmovable| { crate::detail::__rust_thunk___Z24ReturnsNonmovableByValuev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -642,30 +648,32 @@ mod detail { use super::*; unsafe extern "C" { #[link_name = "_ZN10NontrivialC1Ev"] - pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); #[link_name = "_ZN10NontrivialC1Ei"] pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, ); #[link_name = "_ZN10NontrivialC1Eii"] pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1Eii( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, unused: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN10NontrivialaSEf<'a>( - __return: *mut ::core::ffi::c_void, - __this: ::core::pin::Pin<&'a mut crate::Nontrivial>, + __return: *mut ::__rust_core::ffi::c_void, + __this: ::__rust_core::pin::Pin<&'a mut crate::Nontrivial>, __param_0: f32, ); #[link_name = "_ZN10NontrivialD1Ev"] pub(crate) unsafe fn __rust_thunk___ZN10NontrivialD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::Nontrivial>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Nontrivial>, ); #[link_name = "_ZN10Nontrivial11UnqualifiedEv"] pub(crate) unsafe fn __rust_thunk___ZN10Nontrivial11UnqualifiedEv<'a>( - __this: ::core::pin::Pin<&'a mut crate::Nontrivial>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Nontrivial>, ); #[link_name = "_ZNK10Nontrivial14ConstQualifiedEv"] pub(crate) unsafe fn __rust_thunk___ZNK10Nontrivial14ConstQualifiedEv<'a>( @@ -673,48 +681,48 @@ mod detail { ); #[link_name = "_ZNR10Nontrivial18LvalueRefQualifiedEv"] pub(crate) unsafe fn __rust_thunk___ZNR10Nontrivial18LvalueRefQualifiedEv<'a>( - __this: ::core::pin::Pin<&'a mut crate::Nontrivial>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Nontrivial>, ); #[link_name = "_ZNKR10Nontrivial23ConstLvalueRefQualifiedEv"] pub(crate) unsafe fn __rust_thunk___ZNKR10Nontrivial23ConstLvalueRefQualifiedEv<'a>( __this: &'a crate::Nontrivial, ); pub(crate) unsafe fn __rust_thunk___ZN16NontrivialInlineC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN16NontrivialInlineC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN16NontrivialInlineC1Eii( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, unused: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN16NontrivialInlineD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::NontrivialInline>, + __this: ::__rust_core::pin::Pin<&'a mut crate::NontrivialInline>, ); pub(crate) unsafe fn __rust_thunk___ZN16NontrivialInline14MemberFunctionEv<'a>( - __this: ::core::pin::Pin<&'a mut crate::NontrivialInline>, + __this: ::__rust_core::pin::Pin<&'a mut crate::NontrivialInline>, ); pub(crate) unsafe fn __rust_thunk___ZN17NontrivialMembersC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN17NontrivialMembersD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::NontrivialMembers>, + __this: ::__rust_core::pin::Pin<&'a mut crate::NontrivialMembers>, ); #[link_name = "_ZN15NontrivialUnpinC1Ev"] pub(crate) unsafe fn __rust_thunk___ZN15NontrivialUnpinC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN15NontrivialUnpinC1Ei"] pub(crate) unsafe fn __rust_thunk___ZN15NontrivialUnpinC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, ); #[link_name = "_ZN15NontrivialUnpinC1Eii"] pub(crate) unsafe fn __rust_thunk___ZN15NontrivialUnpinC1Eii( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, unused: ::ffi_11::c_int, ); @@ -727,69 +735,71 @@ mod detail { __this: &'a mut crate::NontrivialUnpin, ); pub(crate) unsafe fn __rust_thunk___Z12TakesByValue10Nontrivial( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, nontrivial: &mut crate::Nontrivial, ); pub(crate) unsafe fn __rust_thunk___Z18TakesByValueInline16NontrivialInline( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, nontrivial: &mut crate::NontrivialInline, ); pub(crate) unsafe fn __rust_thunk___Z17TakesByValueUnpin15NontrivialUnpin( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, nontrivial: &mut crate::NontrivialUnpin, ); pub(crate) unsafe fn __rust_thunk___ZN17NontrivialByValueaSE10Nontrivial<'a, 'other>( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, __this: &'a mut crate::NontrivialByValue, other: ::ctor::RvalueReference<'other, crate::Nontrivial>, ); #[link_name = "_ZN10NonmovableC1Ev"] - pub(crate) unsafe fn __rust_thunk___ZN10NonmovableC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10NonmovableC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); #[link_name = "_ZN10NonmovableD1Ev"] pub(crate) unsafe fn __rust_thunk___ZN10NonmovableD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::Nonmovable>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Nonmovable>, ); #[link_name = "_ZN10Nonmovable14MemberFunctionEv"] pub(crate) unsafe fn __rust_thunk___ZN10Nonmovable14MemberFunctionEv<'a>( - __this: ::core::pin::Pin<&'a mut crate::Nonmovable>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Nonmovable>, ); pub(crate) unsafe fn __rust_thunk___Z24ReturnsNonmovableByValuev( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Nontrivial: Drop); static_assertions::assert_not_impl_any!(crate::Nontrivial: Copy); - assert!(::core::mem::offset_of!(crate::Nontrivial, field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Nontrivial, field) == 0); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::NontrivialInline: Drop); static_assertions::assert_not_impl_any!(crate::NontrivialInline: Copy); - assert!(::core::mem::offset_of!(crate::NontrivialInline, field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NontrivialInline, field) == 0); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::NontrivialMembers: Drop); static_assertions::assert_not_impl_any!(crate::NontrivialMembers: Copy); - assert!(::core::mem::offset_of!(crate::NontrivialMembers, nontrivial_member) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::NontrivialMembers, nontrivial_member) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::NontrivialUnpin: Drop); static_assertions::assert_not_impl_any!(crate::NontrivialUnpin: Copy); - assert!(::core::mem::offset_of!(crate::NontrivialUnpin, field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NontrivialUnpin, field) == 0); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::NontrivialByValue: Copy,Clone); static_assertions::assert_not_impl_any!(crate::NontrivialByValue: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Nonmovable: Drop); static_assertions::assert_not_impl_any!(crate::Nonmovable: Copy); }; diff --git a/rs_bindings_from_cc/test/golden/operators_rs_api.rs b/rs_bindings_from_cc/test/golden/operators_rs_api.rs index 22c7a8420..d682f2bf7 100644 --- a/rs_bindings_from_cc/test/golden/operators_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/operators_rs_api.rs @@ -13,14 +13,15 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=AddableConstMember pub struct AddableConstMember { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::mem::MaybeUninit; 4], + pub(crate) field_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for AddableConstMember {} impl !Sync for AddableConstMember {} @@ -32,7 +33,7 @@ unsafe impl ::cxx::ExternType for AddableConstMember { impl Default for AddableConstMember { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18AddableConstMemberC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -61,10 +62,10 @@ impl Default for AddableConstMember { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=AddableNonConstMember pub struct AddableNonConstMember { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::mem::MaybeUninit; 4], + pub(crate) field_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for AddableNonConstMember {} impl !Sync for AddableNonConstMember {} @@ -76,7 +77,7 @@ unsafe impl ::cxx::ExternType for AddableNonConstMember { impl Default for AddableNonConstMember { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN21AddableNonConstMemberC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -105,10 +106,10 @@ impl Default for AddableNonConstMember { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=AddableFriend pub struct AddableFriend { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::mem::MaybeUninit; 4], + pub(crate) field_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for AddableFriend {} impl !Sync for AddableFriend {} @@ -120,7 +121,7 @@ unsafe impl ::cxx::ExternType for AddableFriend { impl Default for AddableFriend { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13AddableFriendC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -150,7 +151,7 @@ impl Default for AddableFriend { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddableFreeByConstRef pub struct AddableFreeByConstRef { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByConstRef {} impl !Sync for AddableFreeByConstRef {} @@ -162,7 +163,7 @@ unsafe impl ::cxx::ExternType for AddableFreeByConstRef { impl Default for AddableFreeByConstRef { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN21AddableFreeByConstRefC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -188,7 +189,7 @@ impl Default for AddableFreeByConstRef { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddableFreeByMutRef pub struct AddableFreeByMutRef { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByMutRef {} impl !Sync for AddableFreeByMutRef {} @@ -200,7 +201,7 @@ unsafe impl ::cxx::ExternType for AddableFreeByMutRef { impl Default for AddableFreeByMutRef { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN19AddableFreeByMutRefC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -226,7 +227,7 @@ impl Default for AddableFreeByMutRef { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddableFreeByValue pub struct AddableFreeByValue { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByValue {} impl !Sync for AddableFreeByValue {} @@ -238,7 +239,7 @@ unsafe impl ::cxx::ExternType for AddableFreeByValue { impl Default for AddableFreeByValue { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18AddableFreeByValueC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -264,7 +265,7 @@ impl Default for AddableFreeByValue { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddableFreeByRValueRef pub struct AddableFreeByRValueRef { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByRValueRef {} impl !Sync for AddableFreeByRValueRef {} @@ -276,7 +277,7 @@ unsafe impl ::cxx::ExternType for AddableFreeByRValueRef { impl Default for AddableFreeByRValueRef { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN22AddableFreeByRValueRefC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -306,14 +307,14 @@ impl Default for AddableFreeByRValueRef { // Unsupported parameter #0 (lhs): references are not yet supported // Unsupported parameter #1 (rhs): references are not yet supported -impl ::core::ops::Add for crate::AddableFreeByValue { +impl ::__rust_core::ops::Add for crate::AddableFreeByValue { type Output = crate::AddableFreeByValue; #[inline(always)] fn add(mut self, mut rhs: Self) -> Self::Output { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___Zpl18AddableFreeByValueS_( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, &mut self, &mut rhs, ); @@ -329,7 +330,7 @@ impl ::core::ops::Add for crate::AddableFreeByValue { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Overloaded pub struct Overloaded { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Overloaded {} impl !Sync for Overloaded {} @@ -341,7 +342,7 @@ unsafe impl ::cxx::ExternType for Overloaded { impl Default for Overloaded { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN10OverloadedC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -373,7 +374,7 @@ impl Default for Overloaded { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=IncompatibleLHS pub struct IncompatibleLHS { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for IncompatibleLHS {} impl !Sync for IncompatibleLHS {} @@ -385,7 +386,7 @@ unsafe impl ::cxx::ExternType for IncompatibleLHS { impl Default for IncompatibleLHS { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN15IncompatibleLHSC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -417,10 +418,10 @@ impl Default for IncompatibleLHS { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=AddableReturnsVoid pub struct AddableReturnsVoid { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::mem::MaybeUninit; 4], + pub(crate) field_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for AddableReturnsVoid {} impl !Sync for AddableReturnsVoid {} @@ -432,7 +433,7 @@ unsafe impl ::cxx::ExternType for AddableReturnsVoid { impl Default for AddableReturnsVoid { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18AddableReturnsVoidC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -461,10 +462,10 @@ impl Default for AddableReturnsVoid { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=AddableConstMemberNonunpin pub struct AddableConstMemberNonunpin { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) field_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } impl !Send for AddableConstMemberNonunpin {} impl !Sync for AddableConstMemberNonunpin {} @@ -482,7 +483,7 @@ impl ::ctor::CtorNew<()> for AddableConstMemberNonunpin { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN26AddableConstMemberNonunpinC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -501,7 +502,7 @@ impl ::ctor::CtorNew<()> for AddableConstMemberNonunpin { impl ::ctor::PinnedDrop for AddableConstMemberNonunpin { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN26AddableConstMemberNonunpinD1Ev(self) } } @@ -510,7 +511,7 @@ impl ::ctor::PinnedDrop for AddableConstMemberNonunpin { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignMemberInt pub struct AddAssignMemberInt { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignMemberInt {} impl !Sync for AddAssignMemberInt {} @@ -522,7 +523,7 @@ unsafe impl ::cxx::ExternType for AddAssignMemberInt { impl Default for AddAssignMemberInt { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18AddAssignMemberIntC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -544,7 +545,7 @@ impl Default for AddAssignMemberInt { // Unsupported return type: references are not yet supported // Unsupported parameter #1 (__param_0): references are not yet supported -impl ::core::ops::AddAssign<::ffi_11::c_int> for AddAssignMemberInt { +impl ::__rust_core::ops::AddAssign<::ffi_11::c_int> for AddAssignMemberInt { #[inline(always)] fn add_assign<'a>(&'a mut self, rhs: ::ffi_11::c_int) { unsafe { @@ -557,7 +558,7 @@ impl ::core::ops::AddAssign<::ffi_11::c_int> for AddAssignMemberInt { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignMemberByConstRef pub struct AddAssignMemberByConstRef { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignMemberByConstRef {} impl !Sync for AddAssignMemberByConstRef {} @@ -569,7 +570,7 @@ unsafe impl ::cxx::ExternType for AddAssignMemberByConstRef { impl Default for AddAssignMemberByConstRef { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN25AddAssignMemberByConstRefC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -599,7 +600,7 @@ impl Default for AddAssignMemberByConstRef { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignFreeByConstRef pub struct AddAssignFreeByConstRef { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignFreeByConstRef {} impl !Sync for AddAssignFreeByConstRef {} @@ -611,7 +612,7 @@ unsafe impl ::cxx::ExternType for AddAssignFreeByConstRef { impl Default for AddAssignFreeByConstRef { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23AddAssignFreeByConstRefC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -633,7 +634,7 @@ impl Default for AddAssignFreeByConstRef { // Unsupported return type: references are not yet supported // Unsupported parameter #1 (__param_0): references are not yet supported -impl ::core::ops::AddAssign<&Self> for crate::AddAssignFreeByConstRef { +impl ::__rust_core::ops::AddAssign<&Self> for crate::AddAssignFreeByConstRef { #[inline(always)] fn add_assign(&mut self, rhs: &Self) { unsafe { @@ -646,7 +647,7 @@ impl ::core::ops::AddAssign<&Self> for crate::AddAssignFreeByConstRef { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignFreeByValue pub struct AddAssignFreeByValue { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignFreeByValue {} impl !Sync for AddAssignFreeByValue {} @@ -658,7 +659,7 @@ unsafe impl ::cxx::ExternType for AddAssignFreeByValue { impl Default for AddAssignFreeByValue { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN20AddAssignFreeByValueC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -688,7 +689,7 @@ impl Default for AddAssignFreeByValue { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignFriendByConstRef pub struct AddAssignFriendByConstRef { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignFriendByConstRef {} impl !Sync for AddAssignFriendByConstRef {} @@ -700,7 +701,7 @@ unsafe impl ::cxx::ExternType for AddAssignFriendByConstRef { impl Default for AddAssignFriendByConstRef { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN25AddAssignFriendByConstRefC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -722,7 +723,7 @@ impl Default for AddAssignFriendByConstRef { // Unsupported return type: references are not yet supported // Unsupported parameter #1 (__param_0): references are not yet supported -impl ::core::ops::AddAssign<&Self> for crate::AddAssignFriendByConstRef { +impl ::__rust_core::ops::AddAssign<&Self> for crate::AddAssignFriendByConstRef { #[inline(always)] fn add_assign(&mut self, rhs: &Self) { unsafe { @@ -735,7 +736,7 @@ impl ::core::ops::AddAssign<&Self> for crate::AddAssignFriendByConstRef { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignFriendByValue pub struct AddAssignFriendByValue { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignFriendByValue {} impl !Sync for AddAssignFriendByValue {} @@ -747,7 +748,7 @@ unsafe impl ::cxx::ExternType for AddAssignFriendByValue { impl Default for AddAssignFriendByValue { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN22AddAssignFriendByValueC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -777,7 +778,7 @@ impl Default for AddAssignFriendByValue { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignProhibitedConstMember pub struct AddAssignProhibitedConstMember { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignProhibitedConstMember {} impl !Sync for AddAssignProhibitedConstMember {} @@ -789,7 +790,7 @@ unsafe impl ::cxx::ExternType for AddAssignProhibitedConstMember { impl Default for AddAssignProhibitedConstMember { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN30AddAssignProhibitedConstMemberC1Ev( &raw mut tmp as *mut _, @@ -817,7 +818,7 @@ impl Default for AddAssignProhibitedConstMember { message = "binding generation for function failed\nCompound assignment with const left-hand side is not supported, found &'a crate::AddAssignProhibitedConstMember" )] pub trait BindingFailedFor_ZNK30AddAssignProhibitedConstMemberpLEi {} -impl<'error> ::core::ops::AddAssign<::ffi_11::c_int> for AddAssignProhibitedConstMember +impl<'error> ::__rust_core::ops::AddAssign<::ffi_11::c_int> for AddAssignProhibitedConstMember where &'error (): BindingFailedFor_ZNK30AddAssignProhibitedConstMemberpLEi, { @@ -835,7 +836,7 @@ where #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=AddAssignProhibitedFriendConstLhs pub struct AddAssignProhibitedFriendConstLhs { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for AddAssignProhibitedFriendConstLhs {} impl !Sync for AddAssignProhibitedFriendConstLhs {} @@ -847,7 +848,7 @@ unsafe impl ::cxx::ExternType for AddAssignProhibitedFriendConstLhs { impl Default for AddAssignProhibitedFriendConstLhs { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN33AddAssignProhibitedFriendConstLhsC1Ev( &raw mut tmp as *mut _, @@ -878,7 +879,7 @@ impl Default for AddAssignProhibitedFriendConstLhs { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=ManyOperators pub struct ManyOperators { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for ManyOperators {} impl !Sync for ManyOperators {} @@ -890,9 +891,9 @@ impl ManyOperators { #[inline(always)] pub fn unary_plus<'a>(&'a self) -> crate::ManyOperators { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZNK13ManyOperatorspsEv( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, self, ); __return.assume_init() @@ -903,7 +904,7 @@ impl ManyOperators { impl Default for ManyOperators { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13ManyOperatorsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -925,14 +926,14 @@ impl Default for ManyOperators { // Unsupported return type: references are not yet supported // Unsupported parameter #1 (__param_0): references are not yet supported -impl<'a> ::core::ops::Neg for &'a crate::ManyOperators { +impl<'a> ::__rust_core::ops::Neg for &'a crate::ManyOperators { type Output = crate::ManyOperators; #[inline(always)] fn neg(self) -> Self::Output { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZNK13ManyOperatorsngEv( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, self, ); __return.assume_init() @@ -940,14 +941,14 @@ impl<'a> ::core::ops::Neg for &'a crate::ManyOperators { } } -impl<'a> ::core::ops::Not for &'a crate::ManyOperators { +impl<'a> ::__rust_core::ops::Not for &'a crate::ManyOperators { type Output = crate::ManyOperators; #[inline(always)] fn not(self) -> Self::Output { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZNK13ManyOperatorsntEv( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, self, ); __return.assume_init() @@ -1033,44 +1034,48 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN18AddableConstMemberC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN21AddableNonConstMemberC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN13AddableFriendC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN13AddableFriendC1Ev(__this: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN21AddableFreeByConstRefC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN19AddableFreeByMutRefC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN18AddableFreeByValueC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN22AddableFreeByRValueRefC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___Zpl18AddableFreeByValueS_( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, lhs: &mut crate::AddableFreeByValue, rhs: &mut crate::AddableFreeByValue, ); - pub(crate) unsafe fn __rust_thunk___ZN10OverloadedC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10OverloadedC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN15IncompatibleLHSC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN18AddableReturnsVoidC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN26AddableConstMemberNonunpinC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN26AddableConstMemberNonunpinD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::AddableConstMemberNonunpin>, + __this: ::__rust_core::pin::Pin<&'a mut crate::AddableConstMemberNonunpin>, ); pub(crate) unsafe fn __rust_thunk___ZN18AddAssignMemberIntC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN18AddAssignMemberIntpLEi"] pub(crate) unsafe fn __rust_thunk___ZN18AddAssignMemberIntpLEi<'a>( @@ -1078,10 +1083,10 @@ mod detail { rhs: ::ffi_11::c_int, ) -> ::ffi_11::c_int; pub(crate) unsafe fn __rust_thunk___ZN25AddAssignMemberByConstRefC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN23AddAssignFreeByConstRefC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZpLR23AddAssignFreeByConstRefRKS_"] pub(crate) unsafe fn __rust_thunk___ZpLR23AddAssignFreeByConstRefRKS_<'__return_lifetime>( @@ -1089,10 +1094,10 @@ mod detail { rhs: &crate::AddAssignFreeByConstRef, ) -> &'__return_lifetime mut crate::AddAssignFreeByConstRef; pub(crate) unsafe fn __rust_thunk___ZN20AddAssignFreeByValueC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN25AddAssignFriendByConstRefC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZpLR25AddAssignFriendByConstRefRKS_"] pub(crate) unsafe fn __rust_thunk___ZpLR25AddAssignFriendByConstRefRKS_< @@ -1102,128 +1107,130 @@ mod detail { rhs: &crate::AddAssignFriendByConstRef, ) -> &'__return_lifetime mut crate::AddAssignFriendByConstRef; pub(crate) unsafe fn __rust_thunk___ZN22AddAssignFriendByValueC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN30AddAssignProhibitedConstMemberC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN33AddAssignProhibitedFriendConstLhsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN13ManyOperatorsC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN13ManyOperatorsC1Ev(__this: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZNK13ManyOperatorspsEv<'a>( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, __this: &'a crate::ManyOperators, ); pub(crate) unsafe fn __rust_thunk___ZNK13ManyOperatorsngEv<'a>( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, __this: &'a crate::ManyOperators, ); pub(crate) unsafe fn __rust_thunk___ZNK13ManyOperatorsntEv<'a>( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, __this: &'a crate::ManyOperators, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::AddableConstMember: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableConstMember: Drop); - assert!(::core::mem::offset_of!(crate::AddableConstMember, field_) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::AddableConstMember, field_) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::AddableNonConstMember: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableNonConstMember: Drop); - assert!(::core::mem::offset_of!(crate::AddableNonConstMember, field_) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::AddableNonConstMember, field_) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::AddableFriend: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableFriend: Drop); - assert!(::core::mem::offset_of!(crate::AddableFriend, field_) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::AddableFriend, field_) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddableFreeByConstRef: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableFreeByConstRef: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddableFreeByMutRef: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableFreeByMutRef: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddableFreeByValue: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableFreeByValue: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddableFreeByRValueRef: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableFreeByRValueRef: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Overloaded: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Overloaded: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::IncompatibleLHS: Copy,Clone); static_assertions::assert_not_impl_any!(crate::IncompatibleLHS: Drop); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::AddableReturnsVoid: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddableReturnsVoid: Drop); - assert!(::core::mem::offset_of!(crate::AddableReturnsVoid, field_) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::AddableReturnsVoid, field_) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::AddableConstMemberNonunpin: Drop); static_assertions::assert_not_impl_any!(crate::AddableConstMemberNonunpin: Copy); - assert!(::core::mem::offset_of!(crate::AddableConstMemberNonunpin, field_) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::AddableConstMemberNonunpin, field_) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignMemberInt: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignMemberInt: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignMemberByConstRef: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignMemberByConstRef: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignFreeByConstRef: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignFreeByConstRef: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignFreeByValue: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignFreeByValue: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignFriendByConstRef: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignFriendByConstRef: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignFriendByValue: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignFriendByValue: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignProhibitedConstMember: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignProhibitedConstMember: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::AddAssignProhibitedFriendConstLhs: Copy,Clone); static_assertions::assert_not_impl_any!(crate::AddAssignProhibitedFriendConstLhs: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::ManyOperators: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ManyOperators: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/overloads_rs_api.rs b/rs_bindings_from_cc/test/golden/overloads_rs_api.rs index 00e0e454a..6abe1427f 100644 --- a/rs_bindings_from_cc/test/golden/overloads_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/overloads_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: function `Overload` could not be bound // Cannot generate bindings for overloaded function @@ -55,7 +56,7 @@ pub fn AlsoTemplateOverload() { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Foo pub struct Foo { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Foo {} impl !Sync for Foo {} @@ -77,7 +78,7 @@ impl Foo { impl Default for Foo { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN3FooC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -110,7 +111,7 @@ mod detail { #[link_name = "_Z9Overlaod2i"] pub(crate) unsafe fn __rust_thunk___Z9Overlaod2i(__param_0: ::ffi_11::c_int); pub(crate) unsafe fn __rust_thunk___Z20AlsoTemplateOverloadv(); - pub(crate) unsafe fn __rust_thunk___ZN3FooC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN3FooC1Ev(__this: *mut ::__rust_core::ffi::c_void); #[link_name = "_ZN3Foo3BarEi"] pub(crate) unsafe fn __rust_thunk___ZN3Foo3BarEi( __this: *mut crate::Foo, @@ -120,8 +121,8 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Foo: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Foo: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api.rs b/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api.rs index 9b1ab00d3..5faeccc73 100644 --- a/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Tests that no bindings are generated when an overload set includes /// any unsupported items. /// diff --git a/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api.rs b/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api.rs index d121401e9..96e276839 100644 --- a/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Tests that no bindings are generated when an overload set includes /// any unsupported items. /// @@ -21,7 +22,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeClass pub struct SomeClass { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeClass {} impl !Sync for SomeClass {} @@ -33,7 +34,7 @@ unsafe impl ::cxx::ExternType for SomeClass { impl Default for SomeClass { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9SomeClassC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -51,13 +52,15 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeClass: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeClass: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs b/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs index df6eb3b99..c5283947b 100644 --- a/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=PolymorphicBase pub struct PolymorphicBase { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 8], } impl !Send for PolymorphicBase {} impl !Sync for PolymorphicBase {} @@ -35,7 +36,7 @@ impl ::ctor::CtorNew<()> for PolymorphicBase { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN15PolymorphicBaseC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -51,7 +52,7 @@ impl ::ctor::CtorNew<()> for PolymorphicBase { impl ::ctor::PinnedDrop for PolymorphicBase { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN15PolymorphicBaseD1Ev(self) } } @@ -67,7 +68,7 @@ unsafe impl ::operator::Delete for crate::PolymorphicBase { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=PolymorphicBase2 pub struct PolymorphicBase2 { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 8], } impl !Send for PolymorphicBase2 {} impl !Sync for PolymorphicBase2 {} @@ -77,7 +78,7 @@ unsafe impl ::cxx::ExternType for PolymorphicBase2 { } impl PolymorphicBase2 { #[inline(always)] - pub fn Foo<'a>(self: ::core::pin::Pin<&'a mut Self>) { + pub fn Foo<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { unsafe { crate::detail::__rust_thunk___ZN16PolymorphicBase23FooEv(self) } } } @@ -91,7 +92,7 @@ impl ::ctor::CtorNew<()> for PolymorphicBase2 { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN16PolymorphicBase2C1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -107,7 +108,7 @@ impl ::ctor::CtorNew<()> for PolymorphicBase2 { impl ::ctor::PinnedDrop for PolymorphicBase2 { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN16PolymorphicBase2D1Ev(self) } } @@ -123,7 +124,7 @@ unsafe impl ::operator::Delete for crate::PolymorphicBase2 { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=PolymorphicDerived pub struct PolymorphicDerived { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 16], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 16], } impl !Send for PolymorphicDerived {} impl !Sync for PolymorphicDerived {} @@ -141,7 +142,7 @@ impl ::ctor::CtorNew<()> for PolymorphicDerived { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN18PolymorphicDerivedC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -156,7 +157,7 @@ impl ::ctor::CtorNew<()> for PolymorphicDerived { impl ::ctor::PinnedDrop for PolymorphicDerived { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN18PolymorphicDerivedD1Ev(self) } } @@ -181,31 +182,31 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN15PolymorphicBaseC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN15PolymorphicBaseD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::PolymorphicBase>, + __this: ::__rust_core::pin::Pin<&'a mut crate::PolymorphicBase>, ); pub(crate) unsafe fn __crubit_operator_delete__15PolymorphicBase___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3apolymorphic_5fcc( ptr: *mut crate::PolymorphicBase, ); pub(crate) unsafe fn __rust_thunk___ZN16PolymorphicBase2C1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN16PolymorphicBase23FooEv<'a>( - __this: ::core::pin::Pin<&'a mut crate::PolymorphicBase2>, + __this: ::__rust_core::pin::Pin<&'a mut crate::PolymorphicBase2>, ); pub(crate) unsafe fn __rust_thunk___ZN16PolymorphicBase2D1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::PolymorphicBase2>, + __this: ::__rust_core::pin::Pin<&'a mut crate::PolymorphicBase2>, ); pub(crate) unsafe fn __crubit_operator_delete__16PolymorphicBase2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3apolymorphic_5fcc( ptr: *mut crate::PolymorphicBase2, ); pub(crate) unsafe fn __rust_thunk___ZN18PolymorphicDerivedC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN18PolymorphicDerivedD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::PolymorphicDerived>, + __this: ::__rust_core::pin::Pin<&'a mut crate::PolymorphicDerived>, ); pub(crate) unsafe fn __crubit_operator_delete__18PolymorphicDerived___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3apolymorphic_5fcc( ptr: *mut crate::PolymorphicDerived, @@ -214,18 +215,18 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::PolymorphicBase: Drop); static_assertions::assert_not_impl_any!(crate::PolymorphicBase: Copy); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::PolymorphicBase2: Drop); static_assertions::assert_not_impl_any!(crate::PolymorphicBase2: Copy); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::PolymorphicDerived: Drop); static_assertions::assert_not_impl_any!(crate::PolymorphicDerived: Copy); }; diff --git a/rs_bindings_from_cc/test/golden/private_members_rs_api.rs b/rs_bindings_from_cc/test/golden/private_members_rs_api.rs index 1c4e805b9..f68801586 100644 --- a/rs_bindings_from_cc/test/golden/private_members_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/private_members_rs_api.rs @@ -13,16 +13,17 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod test_namespace_bindings { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings :: SomeClass pub struct SomeClass { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub public_member_variable_: ::ffi_11::c_int, /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) private_member_variable_: [::core::mem::MaybeUninit; 4], + pub(crate) private_member_variable_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for SomeClass {} impl !Sync for SomeClass {} @@ -50,7 +51,7 @@ pub mod test_namespace_bindings { impl Default for SomeClass { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings9SomeClassC1Ev( &raw mut tmp as *mut _, @@ -82,7 +83,7 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN23test_namespace_bindings9SomeClassC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN23test_namespace_bindings9SomeClass13public_methodEv"] pub(crate) unsafe fn __rust_thunk___ZN23test_namespace_bindings9SomeClass13public_methodEv< @@ -97,16 +98,18 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::test_namespace_bindings::SomeClass: Copy,Clone); static_assertions::assert_not_impl_any!(crate::test_namespace_bindings::SomeClass: Drop); assert!( - ::core::mem::offset_of!(crate::test_namespace_bindings::SomeClass, public_member_variable_) - == 0 + ::__rust_core::mem::offset_of!( + crate::test_namespace_bindings::SomeClass, + public_member_variable_ + ) == 0 ); assert!( - ::core::mem::offset_of!( + ::__rust_core::mem::offset_of!( crate::test_namespace_bindings::SomeClass, private_member_variable_ ) == 4 diff --git a/rs_bindings_from_cc/test/golden/private_method_rs_api.rs b/rs_bindings_from_cc/test/golden/private_method_rs_api.rs index 5a1e68dab..11474ca38 100644 --- a/rs_bindings_from_cc/test/golden/private_method_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/private_method_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: class `Ptr` could not be bound // Class templates are not yet supported @@ -20,7 +21,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Outer pub struct Outer { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Outer {} impl !Sync for Outer {} @@ -32,7 +33,7 @@ unsafe impl ::cxx::ExternType for Outer { impl Default for Outer { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5OuterC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -44,13 +45,13 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN5OuterC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN5OuterC1Ev(__this: *mut ::__rust_core::ffi::c_void); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Outer: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Outer: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/static_methods_rs_api.rs b/rs_bindings_from_cc/test/golden/static_methods_rs_api.rs index 8064f8650..50ab5a261 100644 --- a/rs_bindings_from_cc/test/golden/static_methods_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/static_methods_rs_api.rs @@ -13,14 +13,15 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=SomeClass pub struct SomeClass { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::mem::MaybeUninit; 4], + pub(crate) field_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for SomeClass {} impl !Sync for SomeClass {} @@ -33,9 +34,9 @@ impl SomeClass { #[inline(always)] pub fn static_factory_method(initial_value_of_field: ::ffi_11::c_int) -> crate::SomeClass { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN9SomeClass21static_factory_methodEi( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, initial_value_of_field, ); __return.assume_init() @@ -58,7 +59,7 @@ impl SomeClass { impl Default for SomeClass { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9SomeClassC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -70,9 +71,11 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN9SomeClass21static_factory_methodEi( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, initial_value_of_field: ::ffi_11::c_int, ); #[link_name = "_ZN9SomeClass38static_method_that_multiplies_its_argsEii"] @@ -84,9 +87,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::SomeClass: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeClass: Drop); - assert!(::core::mem::offset_of!(crate::SomeClass, field_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::SomeClass, field_) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/template_inst_rs_api.rs b/rs_bindings_from_cc/test/golden/template_inst_rs_api.rs index f88739316..abeb384f7 100644 --- a/rs_bindings_from_cc/test/golden/template_inst_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/template_inst_rs_api.rs @@ -13,14 +13,15 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// This library reproduces the issue in b/458678348. #[inline(always)] pub(crate) fn GetMyTemplate() -> crate::__CcTemplateInst10MyTemplateIiE { unsafe { let mut __return = - ::core::mem::MaybeUninit::::uninit(); + ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___Z13GetMyTemplatev( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, ); __return.assume_init() } @@ -58,14 +59,16 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___Z13GetMyTemplatev(__return: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___Z13GetMyTemplatev( + __return: *mut ::__rust_core::ffi::c_void, + ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::__CcTemplateInst10MyTemplateIiE: Copy,Clone); static_assertions::assert_not_impl_any!(crate::__CcTemplateInst10MyTemplateIiE: Drop); - assert!(::core::mem::offset_of!(crate::__CcTemplateInst10MyTemplateIiE, field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::__CcTemplateInst10MyTemplateIiE, field) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/templates_rs_api.rs b/rs_bindings_from_cc/test/golden/templates_rs_api.rs index dce89d754..187f2f2f7 100644 --- a/rs_bindings_from_cc/test/golden/templates_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/templates_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=DifferentScope pub struct DifferentScope { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for DifferentScope {} impl !Sync for DifferentScope {} @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for DifferentScope { impl Default for DifferentScope { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN14DifferentScopeC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -53,7 +54,7 @@ pub mod test_namespace_bindings { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings :: TemplateParam pub struct TemplateParam { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for TemplateParam {} impl !Sync for TemplateParam {} @@ -65,7 +66,7 @@ pub mod test_namespace_bindings { impl Default for TemplateParam { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings13TemplateParamC1Ev( &raw mut tmp as *mut _, @@ -157,7 +158,7 @@ pub mod private_classes { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=private_classes :: HasPrivateType pub struct HasPrivateType { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for HasPrivateType {} impl !Sync for HasPrivateType {} @@ -216,27 +217,27 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN14DifferentScopeC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN23test_namespace_bindings13TemplateParamC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::DifferentScope: Copy,Clone); static_assertions::assert_not_impl_any!(crate::DifferentScope: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::test_namespace_bindings::TemplateParam: Copy,Clone); static_assertions::assert_not_impl_any!(crate::test_namespace_bindings::TemplateParam: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::private_classes::HasPrivateType: Copy,Clone); static_assertions::assert_not_impl_any!(crate::private_classes::HasPrivateType: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs index c053b353d..4f28f57ad 100644 --- a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: class `MyTemplate` could not be bound // Class templates are not yet supported @@ -20,7 +21,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TopLevel pub struct TopLevel { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for TopLevel {} impl !Sync for TopLevel {} @@ -32,7 +33,7 @@ unsafe impl ::cxx::ExternType for TopLevel { impl Default for TopLevel { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN8TopLevelC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -69,7 +70,7 @@ pub mod test_namespace_bindings { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings :: Inner pub struct Inner { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} @@ -81,7 +82,7 @@ pub mod test_namespace_bindings { impl Default for Inner { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings5InnerC1Ev( &raw mut tmp as *mut _, @@ -146,21 +147,23 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN8TopLevelC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN8TopLevelC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN23test_namespace_bindings5InnerC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::TopLevel: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TopLevel: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::test_namespace_bindings::Inner: Copy,Clone); static_assertions::assert_not_impl_any!(crate::test_namespace_bindings::Inner: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs b/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs index 6e89e679e..afcb78b3d 100644 --- a/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod ns { /// Implicitly defined special member functions are trivial on a struct with /// only trivial members. @@ -52,7 +53,7 @@ pub mod ns { impl Default for Trivial { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN2ns7TrivialC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -83,9 +84,9 @@ pub mod ns { #[inline(always)] pub fn TakesByValue(mut trivial: crate::ns::Trivial) -> crate::ns::Trivial { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN2ns12TakesByValueENS_7TrivialE( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, &mut trivial, ); __return.assume_init() @@ -115,7 +116,9 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN2ns7TrivialC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN2ns7TrivialC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); #[link_name = "_ZN2ns7Trivial11UnqualifiedEv"] pub(crate) unsafe fn __rust_thunk___ZN2ns7Trivial11UnqualifiedEv<'a>( __this: &'a mut crate::ns::Trivial, @@ -133,16 +136,16 @@ mod detail { __this: &'a crate::ns::Trivial, ); pub(crate) unsafe fn __rust_thunk___ZN2ns12TakesByValueENS_7TrivialE( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, trivial: &mut crate::ns::Trivial, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::ns::Trivial: Copy,Clone); static_assertions::assert_not_impl_any!(crate::ns::Trivial: Drop); - assert!(::core::mem::offset_of!(crate::ns::Trivial, trivial_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::ns::Trivial, trivial_field) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/type_annotations_rs_api.rs b/rs_bindings_from_cc/test/golden/type_annotations_rs_api.rs index cabffd4b8..577a7b19e 100644 --- a/rs_bindings_from_cc/test/golden/type_annotations_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/type_annotations_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/golden/type_annotations.h;l=8[348,352] #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] @@ -51,4 +52,4 @@ impl From for ::ffi_11::c_int { } } -// This file contains Kythe metadata. eyJ0eXBlIjoia3l0aGUwIiwibWV0YSI6W3sidHlwZSI6ImFuY2hvcl9hbmNob3IiLCJzb3VyY2VfYmVnaW4iOjM0OCwic291cmNlX2VuZCI6MzUyLCJ0YXJnZXRfYmVnaW4iOjU3MCwidGFyZ2V0X2VuZCI6NTc0LCJlZGdlIjoiL2t5dGhlL2VkZ2UvaW1wdXRlcyIsInNvdXJjZV92bmFtZSI6eyJjb3JwdXMiOiJjb3JwdXMiLCJwYXRoIjoidGhpcmRfcGFydHkvY3J1Yml0L3JzX2JpbmRpbmdzX2Zyb21fY2MvdGVzdC9nb2xkZW4vdHlwZV9hbm5vdGF0aW9ucy5oIiwibGFuZ3VhZ2UiOiJjKysifX0seyJ0eXBlIjoiYW5jaG9yX2FuY2hvciIsInNvdXJjZV9iZWdpbiI6Mzc2LCJzb3VyY2VfZW5kIjozODUsInRhcmdldF9iZWdpbiI6MTE0MywidGFyZ2V0X2VuZCI6MTE1MiwiZWRnZSI6Ii9reXRoZS9lZGdlL2ltcHV0ZXMiLCJzb3VyY2Vfdm5hbWUiOnsiY29ycHVzIjoiY29ycHVzIiwicGF0aCI6InRoaXJkX3BhcnR5L2NydWJpdC9yc19iaW5kaW5nc19mcm9tX2NjL3Rlc3QvZ29sZGVuL3R5cGVfYW5ub3RhdGlvbnMuaCIsImxhbmd1YWdlIjoiYysrIn19XX0= +// This file contains Kythe metadata. eyJ0eXBlIjoia3l0aGUwIiwibWV0YSI6W3sidHlwZSI6ImFuY2hvcl9hbmNob3IiLCJzb3VyY2VfYmVnaW4iOjM0OCwic291cmNlX2VuZCI6MzUyLCJ0YXJnZXRfYmVnaW4iOjYwNCwidGFyZ2V0X2VuZCI6NjA4LCJlZGdlIjoiL2t5dGhlL2VkZ2UvaW1wdXRlcyIsInNvdXJjZV92bmFtZSI6eyJjb3JwdXMiOiJjb3JwdXMiLCJwYXRoIjoidGhpcmRfcGFydHkvY3J1Yml0L3JzX2JpbmRpbmdzX2Zyb21fY2MvdGVzdC9nb2xkZW4vdHlwZV9hbm5vdGF0aW9ucy5oIiwibGFuZ3VhZ2UiOiJjKysifX0seyJ0eXBlIjoiYW5jaG9yX2FuY2hvciIsInNvdXJjZV9iZWdpbiI6Mzc2LCJzb3VyY2VfZW5kIjozODUsInRhcmdldF9iZWdpbiI6MTE3NywidGFyZ2V0X2VuZCI6MTE4NiwiZWRnZSI6Ii9reXRoZS9lZGdlL2ltcHV0ZXMiLCJzb3VyY2Vfdm5hbWUiOnsiY29ycHVzIjoiY29ycHVzIiwicGF0aCI6InRoaXJkX3BhcnR5L2NydWJpdC9yc19iaW5kaW5nc19mcm9tX2NjL3Rlc3QvZ29sZGVuL3R5cGVfYW5ub3RhdGlvbnMuaCIsImxhbmd1YWdlIjoiYysrIn19XX0= diff --git a/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs b/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs index 2cc7f4788..fd5d86049 100644 --- a/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs @@ -13,11 +13,12 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeStruct pub struct SomeStruct { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeStruct {} impl !Sync for SomeStruct {} @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for SomeStruct { impl Default for SomeStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN10SomeStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -51,7 +52,7 @@ pub mod some_struct { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeOtherStruct pub struct SomeOtherStruct { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeOtherStruct {} impl !Sync for SomeOtherStruct {} @@ -63,7 +64,7 @@ unsafe impl ::cxx::ExternType for SomeOtherStruct { impl Default for SomeOtherStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN15SomeOtherStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -79,7 +80,7 @@ impl Default for SomeOtherStruct { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeUnion pub union SomeUnion { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeUnion {} impl !Sync for SomeUnion {} @@ -91,7 +92,7 @@ unsafe impl ::cxx::ExternType for SomeUnion { impl Default for SomeUnion { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9SomeUnionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -110,7 +111,7 @@ impl Default for SomeUnion { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeOtherUnion pub union SomeOtherUnion { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeOtherUnion {} impl !Sync for SomeOtherUnion {} @@ -122,7 +123,7 @@ unsafe impl ::cxx::ExternType for SomeOtherUnion { impl Default for SomeOtherUnion { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN14SomeOtherUnionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -139,13 +140,17 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN10SomeStructC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10SomeStructC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN15SomeOtherStructC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN9SomeUnionC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN9SomeUnionC1Ev(__this: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN14SomeOtherUnionC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_Z23FunctionUsingNestedTypev"] pub(crate) unsafe fn __rust_thunk___Z23FunctionUsingNestedTypev( @@ -154,23 +159,23 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeStruct: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeOtherStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeOtherStruct: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeUnion: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeUnion: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeOtherUnion: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeOtherUnion: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/types_rs_api.rs b/rs_bindings_from_cc/test/golden/types_rs_api.rs index 019617b7f..c6f7c524d 100644 --- a/rs_bindings_from_cc/test/golden/types_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/types_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: type alias `PtrDiff` could not be bound // depends on type with missing bindings: Unsupported type 'decltype(static_cast(nullptr) - static_cast(nullptr))': Unsupported type '__ptrdiff_t': Unsupported clang::Type class 'PredefinedSugar' @@ -23,7 +24,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=SomeStruct pub struct SomeStruct { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for SomeStruct {} impl !Sync for SomeStruct {} @@ -35,7 +36,7 @@ unsafe impl ::cxx::ExternType for SomeStruct { impl Default for SomeStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN10SomeStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -89,7 +90,7 @@ pub struct FieldTypeTestStruct { pub char32_t_field: u32, /// Reason for representing this field as a blob of bytes: /// Unsupported type 'wchar_t': Unsupported builtin type - pub(crate) wchar_t_field: [::core::mem::MaybeUninit; 4], + pub(crate) wchar_t_field: [::__rust_core::mem::MaybeUninit; 4], pub short_field: ::ffi_11::c_short, pub int_field: ::ffi_11::c_int, pub long_field: ::ffi_11::c_long, @@ -104,10 +105,10 @@ pub struct FieldTypeTestStruct { pub signed_long_long_field: ::ffi_11::c_longlong, /// Reason for representing this field as a blob of bytes: /// Unsupported type alias PtrDiff - pub(crate) ptrdiff_t_field: [::core::mem::MaybeUninit; 8], + pub(crate) ptrdiff_t_field: [::__rust_core::mem::MaybeUninit; 8], /// Reason for representing this field as a blob of bytes: /// Unsupported type alias Size - pub(crate) size_t_field: [::core::mem::MaybeUninit; 8], + pub(crate) size_t_field: [::__rust_core::mem::MaybeUninit; 8], pub float_field: f32, pub double_field: f64, pub ptr_field: *mut ::ffi_11::c_int, @@ -125,7 +126,7 @@ pub struct FieldTypeTestStruct { /// /// Reason for representing this field as a blob of bytes: /// incomplete type - pub(crate) forward_declared_ptr_field: [::core::mem::MaybeUninit; 8], + pub(crate) forward_declared_ptr_field: [::__rust_core::mem::MaybeUninit; 8], pub cyclic_ptr_field: *mut crate::FieldTypeTestStruct, } impl !Send for FieldTypeTestStruct {} @@ -178,7 +179,9 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN10SomeStructC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10SomeStructC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___Z21VoidReturningFunctionv(); pub(crate) unsafe fn __rust_thunk___Z32FunctionPointerReturningFunctionv() -> Option< unsafe extern "C" fn( @@ -194,47 +197,62 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::SomeStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeStruct: Drop); - assert!(::core::mem::size_of::() == 208); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 208); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::FieldTypeTestStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::FieldTypeTestStruct: Drop); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, bool_field) == 0); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, char_field) == 1); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_char_field) == 2); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, signed_char_field) == 3); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, char16_t_field) == 4); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, char32_t_field) == 8); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, wchar_t_field) == 12); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, short_field) == 16); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, int_field) == 20); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, long_field) == 24); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, long_long_field) == 32); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_short_field) == 40); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_int_field) == 44); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_long_field) == 48); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_long_long_field) == 56); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, signed_short_field) == 64); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, signed_int_field) == 68); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, signed_long_field) == 72); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, signed_long_long_field) == 80); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, ptrdiff_t_field) == 88); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, size_t_field) == 96); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, float_field) == 104); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, double_field) == 112); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, ptr_field) == 120); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, void_ptr_field) == 128); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, const_void_ptr_field) == 136); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, void_double_ptr_field) == 144); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, struct_field) == 152); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, struct_ptr_field) == 160); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, const_struct_ptr_field) == 168); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, struct_ref_field) == 176); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, const_struct_ref_field) == 184); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, forward_declared_ptr_field) == 192); - assert!(::core::mem::offset_of!(crate::FieldTypeTestStruct, cyclic_ptr_field) == 200); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, bool_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, char_field) == 1); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_char_field) == 2); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, signed_char_field) == 3); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, char16_t_field) == 4); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, char32_t_field) == 8); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, wchar_t_field) == 12); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, short_field) == 16); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, int_field) == 20); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, long_field) == 24); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, long_long_field) == 32); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_short_field) == 40); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_int_field) == 44); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_long_field) == 48); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, unsigned_long_long_field) == 56 + ); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, signed_short_field) == 64); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, signed_int_field) == 68); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, signed_long_field) == 72); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, signed_long_long_field) == 80 + ); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, ptrdiff_t_field) == 88); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, size_t_field) == 96); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, float_field) == 104); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, double_field) == 112); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, ptr_field) == 120); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, void_ptr_field) == 128); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, const_void_ptr_field) == 136 + ); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, void_double_ptr_field) == 144 + ); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, struct_field) == 152); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, struct_ptr_field) == 160); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, const_struct_ptr_field) == 168 + ); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, struct_ref_field) == 176); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, const_struct_ref_field) == 184 + ); + assert!( + ::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, forward_declared_ptr_field) + == 192 + ); + assert!(::__rust_core::mem::offset_of!(crate::FieldTypeTestStruct, cyclic_ptr_field) == 200); }; diff --git a/rs_bindings_from_cc/test/golden/unions_rs_api.rs b/rs_bindings_from_cc/test/golden/unions_rs_api.rs index fbf35f02a..5601dcbee 100644 --- a/rs_bindings_from_cc/test/golden/unions_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unions_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// # Safety /// /// To call a function that accepts this type, you must uphold these requirements: @@ -21,7 +22,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=EmptyUnion pub union EmptyUnion { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for EmptyUnion {} impl !Sync for EmptyUnion {} @@ -33,7 +34,7 @@ unsafe impl ::cxx::ExternType for EmptyUnion { impl Default for EmptyUnion { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN10EmptyUnionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -59,7 +60,7 @@ impl Default for EmptyUnion { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Nontrivial pub struct Nontrivial { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, } impl !Send for Nontrivial {} @@ -77,7 +78,9 @@ impl ::ctor::CtorNew<()> for Nontrivial { let () = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN10NontrivialC1Ev(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___ZN10NontrivialC1Ev( + dest as *mut ::__rust_core::ffi::c_void, + ); }) } } @@ -94,7 +97,7 @@ impl ::ctor::CtorNew<()> for Nontrivial { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=UnionToRename pub union RenamedUnion { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for RenamedUnion {} impl !Sync for RenamedUnion {} @@ -106,7 +109,7 @@ unsafe impl ::cxx::ExternType for RenamedUnion { impl Default for RenamedUnion { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13UnionToRenameC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -132,7 +135,7 @@ impl Default for RenamedUnion { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TriviallyCopyableButNontriviallyDestructible pub struct TriviallyCopyableButNontriviallyDestructible { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 1], } impl !Send for TriviallyCopyableButNontriviallyDestructible {} impl !Sync for TriviallyCopyableButNontriviallyDestructible {} @@ -150,7 +153,7 @@ unsafe impl ::cxx::ExternType for TriviallyCopyableButNontriviallyDestructible { impl ::ctor::PinnedDrop for TriviallyCopyableButNontriviallyDestructible { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleD1Ev(self) } } @@ -178,7 +181,7 @@ unsafe impl ::cxx::ExternType for NonEmptyUnion { impl Default for NonEmptyUnion { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13NonEmptyUnionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -209,7 +212,7 @@ impl Default for NonEmptyUnion { ///CRUBIT_ANNOTATE: cpp_type=NonCopyUnion pub union NonCopyUnion { pub trivial_member: bool, - pub nontrivial_member: ::core::mem::ManuallyDrop, + pub nontrivial_member: ::__rust_core::mem::ManuallyDrop, } impl !Send for NonCopyUnion {} impl !Sync for NonCopyUnion {} @@ -227,7 +230,7 @@ unsafe impl ::cxx::ExternType for NonCopyUnion { pub union NonCopyUnion2 { pub trivial_member: bool, pub nontrivial_member: - ::core::mem::ManuallyDrop, + ::__rust_core::mem::ManuallyDrop, } impl !Send for NonCopyUnion2 {} impl !Sync for NonCopyUnion2 {} @@ -262,7 +265,7 @@ unsafe impl ::cxx::ExternType for NonCopyUnion2 { pub union UnionWithOpaqueField { /// Reason for representing this field as a blob of bytes: /// Unsupported type 'char[42]': Unsupported clang::Type class 'ConstantArray' - pub(crate) constant_array_field_not_yet_supported: [::core::mem::MaybeUninit; 42], + pub(crate) constant_array_field_not_yet_supported: [::__rust_core::mem::MaybeUninit; 42], } impl !Send for UnionWithOpaqueField {} impl !Sync for UnionWithOpaqueField {} @@ -274,7 +277,7 @@ unsafe impl ::cxx::ExternType for UnionWithOpaqueField { impl Default for UnionWithOpaqueField { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN20UnionWithOpaqueFieldC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -312,7 +315,7 @@ unsafe impl ::cxx::ExternType for TrivialButInheritable { impl Default for TrivialButInheritable { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN21TrivialButInheritableC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -354,7 +357,7 @@ unsafe impl ::cxx::ExternType for UnionWithInheritable { impl Default for UnionWithInheritable { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN20UnionWithInheritableC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -396,7 +399,7 @@ unsafe impl ::cxx::ExternType for TypedefUnion { impl Default for TypedefUnion { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN12TypedefUnionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -438,7 +441,7 @@ unsafe impl ::cxx::ExternType for TypedefUnionWithInheritable { impl Default for TypedefUnionWithInheritable { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN27TypedefUnionWithInheritableC1Ev( &raw mut tmp as *mut _, @@ -466,107 +469,123 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN10EmptyUnionC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10EmptyUnionC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); #[link_name = "_ZN10NontrivialC1Ev"] - pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN13UnionToRenameC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN13UnionToRenameC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleD1Ev< 'a, >( - __this: ::core::pin::Pin<&'a mut crate::TriviallyCopyableButNontriviallyDestructible>, + __this: ::__rust_core::pin::Pin< + &'a mut crate::TriviallyCopyableButNontriviallyDestructible, + >, + ); + pub(crate) unsafe fn __rust_thunk___ZN13NonEmptyUnionC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN13NonEmptyUnionC1Ev(__this: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN20UnionWithOpaqueFieldC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN21TrivialButInheritableC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN20UnionWithInheritableC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN12TypedefUnionC1Ev( + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN12TypedefUnionC1Ev(__this: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZN27TypedefUnionWithInheritableC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::EmptyUnion: Copy,Clone); static_assertions::assert_not_impl_any!(crate::EmptyUnion: Drop); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_not_impl_any!(crate::Nontrivial: Copy,Drop); - assert!(::core::mem::offset_of!(crate::Nontrivial, field) == 0); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::offset_of!(crate::Nontrivial, field) == 0); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::RenamedUnion: Copy,Clone); static_assertions::assert_not_impl_any!(crate::RenamedUnion: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!( + ::__rust_core::mem::size_of::() == 1 + ); + assert!( + ::__rust_core::mem::align_of::() == 1 + ); static_assertions::assert_impl_all!(crate::TriviallyCopyableButNontriviallyDestructible: Drop); static_assertions::assert_not_impl_any!(crate::TriviallyCopyableButNontriviallyDestructible: Copy); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::NonEmptyUnion: Copy,Clone); static_assertions::assert_not_impl_any!(crate::NonEmptyUnion: Drop); - assert!(::core::mem::offset_of!(crate::NonEmptyUnion, bool_field) == 0); - assert!(::core::mem::offset_of!(crate::NonEmptyUnion, char_field) == 0); - assert!(::core::mem::offset_of!(crate::NonEmptyUnion, int_field) == 0); - assert!(::core::mem::offset_of!(crate::NonEmptyUnion, long_long_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonEmptyUnion, bool_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonEmptyUnion, char_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonEmptyUnion, int_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonEmptyUnion, long_long_field) == 0); static_assertions::assert_impl_all!(bool: Copy); static_assertions::assert_impl_all!(::ffi_11::c_char: Copy); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); static_assertions::assert_impl_all!(::ffi_11::c_longlong: Copy); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_not_impl_any!(crate::NonCopyUnion: Copy,Drop); - assert!(::core::mem::offset_of!(crate::NonCopyUnion, trivial_member) == 0); - assert!(::core::mem::offset_of!(crate::NonCopyUnion, nontrivial_member) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonCopyUnion, trivial_member) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonCopyUnion, nontrivial_member) == 0); static_assertions::assert_impl_all!(bool: Copy); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_not_impl_any!(crate::NonCopyUnion2: Copy,Drop); - assert!(::core::mem::offset_of!(crate::NonCopyUnion2, trivial_member) == 0); - assert!(::core::mem::offset_of!(crate::NonCopyUnion2, nontrivial_member) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonCopyUnion2, trivial_member) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NonCopyUnion2, nontrivial_member) == 0); static_assertions::assert_impl_all!(bool: Copy); - assert!(::core::mem::size_of::() == 42); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 42); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::UnionWithOpaqueField: Copy,Clone); static_assertions::assert_not_impl_any!(crate::UnionWithOpaqueField: Drop); assert!( - ::core::mem::offset_of!( + ::__rust_core::mem::offset_of!( crate::UnionWithOpaqueField, constant_array_field_not_yet_supported ) == 0 ); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::TrivialButInheritable: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TrivialButInheritable: Drop); - assert!(::core::mem::offset_of!(crate::TrivialButInheritable, x) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::TrivialButInheritable, x) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::UnionWithInheritable: Copy,Clone); static_assertions::assert_not_impl_any!(crate::UnionWithInheritable: Drop); - assert!(::core::mem::offset_of!(crate::UnionWithInheritable, t) == 0); + assert!(::__rust_core::mem::offset_of!(crate::UnionWithInheritable, t) == 0); static_assertions::assert_impl_all!(crate::TrivialButInheritable: Copy); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::TypedefUnion: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TypedefUnion: Drop); - assert!(::core::mem::offset_of!(crate::TypedefUnion, trivial_member) == 0); + assert!(::__rust_core::mem::offset_of!(crate::TypedefUnion, trivial_member) == 0); static_assertions::assert_impl_all!(bool: Copy); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::TypedefUnionWithInheritable: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TypedefUnionWithInheritable: Drop); - assert!(::core::mem::offset_of!(crate::TypedefUnionWithInheritable, t) == 0); + assert!(::__rust_core::mem::offset_of!(crate::TypedefUnionWithInheritable, t) == 0); static_assertions::assert_impl_all!(crate::TrivialButInheritable: Copy); }; diff --git a/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api.rs b/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api.rs index c0d9c981f..4653825f8 100644 --- a/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[inline(always)] pub fn ReturnsTrue() -> bool { unsafe { crate::detail::__rust_thunk___ZL11ReturnsTruev() } diff --git a/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api.rs b/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api.rs index c320b2bf8..bd2041610 100644 --- a/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// # Safety /// /// To call a function that accepts this type, you must uphold these requirements: @@ -34,7 +35,7 @@ unsafe impl ::cxx::ExternType for PublicPointer { impl Default for PublicPointer { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN13PublicPointerC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -46,10 +47,10 @@ impl Default for PublicPointer { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=PrivatePointer pub struct PrivatePointer { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) p_: [::core::mem::MaybeUninit; 8], + pub(crate) p_: [::__rust_core::mem::MaybeUninit; 8], } impl !Send for PrivatePointer {} impl !Sync for PrivatePointer {} @@ -61,7 +62,7 @@ unsafe impl ::cxx::ExternType for PrivatePointer { impl Default for PrivatePointer { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN14PrivatePointerC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -96,7 +97,7 @@ unsafe impl ::cxx::ExternType for TransitivePublicPointer { impl Default for TransitivePublicPointer { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN23TransitivePublicPointerC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -125,7 +126,7 @@ unsafe impl ::cxx::ExternType for Union { impl Default for Union { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5UnionC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -175,17 +176,19 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN13PublicPointerC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN13PublicPointerC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN14PrivatePointerC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___Z19DerefPrivatePointer14PrivatePointer( p: &mut crate::PrivatePointer, ) -> ::ffi_11::c_int; pub(crate) unsafe fn __rust_thunk___ZN23TransitivePublicPointerC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___ZN5UnionC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN5UnionC1Ev(__this: *mut ::__rust_core::ffi::c_void); #[link_name = "_Z12DerefPointerPi"] pub(crate) unsafe fn __rust_thunk___Z12DerefPointerPi( p: *mut ::ffi_11::c_int, @@ -203,28 +206,28 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::PublicPointer: Copy,Clone); static_assertions::assert_not_impl_any!(crate::PublicPointer: Drop); - assert!(::core::mem::offset_of!(crate::PublicPointer, p) == 0); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::PublicPointer, p) == 0); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::PrivatePointer: Copy,Clone); static_assertions::assert_not_impl_any!(crate::PrivatePointer: Drop); - assert!(::core::mem::offset_of!(crate::PrivatePointer, p_) == 0); - assert!(::core::mem::size_of::() == 16); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::PrivatePointer, p_) == 0); + assert!(::__rust_core::mem::size_of::() == 16); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::TransitivePublicPointer: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TransitivePublicPointer: Drop); - assert!(::core::mem::offset_of!(crate::TransitivePublicPointer, r#pub) == 0); - assert!(::core::mem::offset_of!(crate::TransitivePublicPointer, r#priv) == 8); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::TransitivePublicPointer, r#pub) == 0); + assert!(::__rust_core::mem::offset_of!(crate::TransitivePublicPointer, r#priv) == 8); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Union: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Union: Drop); - assert!(::core::mem::offset_of!(crate::Union, i) == 0); - assert!(::core::mem::offset_of!(crate::Union, f) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Union, i) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Union, f) == 0); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); static_assertions::assert_impl_all!(f32: Copy); }; diff --git a/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs b/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs index 1366043ed..02b2edf95 100644 --- a/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TrivialCustomType @@ -29,7 +30,7 @@ unsafe impl ::cxx::ExternType for TrivialCustomType { impl Default for TrivialCustomType { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN17TrivialCustomTypeC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -61,7 +62,7 @@ impl Default for TrivialCustomType { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NontrivialCustomType pub struct NontrivialCustomType { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub i: ::ffi_11::c_int, } impl !Send for NontrivialCustomType {} @@ -99,19 +100,19 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN17TrivialCustomTypeC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::TrivialCustomType: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TrivialCustomType: Drop); - assert!(::core::mem::offset_of!(crate::TrivialCustomType, i) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::TrivialCustomType, i) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_not_impl_any!(crate::NontrivialCustomType: Copy,Drop); - assert!(::core::mem::offset_of!(crate::NontrivialCustomType, i) == 0); + assert!(::__rust_core::mem::offset_of!(crate::NontrivialCustomType, i) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs index 9da7c740d..d4a57afaf 100644 --- a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// The same as Derived from inheritance.h, but in a different build target. /// /// This tests inheritance across library boundaries. @@ -22,7 +23,7 @@ #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=Derived2 pub struct Derived2 { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 20], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 20], pub derived_1: ::ffi_11::c_char, } impl !Send for Derived2 {} @@ -40,7 +41,9 @@ impl ::ctor::CtorNew<()> for Derived2 { let () = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN8Derived2C1Ev(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___ZN8Derived2C1Ev( + dest as *mut ::__rust_core::ffi::c_void, + ); }) } } @@ -64,7 +67,7 @@ impl ::ctor::CtorNew<()> for Derived2 { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=VirtualDerived2 pub struct VirtualDerived2 { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 32], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 32], } impl !Send for VirtualDerived2 {} impl !Sync for VirtualDerived2 {} @@ -82,7 +85,7 @@ impl ::ctor::CtorNew<()> for VirtualDerived2 { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN15VirtualDerived2C1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -107,19 +110,21 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN8Derived2C1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN8Derived2C1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN15VirtualDerived2C1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 24); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 24); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_not_impl_any!(crate::Derived2: Copy,Drop); - assert!(::core::mem::offset_of!(crate::Derived2, derived_1) == 20); - assert!(::core::mem::size_of::() == 32); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::offset_of!(crate::Derived2, derived_1) == 20); + assert!(::__rust_core::mem::size_of::() == 32); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_not_impl_any!(crate::VirtualDerived2: Copy,Drop); }; diff --git a/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api.rs b/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api.rs index 92d1d24bd..662205d7d 100644 --- a/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api.rs @@ -13,12 +13,14 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[inline(always)] pub fn UsesImportedType(mut t: ::trivial_type_cc::ns::Trivial) -> ::trivial_type_cc::ns::Trivial { unsafe { - let mut __return = ::core::mem::MaybeUninit::<::trivial_type_cc::ns::Trivial>::uninit(); + let mut __return = + ::__rust_core::mem::MaybeUninit::<::trivial_type_cc::ns::Trivial>::uninit(); crate::detail::__rust_thunk___Z16UsesImportedTypeN2ns7TrivialE( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, &mut t, ); __return.assume_init() @@ -46,7 +48,7 @@ unsafe impl ::cxx::ExternType for UserOfImportedType { impl Default for UserOfImportedType { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN18UserOfImportedTypeC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -59,19 +61,19 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___Z16UsesImportedTypeN2ns7TrivialE( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, t: &mut ::trivial_type_cc::ns::Trivial, ); pub(crate) unsafe fn __rust_thunk___ZN18UserOfImportedTypeC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 8); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::UserOfImportedType: Copy,Clone); static_assertions::assert_not_impl_any!(crate::UserOfImportedType: Drop); - assert!(::core::mem::offset_of!(crate::UserOfImportedType, trivial) == 0); + assert!(::__rust_core::mem::offset_of!(crate::UserOfImportedType, trivial) == 0); }; diff --git a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs index 0c0f6d031..98efe2836 100644 --- a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs @@ -13,13 +13,16 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; #[inline(always)] pub fn UseNontrivialCustomType( non_trivial_custom_type: ::ctor::Ctor![::unsupported_cc::NontrivialCustomType], ) { unsafe { crate::detail::__rust_thunk___Z23UseNontrivialCustomType20NontrivialCustomType( - ::core::pin::Pin::into_inner_unchecked(::ctor::emplace!(non_trivial_custom_type)), + ::__rust_core::pin::Pin::into_inner_unchecked(::ctor::emplace!( + non_trivial_custom_type + )), ) } } diff --git a/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs b/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs index 90951167b..997cf12e3 100644 --- a/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // error: function `UseNotCrubitExposed` could not be bound // Unsupported parameter #0 (not_crubit_exposed) @@ -20,7 +21,7 @@ #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=CannotUpcastInCrubit pub struct CannotUpcastInCrubit { - __non_field_data: [::core::mem::MaybeUninit; 4], + __non_field_data: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for CannotUpcastInCrubit {} impl !Sync for CannotUpcastInCrubit {} @@ -32,7 +33,7 @@ unsafe impl ::cxx::ExternType for CannotUpcastInCrubit { impl Default for CannotUpcastInCrubit { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN20CannotUpcastInCrubitC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -57,14 +58,14 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN20CannotUpcastInCrubitC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::CannotUpcastInCrubit: Copy,Clone); static_assertions::assert_not_impl_any!(crate::CannotUpcastInCrubit: Drop); }; diff --git a/rs_bindings_from_cc/test/golden/using_function_rs_api.rs b/rs_bindings_from_cc/test/golden/using_function_rs_api.rs index 213c9bba0..5a23e7eab 100644 --- a/rs_bindings_from_cc/test/golden/using_function_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/using_function_rs_api.rs @@ -13,6 +13,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod A { #[inline(always)] pub fn Foo() { diff --git a/rs_bindings_from_cc/test/namespace/inline/inline_rs_api.rs b/rs_bindings_from_cc/test/namespace/inline/inline_rs_api.rs index 5eef604e4..718ba058d 100644 --- a/rs_bindings_from_cc/test/namespace/inline/inline_rs_api.rs +++ b/rs_bindings_from_cc/test/namespace/inline/inline_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod foo { // namespace inline1 @@ -39,7 +40,7 @@ pub mod foo { impl Default for MyStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN3foo7inline18MyStructC1Ev( &raw mut tmp as *mut _, @@ -106,7 +107,7 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN3foo7inline18MyStructC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN3foo7inline115GetStructValue1EPKNS0_8MyStructE( s: *const crate::foo::inline1::MyStruct, @@ -124,9 +125,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::foo::inline1::MyStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::foo::inline1::MyStruct: Drop); - assert!(::core::mem::offset_of!(crate::foo::inline1::MyStruct, value) == 0); + assert!(::__rust_core::mem::offset_of!(crate::foo::inline1::MyStruct, value) == 0); }; diff --git a/rs_bindings_from_cc/test/references/references_rs_api.rs b/rs_bindings_from_cc/test/references/references_rs_api.rs index 14dfb034c..f7cc4f1dc 100644 --- a/rs_bindings_from_cc/test/references/references_rs_api.rs +++ b/rs_bindings_from_cc/test/references/references_rs_api.rs @@ -14,12 +14,13 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/references/references.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TypeWithPtrConstructor pub struct TypeWithPtrConstructor { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for TypeWithPtrConstructor {} impl !Sync for TypeWithPtrConstructor {} @@ -52,7 +53,7 @@ where #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TypeWithNonNullPtrConstructor pub struct TypeWithNonNullPtrConstructor { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for TypeWithNonNullPtrConstructor {} impl !Sync for TypeWithNonNullPtrConstructor {} @@ -85,7 +86,7 @@ where #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=TypeWithReferenceConstructor pub struct TypeWithReferenceConstructor { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for TypeWithReferenceConstructor {} impl !Sync for TypeWithReferenceConstructor {} @@ -99,7 +100,7 @@ impl From<&mut ::ffi_11::c_int> for TypeWithReferenceConstructor { #[inline(always)] fn from(args: &mut ::ffi_11::c_int) -> Self { let mut r#ref = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN28TypeWithReferenceConstructorC1ERi( &raw mut tmp as *mut _, @@ -123,25 +124,25 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN28TypeWithReferenceConstructorC1ERi( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, r#ref: &mut ::ffi_11::c_int, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::TypeWithPtrConstructor: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TypeWithPtrConstructor: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::TypeWithNonNullPtrConstructor: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TypeWithNonNullPtrConstructor: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::TypeWithReferenceConstructor: Copy,Clone); static_assertions::assert_not_impl_any!(crate::TypeWithReferenceConstructor: Drop); }; diff --git a/rs_bindings_from_cc/test/struct/constructors/constructors_rs_api.rs b/rs_bindings_from_cc/test/struct/constructors/constructors_rs_api.rs index a0c2efd31..1e7cbb9a0 100644 --- a/rs_bindings_from_cc/test/struct/constructors/constructors_rs_api.rs +++ b/rs_bindings_from_cc/test/struct/constructors/constructors_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// `[[clang::trivial_abi]]` is used so that `is_trivial_abi` doesn't prevent /// generating bindings for constructors, even though the presence of a /// user-defined copy constructor technically means that the struct below @@ -23,7 +24,7 @@ #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithUserProvidedConstructors pub struct StructWithUserProvidedConstructors { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub int_field: ::ffi_11::c_int, } impl !Send for StructWithUserProvidedConstructors {} @@ -55,7 +56,7 @@ impl<'__param_0> ::ctor::UnpinAssign<&'__param_0 Self> for StructWithUserProvide impl Default for StructWithUserProvidedConstructors { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN34StructWithUserProvidedConstructorsC1Ev( &raw mut tmp as *mut _, @@ -71,7 +72,7 @@ impl Default for StructWithUserProvidedConstructors { impl Clone for StructWithUserProvidedConstructors { #[inline(always)] fn clone<'__param_0>(&'__param_0 self) -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN34StructWithUserProvidedConstructorsC1ERKS_( &raw mut tmp as *mut _, @@ -91,7 +92,7 @@ impl Clone for StructWithUserProvidedConstructors { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithExplicitConversionConstructor pub struct StructWithExplicitConversionConstructor { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub int_field: ::ffi_11::c_int, } impl !Send for StructWithExplicitConversionConstructor {} @@ -112,7 +113,7 @@ impl From<::ffi_11::c_int> for StructWithExplicitConversionConstructor { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut i = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN39StructWithExplicitConversionConstructorC1Ei( &raw mut tmp as *mut _, @@ -136,7 +137,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for StructWithExplicitConversionConstructo #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithMultipleConstructors pub struct StructWithMultipleConstructors { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub int_field: ::ffi_11::c_int, } impl !Send for StructWithMultipleConstructors {} @@ -155,7 +156,7 @@ impl From<::ffi_11::c_int> for StructWithMultipleConstructors { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut i = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN30StructWithMultipleConstructorsC1Ei( &raw mut tmp as *mut _, @@ -179,7 +180,7 @@ impl From<(::ffi_11::c_int, ::ffi_11::c_int)> for StructWithMultipleConstructors #[inline(always)] fn from(args: (::ffi_11::c_int, ::ffi_11::c_int)) -> Self { let (mut i, mut j) = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN30StructWithMultipleConstructorsC1Eii( &raw mut tmp as *mut _, @@ -204,7 +205,7 @@ impl From<(::ffi_11::c_int, ::ffi_11::c_int, ::ffi_11::c_int)> for StructWithMul #[inline(always)] fn from(args: (::ffi_11::c_int, ::ffi_11::c_int, ::ffi_11::c_int)) -> Self { let (mut i, mut j, mut k) = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN30StructWithMultipleConstructorsC1Eiii( &raw mut tmp as *mut _, @@ -232,7 +233,7 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int, ::ffi_11::c_int)> #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithImplicitConversionConstructor pub struct StructWithImplicitConversionConstructor { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub int_field: ::ffi_11::c_int, } impl !Send for StructWithImplicitConversionConstructor {} @@ -253,7 +254,7 @@ impl From<::ffi_11::c_int> for StructWithImplicitConversionConstructor { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut i = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN39StructWithImplicitConversionConstructorC1Ei( &raw mut tmp as *mut _, @@ -294,7 +295,7 @@ forward_declare::unsafe_define!( impl Default for OtherSimpleStruct { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN17OtherSimpleStructC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -307,7 +308,7 @@ impl Default for OtherSimpleStruct { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithImplicitConversionFromReference pub struct StructWithImplicitConversionFromReference { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub int_field: ::ffi_11::c_int, } impl !Send for StructWithImplicitConversionFromReference {} @@ -328,7 +329,7 @@ impl<'other> From<&'other crate::OtherSimpleStruct> for StructWithImplicitConver #[inline(always)] fn from(args: &'other crate::OtherSimpleStruct) -> Self { let mut other = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN41StructWithImplicitConversionFromReferenceC1ERK17OtherSimpleStruct(&raw mut tmp as*mut _,other); tmp.assume_init() @@ -353,7 +354,7 @@ impl<'other> ::ctor::CtorNew<&'other crate::OtherSimpleStruct> #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithInlineConstructors pub struct StructWithInlineConstructors { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub int_field: ::ffi_11::c_int, } impl !Send for StructWithInlineConstructors {} @@ -381,7 +382,7 @@ impl<'__param_0> ::ctor::UnpinAssign<&'__param_0 Self> for StructWithInlineConst impl Default for StructWithInlineConstructors { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN28StructWithInlineConstructorsC1Ev( &raw mut tmp as *mut _, @@ -395,7 +396,7 @@ impl Default for StructWithInlineConstructors { impl Clone for StructWithInlineConstructors { #[inline(always)] fn clone<'other>(&'other self) -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN28StructWithInlineConstructorsC1ERKS_( &raw mut tmp as *mut _, @@ -415,7 +416,7 @@ impl From<::ffi_11::c_int> for StructWithInlineConstructors { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut i = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN28StructWithInlineConstructorsC1Ei( &raw mut tmp as *mut _, @@ -439,7 +440,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for StructWithInlineConstructors { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithDeletedConstructors pub struct StructWithDeletedConstructors { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub int_field: ::ffi_11::c_int, } impl !Send for StructWithDeletedConstructors {} @@ -456,7 +457,10 @@ forward_declare::unsafe_define!( /// Generated from: rs_bindings_from_cc/test/struct/constructors/constructors.h;l=70 impl<'__param_0> ::ctor::Assign<&'__param_0 Self> for StructWithDeletedConstructors { #[inline(always)] - fn assign<'__this>(self: ::core::pin::Pin<&'__this mut Self>, __param_0: &'__param_0 Self) { + fn assign<'__this>( + self: ::__rust_core::pin::Pin<&'__this mut Self>, + __param_0: &'__param_0 Self, + ) { unsafe { crate::detail::__rust_thunk___ZN29StructWithDeletedConstructorsaSERKS_(self, __param_0); } @@ -468,10 +472,10 @@ impl<'__param_0> ::ctor::Assign<&'__param_0 Self> for StructWithDeletedConstruct #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=StructWithPrivateConstructors pub struct StructWithPrivateConstructors { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) int_field: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) int_field: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } impl !Send for StructWithPrivateConstructors {} impl !Sync for StructWithPrivateConstructors {} @@ -487,7 +491,10 @@ forward_declare::unsafe_define!( /// Generated from: rs_bindings_from_cc/test/struct/constructors/constructors.h;l=78 impl<'__param_0> ::ctor::Assign<&'__param_0 Self> for StructWithPrivateConstructors { #[inline(always)] - fn assign<'__this>(self: ::core::pin::Pin<&'__this mut Self>, __param_0: &'__param_0 Self) { + fn assign<'__this>( + self: ::__rust_core::pin::Pin<&'__this mut Self>, + __param_0: &'__param_0 Self, + ) { unsafe { crate::detail::__rust_thunk___ZN29StructWithPrivateConstructorsaSERKS_(self, __param_0); } @@ -499,7 +506,7 @@ impl<'__param_0> ::ctor::Assign<&'__param_0 Self> for StructWithPrivateConstruct #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=StructWithExplicitlyDefaultedConstructors pub struct StructWithExplicitlyDefaultedConstructors { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], pub field_with_explicit_initializer: ::ffi_11::c_int, pub field_with_no_initializer: ::ffi_11::c_int, } @@ -518,7 +525,7 @@ forward_declare::unsafe_define!( impl Default for StructWithExplicitlyDefaultedConstructors { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN41StructWithExplicitlyDefaultedConstructorsC1Ev( &raw mut tmp as *mut _, @@ -536,7 +543,7 @@ impl Default for StructWithExplicitlyDefaultedConstructors { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=NonTrivialStructWithConstructors pub struct NonTrivialStructWithConstructors { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub int_field: ::ffi_11::c_int, } impl !Send for NonTrivialStructWithConstructors {} @@ -560,7 +567,7 @@ impl<'__param_0> ::ctor::CtorNew<&'__param_0 Self> for NonTrivialStructWithConst unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN32NonTrivialStructWithConstructorsC1ERKS_( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, __param_0, ); }) @@ -580,7 +587,10 @@ impl<'__param_0> ::ctor::CtorNew<(&'__param_0 Self,)> for NonTrivialStructWithCo /// Generated from: rs_bindings_from_cc/test/struct/constructors/constructors.h;l=99 impl<'__param_0> ::ctor::Assign<&'__param_0 Self> for NonTrivialStructWithConstructors { #[inline(always)] - fn assign<'__this>(self: ::core::pin::Pin<&'__this mut Self>, __param_0: &'__param_0 Self) { + fn assign<'__this>( + self: ::__rust_core::pin::Pin<&'__this mut Self>, + __param_0: &'__param_0 Self, + ) { unsafe { crate::detail::__rust_thunk___ZN32NonTrivialStructWithConstructorsaSERKS_( self, __param_0, @@ -599,7 +609,7 @@ impl ::ctor::CtorNew<()> for NonTrivialStructWithConstructors { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN32NonTrivialStructWithConstructorsC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -616,7 +626,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for NonTrivialStructWithConstructors { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN32NonTrivialStructWithConstructorsC1Ei( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, __param_0, ); }) @@ -638,7 +648,7 @@ impl ::ctor::CtorNew<(::ffi_11::c_int,)> for NonTrivialStructWithConstructors { /// Generated from: rs_bindings_from_cc/test/struct/constructors/constructors.h;l=104 impl ::ctor::PinnedDrop for NonTrivialStructWithConstructors { #[inline(always)] - unsafe fn pinned_drop<'__this>(self: ::core::pin::Pin<&'__this mut Self>) { + unsafe fn pinned_drop<'__this>(self: ::__rust_core::pin::Pin<&'__this mut Self>) { crate::detail::__rust_thunk___ZN32NonTrivialStructWithConstructorsD1Ev(self) } } @@ -656,45 +666,45 @@ mod detail { ) -> &'__this mut crate::StructWithUserProvidedConstructors; #[link_name = "_ZN34StructWithUserProvidedConstructorsC1Ev"] pub(crate) unsafe fn __rust_thunk___ZN34StructWithUserProvidedConstructorsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN34StructWithUserProvidedConstructorsC1ERKS_"] pub(crate) unsafe fn __rust_thunk___ZN34StructWithUserProvidedConstructorsC1ERKS_< '__param_0, >( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: &'__param_0 crate::StructWithUserProvidedConstructors, ); pub(crate) unsafe fn __rust_thunk___ZN39StructWithExplicitConversionConstructorC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, i: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN30StructWithMultipleConstructorsC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, i: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN30StructWithMultipleConstructorsC1Eii( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, i: ::ffi_11::c_int, j: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN30StructWithMultipleConstructorsC1Eiii( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, i: ::ffi_11::c_int, j: ::ffi_11::c_int, k: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN39StructWithImplicitConversionConstructorC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, i: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN17OtherSimpleStructC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN41StructWithImplicitConversionFromReferenceC1ERK17OtherSimpleStruct< 'other, >( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, other: &'other crate::OtherSimpleStruct, ); pub(crate) unsafe fn __rust_thunk___ZN28StructWithInlineConstructorsaSERKS_< @@ -705,130 +715,141 @@ mod detail { __param_0: &'__param_0 crate::StructWithInlineConstructors, ) -> &'__this mut crate::StructWithInlineConstructors; pub(crate) unsafe fn __rust_thunk___ZN28StructWithInlineConstructorsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN28StructWithInlineConstructorsC1ERKS_<'other>( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, other: &'other crate::StructWithInlineConstructors, ); pub(crate) unsafe fn __rust_thunk___ZN28StructWithInlineConstructorsC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, i: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN29StructWithDeletedConstructorsaSERKS_< '__this, '__param_0, >( - __this: ::core::pin::Pin<&'__this mut crate::StructWithDeletedConstructors>, + __this: ::__rust_core::pin::Pin<&'__this mut crate::StructWithDeletedConstructors>, __param_0: &'__param_0 crate::StructWithDeletedConstructors, - ) -> ::core::pin::Pin<&'__this mut crate::StructWithDeletedConstructors>; + ) -> ::__rust_core::pin::Pin<&'__this mut crate::StructWithDeletedConstructors>; pub(crate) unsafe fn __rust_thunk___ZN29StructWithPrivateConstructorsaSERKS_< '__this, '__param_0, >( - __this: ::core::pin::Pin<&'__this mut crate::StructWithPrivateConstructors>, + __this: ::__rust_core::pin::Pin<&'__this mut crate::StructWithPrivateConstructors>, __param_0: &'__param_0 crate::StructWithPrivateConstructors, - ) -> ::core::pin::Pin<&'__this mut crate::StructWithPrivateConstructors>; + ) -> ::__rust_core::pin::Pin<&'__this mut crate::StructWithPrivateConstructors>; pub(crate) unsafe fn __rust_thunk___ZN41StructWithExplicitlyDefaultedConstructorsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN32NonTrivialStructWithConstructorsC1ERKS_< '__param_0, >( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: &'__param_0 crate::NonTrivialStructWithConstructors, ); pub(crate) unsafe fn __rust_thunk___ZN32NonTrivialStructWithConstructorsaSERKS_< '__this, '__param_0, >( - __this: ::core::pin::Pin<&'__this mut crate::NonTrivialStructWithConstructors>, + __this: ::__rust_core::pin::Pin<&'__this mut crate::NonTrivialStructWithConstructors>, __param_0: &'__param_0 crate::NonTrivialStructWithConstructors, - ) -> ::core::pin::Pin<&'__this mut crate::NonTrivialStructWithConstructors>; + ) -> ::__rust_core::pin::Pin<&'__this mut crate::NonTrivialStructWithConstructors>; #[link_name = "_ZN32NonTrivialStructWithConstructorsC1Ev"] pub(crate) unsafe fn __rust_thunk___ZN32NonTrivialStructWithConstructorsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN32NonTrivialStructWithConstructorsC1Ei"] pub(crate) unsafe fn __rust_thunk___ZN32NonTrivialStructWithConstructorsC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: ::ffi_11::c_int, ); #[link_name = "_ZN32NonTrivialStructWithConstructorsD1Ev"] pub(crate) unsafe fn __rust_thunk___ZN32NonTrivialStructWithConstructorsD1Ev<'__this>( - __this: ::core::pin::Pin<&'__this mut crate::NonTrivialStructWithConstructors>, + __this: ::__rust_core::pin::Pin<&'__this mut crate::NonTrivialStructWithConstructors>, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_not_impl_any!(crate::StructWithUserProvidedConstructors: Copy,Drop); - assert!(::core::mem::offset_of!(crate::StructWithUserProvidedConstructors, int_field) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!( + ::__rust_core::mem::offset_of!(crate::StructWithUserProvidedConstructors, int_field) == 0 + ); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::StructWithExplicitConversionConstructor: Copy,Clone); static_assertions::assert_not_impl_any!(crate::StructWithExplicitConversionConstructor: Drop); assert!( - ::core::mem::offset_of!(crate::StructWithExplicitConversionConstructor, int_field) == 0 + ::__rust_core::mem::offset_of!(crate::StructWithExplicitConversionConstructor, int_field) + == 0 ); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::StructWithMultipleConstructors: Copy,Clone); static_assertions::assert_not_impl_any!(crate::StructWithMultipleConstructors: Drop); - assert!(::core::mem::offset_of!(crate::StructWithMultipleConstructors, int_field) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::StructWithMultipleConstructors, int_field) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::StructWithImplicitConversionConstructor: Copy,Clone); static_assertions::assert_not_impl_any!(crate::StructWithImplicitConversionConstructor: Drop); assert!( - ::core::mem::offset_of!(crate::StructWithImplicitConversionConstructor, int_field) == 0 + ::__rust_core::mem::offset_of!(crate::StructWithImplicitConversionConstructor, int_field) + == 0 ); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::OtherSimpleStruct: Copy,Clone); static_assertions::assert_not_impl_any!(crate::OtherSimpleStruct: Drop); - assert!(::core::mem::offset_of!(crate::OtherSimpleStruct, int_field) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::OtherSimpleStruct, int_field) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!( + ::__rust_core::mem::align_of::() == 4 + ); static_assertions::assert_impl_all!(crate::StructWithImplicitConversionFromReference: Copy,Clone); static_assertions::assert_not_impl_any!(crate::StructWithImplicitConversionFromReference: Drop); assert!( - ::core::mem::offset_of!(crate::StructWithImplicitConversionFromReference, int_field) == 0 + ::__rust_core::mem::offset_of!(crate::StructWithImplicitConversionFromReference, int_field) + == 0 ); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_not_impl_any!(crate::StructWithInlineConstructors: Copy,Drop); - assert!(::core::mem::offset_of!(crate::StructWithInlineConstructors, int_field) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::StructWithInlineConstructors, int_field) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_not_impl_any!(crate::StructWithDeletedConstructors: Copy,Drop); - assert!(::core::mem::offset_of!(crate::StructWithDeletedConstructors, int_field) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::StructWithDeletedConstructors, int_field) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_not_impl_any!(crate::StructWithPrivateConstructors: Copy,Drop); - assert!(::core::mem::offset_of!(crate::StructWithPrivateConstructors, int_field) == 0); - assert!(::core::mem::size_of::() == 8); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::StructWithPrivateConstructors, int_field) == 0); + assert!(::__rust_core::mem::size_of::() == 8); + assert!( + ::__rust_core::mem::align_of::() == 4 + ); static_assertions::assert_impl_all!(crate::StructWithExplicitlyDefaultedConstructors: Copy,Clone); static_assertions::assert_not_impl_any!(crate::StructWithExplicitlyDefaultedConstructors: Drop); assert!( - ::core::mem::offset_of!( + ::__rust_core::mem::offset_of!( crate::StructWithExplicitlyDefaultedConstructors, field_with_explicit_initializer ) == 0 ); assert!( - ::core::mem::offset_of!( + ::__rust_core::mem::offset_of!( crate::StructWithExplicitlyDefaultedConstructors, field_with_no_initializer ) == 4 ); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::NonTrivialStructWithConstructors: Drop); static_assertions::assert_not_impl_any!(crate::NonTrivialStructWithConstructors: Copy); - assert!(::core::mem::offset_of!(crate::NonTrivialStructWithConstructors, int_field) == 0); + assert!( + ::__rust_core::mem::offset_of!(crate::NonTrivialStructWithConstructors, int_field) == 0 + ); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); }; diff --git a/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_rs_api.rs b/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_rs_api.rs index cece628e5..6336fff7a 100644 --- a/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_rs_api.rs +++ b/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_rs_api.rs @@ -14,12 +14,13 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions.h;l=10 #[::ctor::recursively_pinned] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Uncopyable pub struct Uncopyable { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 1], } impl !Send for Uncopyable {} impl !Sync for Uncopyable {} @@ -37,7 +38,9 @@ impl ::ctor::CtorNew<()> for Uncopyable { let () = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN10UncopyableC1Ev(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___ZN10UncopyableC1Ev( + dest as *mut ::__rust_core::ffi::c_void, + ); }) } } @@ -48,10 +51,10 @@ impl ::ctor::CtorNew<()> for Uncopyable { #[repr(C, align(8))] ///CRUBIT_ANNOTATE: cpp_type=UncopyableDespiteDecl pub struct UncopyableDespiteDecl { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) vector_: [::core::cell::Cell<::core::mem::MaybeUninit>; 24], + pub(crate) vector_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 24], } impl !Send for UncopyableDespiteDecl {} impl !Sync for UncopyableDespiteDecl {} @@ -63,7 +66,7 @@ unsafe impl ::cxx::ExternType for UncopyableDespiteDecl { /// Generated from: rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions.h;l=17 impl ::ctor::PinnedDrop for UncopyableDespiteDecl { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN21UncopyableDespiteDeclD1Ev(self) } } @@ -82,7 +85,7 @@ impl ::ctor::CtorNew<()> for UncopyableDespiteDecl { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN21UncopyableDespiteDeclC1Ev( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, ); }) } @@ -139,24 +142,26 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN10UncopyableC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10UncopyableC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN21UncopyableDespiteDeclD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::UncopyableDespiteDecl>, + __this: ::__rust_core::pin::Pin<&'a mut crate::UncopyableDespiteDecl>, ); pub(crate) unsafe fn __rust_thunk___ZN21UncopyableDespiteDeclC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_not_impl_any!(crate::Uncopyable: Copy,Drop); - assert!(::core::mem::size_of::() == 24); - assert!(::core::mem::align_of::() == 8); + assert!(::__rust_core::mem::size_of::() == 24); + assert!(::__rust_core::mem::align_of::() == 8); static_assertions::assert_impl_all!(crate::UncopyableDespiteDecl: Drop); static_assertions::assert_not_impl_any!(crate::UncopyableDespiteDecl: Copy); - assert!(::core::mem::offset_of!(crate::UncopyableDespiteDecl, vector_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::UncopyableDespiteDecl, vector_) == 0); }; diff --git a/rs_bindings_from_cc/test/struct/destructors/destructors_rs_api.rs b/rs_bindings_from_cc/test/struct/destructors/destructors_rs_api.rs index eb4001cae..44de0ec8e 100644 --- a/rs_bindings_from_cc/test/struct/destructors/destructors_rs_api.rs +++ b/rs_bindings_from_cc/test/struct/destructors/destructors_rs_api.rs @@ -14,14 +14,15 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/struct/destructors/destructors.h;l=10 #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=DestructionOrderRecorder pub struct DestructionOrderRecorder { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) int_field_: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) int_field_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } impl !Send for DestructionOrderRecorder {} impl !Sync for DestructionOrderRecorder {} @@ -60,7 +61,7 @@ impl From<::ffi_11::c_int> for DestructionOrderRecorder { #[inline(always)] fn from(args: ::ffi_11::c_int) -> Self { let mut int_field = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN24DestructionOrderRecorderC1Ei( &raw mut tmp as *mut _, @@ -84,7 +85,7 @@ impl From<::ctor::RvalueReference<'_, Self>> for DestructionOrderRecorder { #[inline(always)] fn from(args: ::ctor::RvalueReference<'_, Self>) -> Self { let mut other = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN24DestructionOrderRecorderC1EOS_( &raw mut tmp as *mut _, @@ -125,16 +126,16 @@ impl Drop for DestructionOrderRecorder { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=FieldDestructionOrderTester pub struct FieldDestructionOrderTester { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field1_: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) field1_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field2_: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) field2_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field3_: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) field3_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } impl !Send for FieldDestructionOrderTester {} impl !Sync for FieldDestructionOrderTester {} @@ -163,7 +164,7 @@ impl From<::ctor::RvalueReference<'_, Self>> for FieldDestructionOrderTester { #[inline(always)] fn from(args: ::ctor::RvalueReference<'_, Self>) -> Self { let mut __param_0 = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN27FieldDestructionOrderTesterC1EOS_( &raw mut tmp as *mut _, @@ -217,7 +218,7 @@ impl ), ) -> Self { let (mut field1, mut field2, mut field3) = args; - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN27FieldDestructionOrderTesterC1E24DestructionOrderRecorderS0_S0_(&raw mut tmp as*mut _,&mut field1,&mut field2,&mut field3); tmp.assume_init() @@ -262,11 +263,11 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN24DestructionOrderRecorderC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, int_field: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN24DestructionOrderRecorderC1EOS_( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, other: ::ctor::RvalueReference<'_, crate::DestructionOrderRecorder>, ); pub(crate) unsafe fn __rust_thunk___ZN24DestructionOrderRecorderaSEOS_<'__return_lifetime>( @@ -286,7 +287,7 @@ mod detail { #[link_name = "_ZN24DestructionOrderRecorder22ClearDestructionRecordEv"] pub(crate) unsafe fn __rust_thunk___ZN24DestructionOrderRecorder22ClearDestructionRecordEv(); pub(crate) unsafe fn __rust_thunk___ZN27FieldDestructionOrderTesterC1EOS_( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: ::ctor::RvalueReference<'_, crate::FieldDestructionOrderTester>, ); pub(crate) unsafe fn __rust_thunk___ZN27FieldDestructionOrderTesterD1Ev<'a>( @@ -299,7 +300,7 @@ mod detail { __param_0: ::ctor::RvalueReference<'_, crate::FieldDestructionOrderTester>, ) -> &'__return_lifetime mut crate::FieldDestructionOrderTester; pub(crate) unsafe fn __rust_thunk___ZN27FieldDestructionOrderTesterC1E24DestructionOrderRecorderS0_S0_( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field1: &mut crate::DestructionOrderRecorder, field2: &mut crate::DestructionOrderRecorder, field3: &mut crate::DestructionOrderRecorder, @@ -313,16 +314,16 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::DestructionOrderRecorder: Drop); static_assertions::assert_not_impl_any!(crate::DestructionOrderRecorder: Copy); - assert!(::core::mem::offset_of!(crate::DestructionOrderRecorder, int_field_) == 0); - assert!(::core::mem::size_of::() == 12); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::DestructionOrderRecorder, int_field_) == 0); + assert!(::__rust_core::mem::size_of::() == 12); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::FieldDestructionOrderTester: Drop); static_assertions::assert_not_impl_any!(crate::FieldDestructionOrderTester: Copy); - assert!(::core::mem::offset_of!(crate::FieldDestructionOrderTester, field1_) == 0); - assert!(::core::mem::offset_of!(crate::FieldDestructionOrderTester, field2_) == 4); - assert!(::core::mem::offset_of!(crate::FieldDestructionOrderTester, field3_) == 8); + assert!(::__rust_core::mem::offset_of!(crate::FieldDestructionOrderTester, field1_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::FieldDestructionOrderTester, field2_) == 4); + assert!(::__rust_core::mem::offset_of!(crate::FieldDestructionOrderTester, field3_) == 8); }; diff --git a/rs_bindings_from_cc/test/struct/inheritance/inherited_methods_rs_api.rs b/rs_bindings_from_cc/test/struct/inheritance/inherited_methods_rs_api.rs index 1926da81f..41ef5eb36 100644 --- a/rs_bindings_from_cc/test/struct/inheritance/inherited_methods_rs_api.rs +++ b/rs_bindings_from_cc/test/struct/inheritance/inherited_methods_rs_api.rs @@ -14,12 +14,13 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/struct/inheritance/inherited_methods.h;l=10 #[::ctor::recursively_pinned] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Nonmovable pub struct Nonmovable { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 1], } impl !Send for Nonmovable {} impl !Sync for Nonmovable {} @@ -38,7 +39,9 @@ impl ::ctor::CtorNew<()> for Nonmovable { let () = args; unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { - crate::detail::__rust_thunk___ZN10NonmovableC1Ev(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___ZN10NonmovableC1Ev( + dest as *mut ::__rust_core::ffi::c_void, + ); }) } } @@ -49,7 +52,7 @@ impl ::ctor::CtorNew<()> for Nonmovable { #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Base pub struct Base { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Base {} impl !Sync for Base {} @@ -82,7 +85,7 @@ impl Base { impl Default for Base { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN4BaseC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -100,7 +103,7 @@ pub trait BindingFailedFor_ZNK4Base11no_bindingsE10Nonmovable {} #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Derived pub struct Derived { - __non_field_data: [::core::mem::MaybeUninit; 1], + __non_field_data: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Derived {} impl !Sync for Derived {} @@ -135,7 +138,7 @@ impl Derived { impl Default for Derived { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN7DerivedC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -158,27 +161,29 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN10NonmovableC1Ev(__this: *mut ::core::ffi::c_void); - pub(crate) unsafe fn __rust_thunk___ZN4BaseC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN10NonmovableC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___ZN4BaseC1Ev(__this: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___ZNK4Base12has_bindingsEv<'__this>( __this: &'__this crate::Base, ) -> bool; - pub(crate) unsafe fn __rust_thunk___ZN7DerivedC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN7DerivedC1Ev(__this: *mut ::__rust_core::ffi::c_void); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_not_impl_any!(crate::Nonmovable: Copy,Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Base: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Base: Drop); - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::Derived: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Derived: Drop); }; diff --git a/rs_bindings_from_cc/test/struct/methods/methods_rs_api.rs b/rs_bindings_from_cc/test/struct/methods/methods_rs_api.rs index f01c419e4..63aaf56bc 100644 --- a/rs_bindings_from_cc/test/struct/methods/methods_rs_api.rs +++ b/rs_bindings_from_cc/test/struct/methods/methods_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/struct/methods/methods.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -32,9 +33,9 @@ impl SomeClass { #[inline(always)] pub fn static_factory_method(int_var_initial_value: ::ffi_11::c_int) -> crate::SomeClass { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___ZN9SomeClass21static_factory_methodEi( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, int_var_initial_value, ); __return.assume_init() @@ -66,7 +67,7 @@ impl SomeClass { impl Default for SomeClass { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN9SomeClassC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -148,7 +149,7 @@ impl InstanceMethods { impl Default for InstanceMethods { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN15InstanceMethodsC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -160,9 +161,11 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN9SomeClassC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN9SomeClass21static_factory_methodEi( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, int_var_initial_value: ::ffi_11::c_int, ); #[link_name = "_ZN9SomeClass38static_method_that_multiplies_its_argsEii"] @@ -174,7 +177,7 @@ mod detail { arg: ::ffi_11::c_int, ) -> ::ffi_11::c_int; pub(crate) unsafe fn __rust_thunk___ZN15InstanceMethodsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZNK15InstanceMethods13get_int_fieldEv"] pub(crate) unsafe fn __rust_thunk___ZNK15InstanceMethods13get_int_fieldEv( @@ -209,14 +212,14 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::SomeClass: Copy,Clone); static_assertions::assert_not_impl_any!(crate::SomeClass: Drop); - assert!(::core::mem::offset_of!(crate::SomeClass, int_var) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::SomeClass, int_var) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::InstanceMethods: Copy,Clone); static_assertions::assert_not_impl_any!(crate::InstanceMethods: Drop); - assert!(::core::mem::offset_of!(crate::InstanceMethods, int_field) == 0); + assert!(::__rust_core::mem::offset_of!(crate::InstanceMethods, int_field) == 0); }; diff --git a/rs_bindings_from_cc/test/struct/methods_qualifiers/methods_qualifiers_rs_api.rs b/rs_bindings_from_cc/test/struct/methods_qualifiers/methods_qualifiers_rs_api.rs index 26f6e99af..7bb487aff 100644 --- a/rs_bindings_from_cc/test/struct/methods_qualifiers/methods_qualifiers_rs_api.rs +++ b/rs_bindings_from_cc/test/struct/methods_qualifiers/methods_qualifiers_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/struct/methods_qualifiers/methods_qualifiers.h;l=10 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -93,7 +94,7 @@ impl UnpinStructWithRefQualifiedMethods { impl Default for UnpinStructWithRefQualifiedMethods { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN34UnpinStructWithRefQualifiedMethodsC1Ev( &raw mut tmp as *mut _, @@ -108,7 +109,7 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN34UnpinStructWithRefQualifiedMethodsC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); #[link_name = "_ZN34UnpinStructWithRefQualifiedMethods11increment_iEv"] pub(crate) unsafe fn __rust_thunk___ZN34UnpinStructWithRefQualifiedMethods11increment_iEv< @@ -156,9 +157,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::UnpinStructWithRefQualifiedMethods: Copy,Clone); static_assertions::assert_not_impl_any!(crate::UnpinStructWithRefQualifiedMethods: Drop); - assert!(::core::mem::offset_of!(crate::UnpinStructWithRefQualifiedMethods, i) == 0); + assert!(::__rust_core::mem::offset_of!(crate::UnpinStructWithRefQualifiedMethods, i) == 0); }; diff --git a/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs b/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs index 6ab65754a..b7dd91a94 100644 --- a/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs +++ b/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; pub mod repro { // Generated from: rs_bindings_from_cc/test/templates/regression_401857961/repro.h;l=10 // error: class `repro::optional` could not be bound @@ -32,7 +33,7 @@ pub mod repro { pub struct Interval { /// Reason for representing this field as a blob of bytes: /// Unsupported type 'char[1]': Unsupported clang::Type class 'ConstantArray' - pub(crate) nanos: [::core::mem::MaybeUninit; 1], + pub(crate) nanos: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for Interval {} impl !Sync for Interval {} @@ -45,7 +46,7 @@ pub mod repro { impl Default for Interval { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN5repro8IntervalC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -81,14 +82,16 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN5repro8IntervalC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN5repro8IntervalC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::repro::Interval: Copy,Clone); static_assertions::assert_not_impl_any!(crate::repro::Interval: Drop); - assert!(::core::mem::offset_of!(crate::repro::Interval, nanos) == 0); + assert!(::__rust_core::mem::offset_of!(crate::repro::Interval, nanos) == 0); }; diff --git a/rs_bindings_from_cc/test/templates/type_alias/type_alias_rs_api.rs b/rs_bindings_from_cc/test/templates/type_alias/type_alias_rs_api.rs index cd35747cc..ff586f824 100644 --- a/rs_bindings_from_cc/test/templates/type_alias/type_alias_rs_api.rs +++ b/rs_bindings_from_cc/test/templates/type_alias/type_alias_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // Generated from: rs_bindings_from_cc/test/templates/type_alias/type_alias.h;l=10 // error: class `MyTemplate` could not be bound // Class templates are not yet supported @@ -29,10 +30,10 @@ pub type OtherTypeAliasInSameTarget = crate::__CcTemplateInst10MyTemplateIiE; #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=MyTemplate < int > pub struct __CcTemplateInst10MyTemplateIiE { - __non_field_data: [::core::mem::MaybeUninit; 0], + __non_field_data: [::__rust_core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) value_: [::core::mem::MaybeUninit; 4], + pub(crate) value_: [::__rust_core::mem::MaybeUninit; 4], } impl !Send for __CcTemplateInst10MyTemplateIiE {} impl !Sync for __CcTemplateInst10MyTemplateIiE {} @@ -45,8 +46,8 @@ impl __CcTemplateInst10MyTemplateIiE { #[inline(always)] pub fn Create(value: ::ffi_11::c_int) -> crate::__CcTemplateInst10MyTemplateIiE { unsafe { - let mut __return = ::core::mem::MaybeUninit::::uninit(); - crate::detail::__rust_thunk___ZN10MyTemplateIiE6CreateEi__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2ftemplates_2ftype_5falias_3atype_5falias(&raw mut __return as*mut::core::ffi::c_void,value); + let mut __return = ::__rust_core::mem::MaybeUninit::::uninit(); + crate::detail::__rust_thunk___ZN10MyTemplateIiE6CreateEi__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2ftemplates_2ftype_5falias_3atype_5falias(&raw mut __return as*mut::__rust_core::ffi::c_void,value); __return.assume_init() } } @@ -63,7 +64,7 @@ impl __CcTemplateInst10MyTemplateIiE { impl Default for __CcTemplateInst10MyTemplateIiE { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN10MyTemplateIiEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2ftemplates_2ftype_5falias_3atype_5falias(&raw mut tmp as*mut _); tmp.assume_init() @@ -76,10 +77,10 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN10MyTemplateIiEC1Ev__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2ftemplates_2ftype_5falias_3atype_5falias( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, ); pub(crate) unsafe fn __rust_thunk___ZN10MyTemplateIiE6CreateEi__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2ftemplates_2ftype_5falias_3atype_5falias( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, value: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZNK10MyTemplateIiE5valueEv__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2ftemplates_2ftype_5falias_3atype_5falias< @@ -91,9 +92,9 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::__CcTemplateInst10MyTemplateIiE: Copy,Clone); static_assertions::assert_not_impl_any!(crate::__CcTemplateInst10MyTemplateIiE: Drop); - assert!(::core::mem::offset_of!(crate::__CcTemplateInst10MyTemplateIiE, value_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::__CcTemplateInst10MyTemplateIiE, value_) == 0); }; diff --git a/rs_bindings_from_cc/test/templates/type_alias_access_rule/type_alias_access_rule_rs_api.rs b/rs_bindings_from_cc/test/templates/type_alias_access_rule/type_alias_access_rule_rs_api.rs index f9aafda05..48cda9c38 100644 --- a/rs_bindings_from_cc/test/templates/type_alias_access_rule/type_alias_access_rule_rs_api.rs +++ b/rs_bindings_from_cc/test/templates/type_alias_access_rule/type_alias_access_rule_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // Generated from: rs_bindings_from_cc/test/templates/type_alias_access_rule/type_alias_access_rule.h;l=10 // error: class `A` could not be bound // Class templates are not yet supported @@ -31,7 +32,7 @@ pub struct B { /// Reason for representing this field as a blob of bytes: /// Unsupported type 'A': Failed to create bindings for template specialization type A: Type 'struct B::PrivateMember' uses non-public declaration 'B::PrivateMember', which cannot be spelled in C++ by generated code. - pub(crate) a_: [::core::mem::MaybeUninit; 1], + pub(crate) a_: [::__rust_core::mem::MaybeUninit; 1], } impl !Send for B {} impl !Sync for B {} @@ -45,7 +46,7 @@ forward_declare::unsafe_define!(forward_declare::symbol!("B"), crate::B); impl Default for B { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN1BC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -61,14 +62,14 @@ mod detail { #[allow(unused_imports)] use super::*; unsafe extern "C" { - pub(crate) unsafe fn __rust_thunk___ZN1BC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN1BC1Ev(__this: *mut ::__rust_core::ffi::c_void); } } const _: () = { - assert!(::core::mem::size_of::() == 1); - assert!(::core::mem::align_of::() == 1); + assert!(::__rust_core::mem::size_of::() == 1); + assert!(::__rust_core::mem::align_of::() == 1); static_assertions::assert_impl_all!(crate::B: Copy,Clone); static_assertions::assert_not_impl_any!(crate::B: Drop); - assert!(::core::mem::offset_of!(crate::B, a_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::B, a_) == 0); }; diff --git a/rs_bindings_from_cc/test/types_only/types_only_rs_api.rs b/rs_bindings_from_cc/test/types_only/types_only_rs_api.rs index 0605a4e09..6931b74f9 100644 --- a/rs_bindings_from_cc/test/types_only/types_only_rs_api.rs +++ b/rs_bindings_from_cc/test/types_only/types_only_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/types_only/types_only.h;l=13 #[inline(always)] pub fn MustBindFn() { @@ -38,7 +39,7 @@ unsafe impl ::cxx::ExternType for Copyable { impl Default for Copyable { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN8CopyableC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -51,10 +52,10 @@ impl Default for Copyable { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=Cloneable pub struct Cloneable { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) field_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } impl !Send for Cloneable {} impl !Sync for Cloneable {} @@ -73,7 +74,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for Cloneable { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN9CloneableC1Ei( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, field, ); }) @@ -100,7 +101,7 @@ impl<'__unelided> ::ctor::CtorNew<&'__unelided Self> for Cloneable { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN9CloneableC1ERKS_( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, __param_0, ); }) @@ -127,7 +128,7 @@ impl<'__unelided> ::ctor::CtorNew<::ctor::RvalueReference<'__unelided, Self>> fo unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN9CloneableC1EOS_( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, __param_0, ); }) @@ -147,7 +148,7 @@ impl<'__unelided> ::ctor::CtorNew<(::ctor::RvalueReference<'__unelided, Self>,)> /// Generated from: rs_bindings_from_cc/test/types_only/types_only.h;l=26 impl ::ctor::Assign<&Self> for Cloneable { #[inline(always)] - fn assign(self: ::core::pin::Pin<&mut Self>, __param_0: &Self) { + fn assign(self: ::__rust_core::pin::Pin<&mut Self>, __param_0: &Self) { unsafe { crate::detail::__rust_thunk___ZN9CloneableaSERKS_(self, __param_0); } @@ -157,7 +158,10 @@ impl ::ctor::Assign<&Self> for Cloneable { /// Generated from: rs_bindings_from_cc/test/types_only/types_only.h;l=27 impl ::ctor::Assign<::ctor::RvalueReference<'_, Self>> for Cloneable { #[inline(always)] - fn assign(self: ::core::pin::Pin<&mut Self>, __param_0: ::ctor::RvalueReference<'_, Self>) { + fn assign( + self: ::__rust_core::pin::Pin<&mut Self>, + __param_0: ::ctor::RvalueReference<'_, Self>, + ) { unsafe { crate::detail::__rust_thunk___ZN9CloneableaSEOS_(self, __param_0); } @@ -167,7 +171,7 @@ impl ::ctor::Assign<::ctor::RvalueReference<'_, Self>> for Cloneable { /// Generated from: rs_bindings_from_cc/test/types_only/types_only.h;l=28 impl ::ctor::PinnedDrop for Cloneable { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN9CloneableD1Ev(self) } } @@ -177,10 +181,10 @@ impl ::ctor::PinnedDrop for Cloneable { #[repr(C, align(4))] ///CRUBIT_ANNOTATE: cpp_type=Movable pub struct Movable { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: /// Types of non-public C++ fields can be elided away - pub(crate) field_: [::core::cell::Cell<::core::mem::MaybeUninit>; 4], + pub(crate) field_: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 4], } impl !Send for Movable {} impl !Sync for Movable {} @@ -199,7 +203,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for Movable { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN7MovableC1Ei( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, field, ); }) @@ -226,7 +230,7 @@ impl<'__unelided> ::ctor::CtorNew<::ctor::RvalueReference<'__unelided, Self>> fo unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN7MovableC1EOS_( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, other, ); }) @@ -246,7 +250,7 @@ impl<'__unelided> ::ctor::CtorNew<(::ctor::RvalueReference<'__unelided, Self>,)> /// Generated from: rs_bindings_from_cc/test/types_only/types_only.h;l=40 impl ::ctor::Assign<::ctor::RvalueReference<'_, Self>> for Movable { #[inline(always)] - fn assign(self: ::core::pin::Pin<&mut Self>, other: ::ctor::RvalueReference<'_, Self>) { + fn assign(self: ::__rust_core::pin::Pin<&mut Self>, other: ::ctor::RvalueReference<'_, Self>) { unsafe { crate::detail::__rust_thunk___ZN7MovableaSEOS_(self, other); } @@ -256,7 +260,7 @@ impl ::ctor::Assign<::ctor::RvalueReference<'_, Self>> for Movable { /// Generated from: rs_bindings_from_cc/test/types_only/types_only.h;l=45 impl ::ctor::PinnedDrop for Movable { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN7MovableD1Ev(self) } } @@ -274,62 +278,64 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___Z10MustBindFnv(); - pub(crate) unsafe fn __rust_thunk___ZN8CopyableC1Ev(__this: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___ZN8CopyableC1Ev( + __this: *mut ::__rust_core::ffi::c_void, + ); pub(crate) unsafe fn __rust_thunk___ZN9CloneableC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN9CloneableC1ERKS_<'__unelided>( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: &'__unelided crate::Cloneable, ); pub(crate) unsafe fn __rust_thunk___ZN9CloneableC1EOS_<'__unelided>( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: ::ctor::RvalueReference<'__unelided, crate::Cloneable>, ); pub(crate) unsafe fn __rust_thunk___ZN9CloneableaSERKS_<'__return_lifetime>( - __this: ::core::pin::Pin<&mut crate::Cloneable>, + __this: ::__rust_core::pin::Pin<&mut crate::Cloneable>, __param_0: &crate::Cloneable, - ) -> ::core::pin::Pin<&'__return_lifetime mut crate::Cloneable>; + ) -> ::__rust_core::pin::Pin<&'__return_lifetime mut crate::Cloneable>; pub(crate) unsafe fn __rust_thunk___ZN9CloneableaSEOS_<'__return_lifetime>( - __this: ::core::pin::Pin<&mut crate::Cloneable>, + __this: ::__rust_core::pin::Pin<&mut crate::Cloneable>, __param_0: ::ctor::RvalueReference<'_, crate::Cloneable>, - ) -> ::core::pin::Pin<&'__return_lifetime mut crate::Cloneable>; + ) -> ::__rust_core::pin::Pin<&'__return_lifetime mut crate::Cloneable>; pub(crate) unsafe fn __rust_thunk___ZN9CloneableD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::Cloneable>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Cloneable>, ); pub(crate) unsafe fn __rust_thunk___ZN7MovableC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, field: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN7MovableC1EOS_<'__unelided>( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, other: ::ctor::RvalueReference<'__unelided, crate::Movable>, ); pub(crate) unsafe fn __rust_thunk___ZN7MovableaSEOS_<'__return_lifetime>( - __this: ::core::pin::Pin<&mut crate::Movable>, + __this: ::__rust_core::pin::Pin<&mut crate::Movable>, other: ::ctor::RvalueReference<'_, crate::Movable>, - ) -> ::core::pin::Pin<&'__return_lifetime mut crate::Movable>; + ) -> ::__rust_core::pin::Pin<&'__return_lifetime mut crate::Movable>; pub(crate) unsafe fn __rust_thunk___ZN7MovableD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::Movable>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Movable>, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Copyable: Copy,Clone); static_assertions::assert_not_impl_any!(crate::Copyable: Drop); - assert!(::core::mem::offset_of!(crate::Copyable, field) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::Copyable, field) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Cloneable: Drop); static_assertions::assert_not_impl_any!(crate::Cloneable: Copy); - assert!(::core::mem::offset_of!(crate::Cloneable, field_) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::Cloneable, field_) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Movable: Drop); static_assertions::assert_not_impl_any!(crate::Movable: Copy); - assert!(::core::mem::offset_of!(crate::Movable, field_) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Movable, field_) == 0); }; diff --git a/rs_bindings_from_cc/test/wrapper/fallback_types/wrapper_library_rs_api.rs b/rs_bindings_from_cc/test/wrapper/fallback_types/wrapper_library_rs_api.rs index c2c4946bb..de4d4d0db 100644 --- a/rs_bindings_from_cc/test/wrapper/fallback_types/wrapper_library_rs_api.rs +++ b/rs_bindings_from_cc/test/wrapper/fallback_types/wrapper_library_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/wrapper/fallback_types/wrapper_library.h;l=10 #[inline(always)] pub(crate) fn GetGlobalUnsupportedType( diff --git a/rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor_rs_api.rs b/rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor_rs_api.rs index c8ce4b033..1e098c4e9 100644 --- a/rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor_rs_api.rs +++ b/rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor_rs_api.rs @@ -14,12 +14,13 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; /// Generated from: rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor.h;l=8 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] ///CRUBIT_ANNOTATE: cpp_type=Nontrivial pub struct Nontrivial { - __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], + __non_field_data: [::__rust_core::cell::Cell<::__rust_core::mem::MaybeUninit>; 0], pub value: ::ffi_11::c_int, } impl !Send for Nontrivial {} @@ -40,7 +41,7 @@ impl ::ctor::CtorNew<::ffi_11::c_int> for Nontrivial { unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN10NontrivialC1Ei( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, x, ); }) @@ -67,7 +68,7 @@ impl<'__unelided> ::ctor::CtorNew<::ctor::RvalueReference<'__unelided, Self>> fo unsafe { ::ctor::FnCtor::new(move |dest: *mut Self| { crate::detail::__rust_thunk___ZN10NontrivialC1EOS_( - dest as *mut ::core::ffi::c_void, + dest as *mut ::__rust_core::ffi::c_void, __param_0, ); }) @@ -87,7 +88,10 @@ impl<'__unelided> ::ctor::CtorNew<(::ctor::RvalueReference<'__unelided, Self>,)> /// Generated from: rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor.h;l=12 impl ::ctor::Assign<::ctor::RvalueReference<'_, Self>> for Nontrivial { #[inline(always)] - fn assign(self: ::core::pin::Pin<&mut Self>, __param_0: ::ctor::RvalueReference<'_, Self>) { + fn assign( + self: ::__rust_core::pin::Pin<&mut Self>, + __param_0: ::ctor::RvalueReference<'_, Self>, + ) { unsafe { crate::detail::__rust_thunk___ZN10NontrivialaSEOS_(self, __param_0); } @@ -97,7 +101,7 @@ impl ::ctor::Assign<::ctor::RvalueReference<'_, Self>> for Nontrivial { /// Generated from: rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor.h;l=13 impl ::ctor::PinnedDrop for Nontrivial { #[inline(always)] - unsafe fn pinned_drop<'a>(self: ::core::pin::Pin<&'a mut Self>) { + unsafe fn pinned_drop<'a>(self: ::__rust_core::pin::Pin<&'a mut Self>) { crate::detail::__rust_thunk___ZN10NontrivialD1Ev(self) } } @@ -107,7 +111,7 @@ impl ::ctor::PinnedDrop for Nontrivial { pub fn Create() -> ::ctor::Ctor![crate::Nontrivial] { unsafe { ::ctor::FnCtor::new(move |dest: *mut crate::Nontrivial| { - crate::detail::__rust_thunk___Z6Createv(dest as *mut ::core::ffi::c_void); + crate::detail::__rust_thunk___Z6Createv(dest as *mut ::__rust_core::ffi::c_void); }) } } @@ -116,9 +120,9 @@ pub fn Create() -> ::ctor::Ctor![crate::Nontrivial] { #[inline(always)] pub fn Read(nontrivial: ::ctor::Ctor![crate::Nontrivial]) -> ::ffi_11::c_int { unsafe { - crate::detail::__rust_thunk___Z4Read10Nontrivial(::core::pin::Pin::into_inner_unchecked( - ::ctor::emplace!(nontrivial), - )) + crate::detail::__rust_thunk___Z4Read10Nontrivial( + ::__rust_core::pin::Pin::into_inner_unchecked(::ctor::emplace!(nontrivial)), + ) } } @@ -132,21 +136,21 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1Ei( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, x: ::ffi_11::c_int, ); pub(crate) unsafe fn __rust_thunk___ZN10NontrivialC1EOS_<'__unelided>( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, __param_0: ::ctor::RvalueReference<'__unelided, crate::Nontrivial>, ); pub(crate) unsafe fn __rust_thunk___ZN10NontrivialaSEOS_<'__return_lifetime>( - __this: ::core::pin::Pin<&mut crate::Nontrivial>, + __this: ::__rust_core::pin::Pin<&mut crate::Nontrivial>, __param_0: ::ctor::RvalueReference<'_, crate::Nontrivial>, - ) -> ::core::pin::Pin<&'__return_lifetime mut crate::Nontrivial>; + ) -> ::__rust_core::pin::Pin<&'__return_lifetime mut crate::Nontrivial>; pub(crate) unsafe fn __rust_thunk___ZN10NontrivialD1Ev<'a>( - __this: ::core::pin::Pin<&'a mut crate::Nontrivial>, + __this: ::__rust_core::pin::Pin<&'a mut crate::Nontrivial>, ); - pub(crate) unsafe fn __rust_thunk___Z6Createv(__return: *mut ::core::ffi::c_void); + pub(crate) unsafe fn __rust_thunk___Z6Createv(__return: *mut ::__rust_core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___Z4Read10Nontrivial( nontrivial: &mut crate::Nontrivial, ) -> ::ffi_11::c_int; @@ -154,10 +158,10 @@ mod detail { } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::Nontrivial: Drop); static_assertions::assert_not_impl_any!(crate::Nontrivial: Copy); - assert!(::core::mem::offset_of!(crate::Nontrivial, value) == 0); + assert!(::__rust_core::mem::offset_of!(crate::Nontrivial, value) == 0); static_assertions::assert_impl_all!(::ffi_11::c_int: Copy); }; diff --git a/rs_bindings_from_cc/test/wrapper/pub_crate_types/pub_crate_types_rs_api.rs b/rs_bindings_from_cc/test/wrapper/pub_crate_types/pub_crate_types_rs_api.rs index efe59f5fc..1769e0024 100644 --- a/rs_bindings_from_cc/test/wrapper/pub_crate_types/pub_crate_types_rs_api.rs +++ b/rs_bindings_from_cc/test/wrapper/pub_crate_types/pub_crate_types_rs_api.rs @@ -14,6 +14,7 @@ #![allow(unused)] #![deny(warnings)] +extern crate core as __rust_core; // Generated from: rs_bindings_from_cc/test/wrapper/pub_crate_types/pub_crate_types.h;l=10 // error: class `Template` could not be bound // Class templates are not yet supported @@ -43,7 +44,7 @@ forward_declare::unsafe_define!( impl Default for CompoundDataType { #[inline(always)] fn default() -> Self { - let mut tmp = ::core::mem::MaybeUninit::::zeroed(); + let mut tmp = ::__rust_core::mem::MaybeUninit::::zeroed(); unsafe { crate::detail::__rust_thunk___ZN16CompoundDataTypeC1Ev(&raw mut tmp as *mut _); tmp.assume_init() @@ -56,9 +57,9 @@ impl Default for CompoundDataType { pub(crate) fn GetTemplateInt() -> crate::__CcTemplateInst8TemplateIiE { unsafe { let mut __return = - ::core::mem::MaybeUninit::::uninit(); + ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___Z14GetTemplateIntv( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, ); __return.assume_init() } @@ -100,9 +101,9 @@ pub unsafe fn OtherPubCrateTypes(__param_0: *mut ::other_pub_crate_types::Forwar pub(crate) fn GetOtherPubCrateTemplate2Int() -> crate::__CcTemplateInst9Template2IiE { unsafe { let mut __return = - ::core::mem::MaybeUninit::::uninit(); + ::__rust_core::mem::MaybeUninit::::uninit(); crate::detail::__rust_thunk___Z28GetOtherPubCrateTemplate2Intv( - &raw mut __return as *mut ::core::ffi::c_void, + &raw mut __return as *mut ::__rust_core::ffi::c_void, ); __return.assume_init() } @@ -203,9 +204,11 @@ mod detail { use super::*; unsafe extern "C" { pub(crate) unsafe fn __rust_thunk___ZN16CompoundDataTypeC1Ev( - __this: *mut ::core::ffi::c_void, + __this: *mut ::__rust_core::ffi::c_void, + ); + pub(crate) unsafe fn __rust_thunk___Z14GetTemplateIntv( + __return: *mut ::__rust_core::ffi::c_void, ); - pub(crate) unsafe fn __rust_thunk___Z14GetTemplateIntv(__return: *mut ::core::ffi::c_void); pub(crate) unsafe fn __rust_thunk___Z23ConsumeCompoundDataType16CompoundDataType( container: &mut crate::CompoundDataType, ) -> ::ffi_11::c_int; @@ -213,25 +216,25 @@ mod detail { __param_0: *mut ::other_pub_crate_types::ForwardDeclared2, ); pub(crate) unsafe fn __rust_thunk___Z28GetOtherPubCrateTemplate2Intv( - __return: *mut ::core::ffi::c_void, + __return: *mut ::__rust_core::ffi::c_void, ); } } const _: () = { - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::CompoundDataType: Copy,Clone); static_assertions::assert_not_impl_any!(crate::CompoundDataType: Drop); - assert!(::core::mem::offset_of!(crate::CompoundDataType, template_int) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::CompoundDataType, template_int) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::__CcTemplateInst9Template2IiE: Copy,Clone); static_assertions::assert_not_impl_any!(crate::__CcTemplateInst9Template2IiE: Drop); - assert!(::core::mem::offset_of!(crate::__CcTemplateInst9Template2IiE, value) == 0); - assert!(::core::mem::size_of::() == 4); - assert!(::core::mem::align_of::() == 4); + assert!(::__rust_core::mem::offset_of!(crate::__CcTemplateInst9Template2IiE, value) == 0); + assert!(::__rust_core::mem::size_of::() == 4); + assert!(::__rust_core::mem::align_of::() == 4); static_assertions::assert_impl_all!(crate::__CcTemplateInst8TemplateIiE: Copy,Clone); static_assertions::assert_not_impl_any!(crate::__CcTemplateInst8TemplateIiE: Drop); - assert!(::core::mem::offset_of!(crate::__CcTemplateInst8TemplateIiE, value) == 0); + assert!(::__rust_core::mem::offset_of!(crate::__CcTemplateInst8TemplateIiE, value) == 0); };