diff --git a/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api.h b/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api.h index 3730f6d24..6a9325f8a 100644 --- a/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api.h +++ b/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // aliasing_references_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_ALIASING_REFERENCES_ALIASING_REFERENCES_GOLDEN diff --git a/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api_impl.rs b/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api_impl.rs index 86bdde250..c0a7df463 100644 --- a/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/aliasing_references/aliasing_references_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // aliasing_references_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/arrays/arrays_cc_api.h b/cc_bindings_from_rs/test/arrays/arrays_cc_api.h index 68aadd6ea..0f0e5061e 100644 --- a/cc_bindings_from_rs/test/arrays/arrays_cc_api.h +++ b/cc_bindings_from_rs/test/arrays/arrays_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // arrays_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_ARRAYS_ARRAYS_GOLDEN diff --git a/cc_bindings_from_rs/test/arrays/arrays_cc_api_impl.rs b/cc_bindings_from_rs/test/arrays/arrays_cc_api_impl.rs index a15008d42..045074730 100644 --- a/cc_bindings_from_rs/test/arrays/arrays_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/arrays/arrays_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // arrays_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/attribute/cpp_name_cc_api.h b/cc_bindings_from_rs/test/attribute/cpp_name_cc_api.h index 664094f91..c6f4bf716 100644 --- a/cc_bindings_from_rs/test/attribute/cpp_name_cc_api.h +++ b/cc_bindings_from_rs/test/attribute/cpp_name_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // cpp_name_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_ATTRIBUTE_CPP_NAME_GOLDEN diff --git a/cc_bindings_from_rs/test/attribute/cpp_name_cc_api_impl.rs b/cc_bindings_from_rs/test/attribute/cpp_name_cc_api_impl.rs index 783c08858..ed742658e 100644 --- a/cc_bindings_from_rs/test/attribute/cpp_name_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/attribute/cpp_name_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // cpp_name_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/attribute/must_bind_cc_api.h b/cc_bindings_from_rs/test/attribute/must_bind_cc_api.h index 436efebf2..c41697d27 100644 --- a/cc_bindings_from_rs/test/attribute/must_bind_cc_api.h +++ b/cc_bindings_from_rs/test/attribute/must_bind_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // must_bind_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_ATTRIBUTE_MUST_BIND_GOLDEN diff --git a/cc_bindings_from_rs/test/attribute/must_bind_cc_api_impl.rs b/cc_bindings_from_rs/test/attribute/must_bind_cc_api_impl.rs index 1fc7a9f10..2ae0b1aa1 100644 --- a/cc_bindings_from_rs/test/attribute/must_bind_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/attribute/must_bind_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // must_bind_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api.h b/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api.h index b1d1ce7ac..428eceadc 100644 --- a/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api.h +++ b/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // rust_lib_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_BRIDGING_PROTOBUF_RUST_LIB_GOLDEN diff --git a/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api_impl.rs b/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api_impl.rs index 031182fd8..2b5eca77f 100644 --- a/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/bridging/protobuf/rust_lib_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // rust_lib_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/enums/cpp_enums_cc_api.h b/cc_bindings_from_rs/test/enums/cpp_enums_cc_api.h index 9c0c8a1ad..1ca59b9ab 100644 --- a/cc_bindings_from_rs/test/enums/cpp_enums_cc_api.h +++ b/cc_bindings_from_rs/test/enums/cpp_enums_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // cpp_enums_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_ENUMS_CPP_ENUMS_GOLDEN diff --git a/cc_bindings_from_rs/test/enums/option_cc_api.h b/cc_bindings_from_rs/test/enums/option_cc_api.h index 3a75245db..979e7cc0a 100644 --- a/cc_bindings_from_rs/test/enums/option_cc_api.h +++ b/cc_bindings_from_rs/test/enums/option_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // option_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_ENUMS_OPTION_GOLDEN diff --git a/cc_bindings_from_rs/test/enums/option_cc_api_impl.rs b/cc_bindings_from_rs/test/enums/option_cc_api_impl.rs index c489fc350..cf728bc68 100644 --- a/cc_bindings_from_rs/test/enums/option_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/enums/option_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // option_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/enums/result_cc_api.h b/cc_bindings_from_rs/test/enums/result_cc_api.h index ed4750409..b7b8f18f4 100644 --- a/cc_bindings_from_rs/test/enums/result_cc_api.h +++ b/cc_bindings_from_rs/test/enums/result_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // result_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_ENUMS_RESULT_GOLDEN diff --git a/cc_bindings_from_rs/test/enums/result_cc_api_impl.rs b/cc_bindings_from_rs/test/enums/result_cc_api_impl.rs index f87ffe9fd..6fc6b4371 100644 --- a/cc_bindings_from_rs/test/enums/result_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/enums/result_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // result_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/known_traits/default/default_cc_api.h b/cc_bindings_from_rs/test/known_traits/default/default_cc_api.h index 114293100..e532faf9a 100644 --- a/cc_bindings_from_rs/test/known_traits/default/default_cc_api.h +++ b/cc_bindings_from_rs/test/known_traits/default/default_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // rs_default_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_KNOWN_TRAITS_DEFAULT_RS_DEFAULT_GOLDEN diff --git a/cc_bindings_from_rs/test/known_traits/default/default_cc_api_impl.rs b/cc_bindings_from_rs/test/known_traits/default/default_cc_api_impl.rs index 70caf6282..167671a86 100644 --- a/cc_bindings_from_rs/test/known_traits/default/default_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/known_traits/default/default_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // rs_default_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/known_traits/from/from_cc_api.h b/cc_bindings_from_rs/test/known_traits/from/from_cc_api.h index cebb4011b..23ea0b5bc 100644 --- a/cc_bindings_from_rs/test/known_traits/from/from_cc_api.h +++ b/cc_bindings_from_rs/test/known_traits/from/from_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // from_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_KNOWN_TRAITS_FROM_FROM_GOLDEN diff --git a/cc_bindings_from_rs/test/known_traits/from/from_cc_api_impl.rs b/cc_bindings_from_rs/test/known_traits/from/from_cc_api_impl.rs index f91cc632e..6c5daf17b 100644 --- a/cc_bindings_from_rs/test/known_traits/from/from_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/known_traits/from/from_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // from_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api.h b/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api.h index d3396fbd8..e5e843827 100644 --- a/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api.h +++ b/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // rs_index_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_KNOWN_TRAITS_INDEX_RS_INDEX_GOLDEN diff --git a/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api_impl.rs b/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api_impl.rs index b7a24beb3..e4cfec26e 100644 --- a/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/known_traits/index/rs_index_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // rs_index_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/known_traits/into/into_cc_api.h b/cc_bindings_from_rs/test/known_traits/into/into_cc_api.h index 6484011c0..c3b3a2328 100644 --- a/cc_bindings_from_rs/test/known_traits/into/into_cc_api.h +++ b/cc_bindings_from_rs/test/known_traits/into/into_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // into_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_KNOWN_TRAITS_INTO_INTO_GOLDEN diff --git a/cc_bindings_from_rs/test/known_traits/into/into_cc_api_impl.rs b/cc_bindings_from_rs/test/known_traits/into/into_cc_api_impl.rs index d5cb3a691..6a36c945f 100644 --- a/cc_bindings_from_rs/test/known_traits/into/into_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/known_traits/into/into_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // into_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api.h b/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api.h index df351221c..8611ef7b7 100644 --- a/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api.h +++ b/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // lifetimes_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_LIFETIMES_LIFETIMES_GOLDEN diff --git a/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api_impl.rs b/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api_impl.rs index 9e28060d0..56b7adb3b 100644 --- a/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/lifetimes/lifetimes_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // lifetimes_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/modules/modules_cc_api.h b/cc_bindings_from_rs/test/modules/modules_cc_api.h index 27c3810c5..f37d70dc2 100644 --- a/cc_bindings_from_rs/test/modules/modules_cc_api.h +++ b/cc_bindings_from_rs/test/modules/modules_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // modules_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_MODULES_MODULES_GOLDEN diff --git a/cc_bindings_from_rs/test/modules/modules_cc_api_impl.rs b/cc_bindings_from_rs/test/modules/modules_cc_api_impl.rs index 423592da3..1caeeccb6 100644 --- a/cc_bindings_from_rs/test/modules/modules_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/modules/modules_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // modules_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/move_semantics/move_cc_api.h b/cc_bindings_from_rs/test/move_semantics/move_cc_api.h index 0fcf4de1e..f97b953fa 100644 --- a/cc_bindings_from_rs/test/move_semantics/move_cc_api.h +++ b/cc_bindings_from_rs/test/move_semantics/move_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // move_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_MOVE_SEMANTICS_MOVE_GOLDEN diff --git a/cc_bindings_from_rs/test/move_semantics/move_cc_api_impl.rs b/cc_bindings_from_rs/test/move_semantics/move_cc_api_impl.rs index 2045993e2..678cc798b 100644 --- a/cc_bindings_from_rs/test/move_semantics/move_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/move_semantics/move_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // move_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/never/never_cc_api.h b/cc_bindings_from_rs/test/never/never_cc_api.h index bda1dc04d..41252a984 100644 --- a/cc_bindings_from_rs/test/never/never_cc_api.h +++ b/cc_bindings_from_rs/test/never/never_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // never_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_NEVER_NEVER_GOLDEN diff --git a/cc_bindings_from_rs/test/never/never_cc_api_impl.rs b/cc_bindings_from_rs/test/never/never_cc_api_impl.rs index 8d90bd07b..bdabb510e 100644 --- a/cc_bindings_from_rs/test/never/never_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/never/never_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // never_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/no_std/no_core_cc_api.h b/cc_bindings_from_rs/test/no_std/no_core_cc_api.h index 6e32407ef..1d7759b28 100644 --- a/cc_bindings_from_rs/test/no_std/no_core_cc_api.h +++ b/cc_bindings_from_rs/test/no_std/no_core_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // no_core_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_NO_STD_NO_CORE_GOLDEN diff --git a/cc_bindings_from_rs/test/no_std/no_core_cc_api_impl.rs b/cc_bindings_from_rs/test/no_std/no_core_cc_api_impl.rs index 1ff29a707..63b58199a 100644 --- a/cc_bindings_from_rs/test/no_std/no_core_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/no_std/no_core_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // no_core_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/no_std/no_std_cc_api.h b/cc_bindings_from_rs/test/no_std/no_std_cc_api.h index e178b442b..286a01246 100644 --- a/cc_bindings_from_rs/test/no_std/no_std_cc_api.h +++ b/cc_bindings_from_rs/test/no_std/no_std_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // no_std_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_NO_STD_NO_STD_GOLDEN diff --git a/cc_bindings_from_rs/test/no_std/no_std_cc_api_impl.rs b/cc_bindings_from_rs/test/no_std/no_std_cc_api_impl.rs index 3364abecd..d8391e707 100644 --- a/cc_bindings_from_rs/test/no_std/no_std_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/no_std/no_std_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // no_std_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api.h b/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api.h index fe6b1bd32..a12b3aae3 100644 --- a/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api.h +++ b/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // pass_by_value_unmovable_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_PASS_BY_VALUE_UNMOVABLE_PASS_BY_VALUE_UNMOVABLE_GOLDEN diff --git a/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api_impl.rs b/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api_impl.rs index 56bec87e0..c5e4b2968 100644 --- a/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/pass_by_value_unmovable/pass_by_value_unmovable_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // pass_by_value_unmovable_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/str/str_cc_api.h b/cc_bindings_from_rs/test/str/str_cc_api.h index 6f31a53c3..b293664e9 100644 --- a/cc_bindings_from_rs/test/str/str_cc_api.h +++ b/cc_bindings_from_rs/test/str/str_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // str_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_STR_STR_GOLDEN diff --git a/cc_bindings_from_rs/test/str/str_cc_api_impl.rs b/cc_bindings_from_rs/test/str/str_cc_api_impl.rs index 510f5ffd5..afd2149da 100644 --- a/cc_bindings_from_rs/test/str/str_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/str/str_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // str_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/structs/structs_cc_api.h b/cc_bindings_from_rs/test/structs/structs_cc_api.h index b6a8eac03..ea1f20c38 100644 --- a/cc_bindings_from_rs/test/structs/structs_cc_api.h +++ b/cc_bindings_from_rs/test/structs/structs_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // structs_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_STRUCTS_STRUCTS_GOLDEN diff --git a/cc_bindings_from_rs/test/structs/structs_cc_api_impl.rs b/cc_bindings_from_rs/test/structs/structs_cc_api_impl.rs index f6ca276d7..bd40401ac 100644 --- a/cc_bindings_from_rs/test/structs/structs_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/structs/structs_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // structs_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api.h b/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api.h index 73b4c5f2f..b40bcc36c 100644 --- a/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api.h +++ b/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // tuple_structs_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_STRUCTS_TUPLE_STRUCTS_TUPLE_STRUCTS_GOLDEN diff --git a/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api_impl.rs b/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api_impl.rs index 4f13157f0..b0f05fd65 100644 --- a/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/structs/tuple_structs/tuple_structs_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // tuple_structs_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api.h b/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api.h index ebbb0a607..9ae3713d8 100644 --- a/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api.h +++ b/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // unit_structs_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_STRUCTS_UNIT_STRUCTS_UNIT_STRUCTS_GOLDEN diff --git a/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api_impl.rs b/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api_impl.rs index 29ae6590f..38f25bb99 100644 --- a/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/structs/unit_structs/unit_structs_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // unit_structs_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api.h b/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api.h index cfd9c39db..a13235a7e 100644 --- a/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api.h +++ b/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // trait_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_TRAITS_FOR_CC_TYPE_TRAIT_GOLDEN diff --git a/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api_impl.rs b/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api_impl.rs index fcf2b11ab..31d82ed65 100644 --- a/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/traits/for_cc_type/trait_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // trait_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api.h b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api.h index f809e9331..99c9172ab 100644 --- a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api.h +++ b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // trait_definition_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_TRAITS_IN_DEPENDENT_CRATE_TRAIT_DEFINITION_GOLDEN diff --git a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api_impl.rs b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api_impl.rs index 7ece893c4..c1c036f2e 100644 --- a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_definition_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // trait_definition_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api.h b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api.h index d47e5b954..eceb56763 100644 --- a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api.h +++ b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // trait_impl_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_TRAITS_IN_DEPENDENT_CRATE_TRAIT_IMPL_GOLDEN diff --git a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api_impl.rs b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api_impl.rs index 0dcbaad1e..e87435dbf 100644 --- a/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/traits/in_dependent_crate/trait_impl_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // trait_impl_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api.h b/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api.h index b8f562783..48d167ddc 100644 --- a/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api.h +++ b/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // stdlib_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_TRAITS_STDLIB_STDLIB_GOLDEN diff --git a/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api_impl.rs b/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api_impl.rs index abd916d1a..43bef5fda 100644 --- a/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/traits/stdlib/stdlib_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // stdlib_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/unions/unions_cc_api.h b/cc_bindings_from_rs/test/unions/unions_cc_api.h index fb636ad9c..9ca1ba58d 100644 --- a/cc_bindings_from_rs/test/unions/unions_cc_api.h +++ b/cc_bindings_from_rs/test/unions/unions_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // unions_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_UNIONS_UNIONS_GOLDEN diff --git a/cc_bindings_from_rs/test/unions/unions_cc_api_impl.rs b/cc_bindings_from_rs/test/unions/unions_cc_api_impl.rs index e23bcfb02..8f074d886 100644 --- a/cc_bindings_from_rs/test/unions/unions_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/unions/unions_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // unions_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api.h b/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api.h index 7b06cacbb..1cfc87915 100644 --- a/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api.h +++ b/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // transitive_reexports_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_USES_TRASITIVE_REEXPORTS_TRANSITIVE_REEXPORTS_GOLDEN diff --git a/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api_impl.rs b/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api_impl.rs index fced24511..e3a9b706a 100644 --- a/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/uses/trasitive_reexports/transitive_reexports_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // transitive_reexports_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/cc_bindings_from_rs/test/uses/uses_cc_api.h b/cc_bindings_from_rs/test/uses/uses_cc_api.h index 4e2f30aad..aabc08069 100644 --- a/cc_bindings_from_rs/test/uses/uses_cc_api.h +++ b/cc_bindings_from_rs/test/uses/uses_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // uses_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_CC_BINDINGS_FROM_RS_TEST_USES_USES_GOLDEN diff --git a/cc_bindings_from_rs/test/uses/uses_cc_api_impl.rs b/cc_bindings_from_rs/test/uses/uses_cc_api_impl.rs index 995b58048..585a570e7 100644 --- a/cc_bindings_from_rs/test/uses/uses_cc_api_impl.rs +++ b/cc_bindings_from_rs/test/uses/uses_cc_api_impl.rs @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // uses_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![allow(unused_unsafe, deprecated, non_snake_case, unreachable_code)] #![allow(improper_ctypes_definitions)] diff --git a/common/test/bidirectional_deps/leaf_rs_lib_cc_api.h b/common/test/bidirectional_deps/leaf_rs_lib_cc_api.h index e8f73faf6..6087df6a2 100644 --- a/common/test/bidirectional_deps/leaf_rs_lib_cc_api.h +++ b/common/test/bidirectional_deps/leaf_rs_lib_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // leaf_rs_lib_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_COMMON_TEST_BIDIRECTIONAL_DEPS_LEAF_RS_LIB_GOLDEN diff --git a/examples/cpp/enum/example_generated.rs b/examples/cpp/enum/example_generated.rs index fe35d93d2..78a12c9aa 100644 --- a/examples/cpp/enum/example_generated.rs +++ b/examples/cpp/enum/example_generated.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //examples/cpp/enum:example_lib -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] @@ -18,7 +18,7 @@ /// Generated from: examples/cpp/enum/example.h;l=8 #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=Color +///CRUBIT_ANNOTATE: cpp_type=:: Color pub struct Color(::ffi_11::c_uint); impl Color { pub const kRed: Color = Color(::ffi_11::new_c_uint(0)); diff --git a/examples/cpp/function/example_generated.rs b/examples/cpp/function/example_generated.rs index 068b0caf5..f2e00295c 100644 --- a/examples/cpp/function/example_generated.rs +++ b/examples/cpp/function/example_generated.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //examples/cpp/function:example_lib -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] diff --git a/examples/cpp/method/example_generated.rs b/examples/cpp/method/example_generated.rs index ec8c41558..2dc74310d 100644 --- a/examples/cpp/method/example_generated.rs +++ b/examples/cpp/method/example_generated.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //examples/cpp/method:example_lib -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -19,14 +19,14 @@ pub mod foo { /// Generated from: examples/cpp/method/example.h;l=12 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=foo :: Bar + ///CRUBIT_ANNOTATE: cpp_type=:: foo :: Bar pub struct Bar { pub x: ::ffi_11::c_int, } impl !Send for Bar {} impl !Sync for Bar {} unsafe impl ::cxx::ExternType for Bar { - type Id = ::cxx::type_id!("foo :: Bar"); + type Id = ::cxx::type_id!(":: foo :: Bar"); type Kind = ::cxx::kind::Trivial; } impl Bar { diff --git a/examples/cpp/trivial_abi_struct/example_generated.rs b/examples/cpp/trivial_abi_struct/example_generated.rs index 634f61f00..c4175b5e2 100644 --- a/examples/cpp/trivial_abi_struct/example_generated.rs +++ b/examples/cpp/trivial_abi_struct/example_generated.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //examples/cpp/trivial_abi_struct:example_lib -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -21,7 +21,7 @@ /// Generated from: examples/cpp/trivial_abi_struct/example.h;l=12 #[derive(Clone)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Position +///CRUBIT_ANNOTATE: cpp_type=:: Position pub struct Position { pub x: ::ffi_11::c_int, pub y: ::ffi_11::c_int, @@ -29,7 +29,7 @@ pub struct Position { impl !Send for Position {} impl !Sync for Position {} unsafe impl ::cxx::ExternType for Position { - type Id = ::cxx::type_id!("Position"); + type Id = ::cxx::type_id!(":: Position"); type Kind = ::cxx::kind::Trivial; } diff --git a/examples/cpp/trivial_struct/example_generated.rs b/examples/cpp/trivial_struct/example_generated.rs index 932e24ded..d99ac6716 100644 --- a/examples/cpp/trivial_struct/example_generated.rs +++ b/examples/cpp/trivial_struct/example_generated.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //examples/cpp/trivial_struct:example_lib -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -18,7 +18,7 @@ /// Generated from: examples/cpp/trivial_struct/example.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Position +///CRUBIT_ANNOTATE: cpp_type=:: Position pub struct Position { pub x: ::ffi_11::c_int, pub y: ::ffi_11::c_int, @@ -26,7 +26,7 @@ pub struct Position { impl !Send for Position {} impl !Sync for Position {} unsafe impl ::cxx::ExternType for Position { - type Id = ::cxx::type_id!("Position"); + type Id = ::cxx::type_id!(":: Position"); type Kind = ::cxx::kind::Trivial; } diff --git a/examples/cpp/unsafe_attributes/example_generated.rs b/examples/cpp/unsafe_attributes/example_generated.rs index 94dec8d7c..9618f7095 100644 --- a/examples/cpp/unsafe_attributes/example_generated.rs +++ b/examples/cpp/unsafe_attributes/example_generated.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //examples/cpp/unsafe_attributes:example_lib -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] diff --git a/examples/cpp/virtual/example_generated.rs b/examples/cpp/virtual/example_generated.rs index 16417a6d8..b185c53e0 100644 --- a/examples/cpp/virtual/example_generated.rs +++ b/examples/cpp/virtual/example_generated.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //examples/cpp/virtual:example_lib -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, impl_trait_in_assoc_type, negative_impls)] @@ -18,7 +18,7 @@ /// Generated from: examples/cpp/virtual/example.h;l=13 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=RustDerived +///CRUBIT_ANNOTATE: cpp_type=:: RustDerived pub struct RustDerived { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], /// Reason for representing this field as a blob of bytes: @@ -28,7 +28,7 @@ pub struct RustDerived { impl !Send for RustDerived {} impl !Sync for RustDerived {} unsafe impl ::cxx::ExternType for RustDerived { - type Id = ::cxx::type_id!("RustDerived"); + type Id = ::cxx::type_id!(":: RustDerived"); type Kind = ::cxx::kind::Opaque; } impl RustDerived { diff --git a/examples/rust/cpp_enum/example_generated.h b/examples/rust/cpp_enum/example_generated.h index a038158bc..d9fd5d2d6 100644 --- a/examples/rust/cpp_enum/example_generated.h +++ b/examples/rust/cpp_enum/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_CPP_ENUM_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/enum/example_generated.h b/examples/rust/enum/example_generated.h index 618255ad7..d5dad5160 100644 --- a/examples/rust/enum/example_generated.h +++ b/examples/rust/enum/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_ENUM_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/enum_with_payload/example_generated.h b/examples/rust/enum_with_payload/example_generated.h index 9d19e39c3..7623f0e27 100644 --- a/examples/rust/enum_with_payload/example_generated.h +++ b/examples/rust/enum_with_payload/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_ENUM_WITH_PAYLOAD_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/function/example_generated.h b/examples/rust/function/example_generated.h index 766ba8259..48f9a4adf 100644 --- a/examples/rust/function/example_generated.h +++ b/examples/rust/function/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_FUNCTION_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/library_config/example_generated.h b/examples/rust/library_config/example_generated.h index 2ca45b559..bc44a757a 100644 --- a/examples/rust/library_config/example_generated.h +++ b/examples/rust/library_config/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_LIBRARY_CONFIG_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/non_trivial_struct/example_generated.h b/examples/rust/non_trivial_struct/example_generated.h index 8223ff723..9c23c8a8e 100644 --- a/examples/rust/non_trivial_struct/example_generated.h +++ b/examples/rust/non_trivial_struct/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_NON_TRIVIAL_STRUCT_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/rust_union/example_generated.h b/examples/rust/rust_union/example_generated.h index 058e394e7..9a7986fe1 100644 --- a/examples/rust/rust_union/example_generated.h +++ b/examples/rust/rust_union/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_RUST_UNION_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/struct/example_generated.h b/examples/rust/struct/example_generated.h index 5473624bd..47d9988b5 100644 --- a/examples/rust/struct/example_generated.h +++ b/examples/rust/struct/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_STRUCT_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/trait/example_generated.h b/examples/rust/trait/example_generated.h index 6458a3dad..d07ff3743 100644 --- a/examples/rust/trait/example_generated.h +++ b/examples/rust/trait/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_TRAIT_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/type_alias/example_generated.h b/examples/rust/type_alias/example_generated.h index 3b0a52178..16eef9df8 100644 --- a/examples/rust/type_alias/example_generated.h +++ b/examples/rust/type_alias/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_TYPE_ALIAS_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/union/example_generated.h b/examples/rust/union/example_generated.h index b95181893..7fc4a7bf1 100644 --- a/examples/rust/union/example_generated.h +++ b/examples/rust/union/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_UNION_EXAMPLE_CRATE_GOLDEN diff --git a/examples/rust/use_declaration/example_generated.h b/examples/rust/use_declaration/example_generated.h index 5f5a7132b..e561dfdc6 100644 --- a/examples/rust/use_declaration/example_generated.h +++ b/examples/rust/use_declaration/example_generated.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // example_crate_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_EXAMPLES_RUST_USE_DECLARATION_EXAMPLE_CRATE_GOLDEN diff --git a/features/global_features.bzl b/features/global_features.bzl index 16ec7d20f..5c30af8dc 100644 --- a/features/global_features.bzl +++ b/features/global_features.bzl @@ -8,5 +8,6 @@ visibility(["//..."]) SUPPORTED_FEATURES = [ "supported", + "leading_colons_for_cpp_type", "fmt", ] diff --git a/rs_bindings_from_cc/test/annotations/do_not_bind_api_impl.cc b/rs_bindings_from_cc/test/annotations/do_not_bind_api_impl.cc index 5bc2d0267..e2b6c380c 100644 --- a/rs_bindings_from_cc/test/annotations/do_not_bind_api_impl.cc +++ b/rs_bindings_from_cc/test/annotations/do_not_bind_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:do_not_bind -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,59 +19,60 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct crubit::test::ArgumentToBoundOverload) == 1); -static_assert(alignof(struct crubit::test::ArgumentToBoundOverload) == 1); +static_assert(sizeof(struct ::crubit::test::ArgumentToBoundOverload) == 1); +static_assert(alignof(struct ::crubit::test::ArgumentToBoundOverload) == 1); extern "C" void __rust_thunk___ZN6crubit4test23ArgumentToBoundOverloadC1Ev( - struct crubit::test::ArgumentToBoundOverload* __this) { + struct ::crubit::test::ArgumentToBoundOverload* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct crubit::test::ArgumentToUnboundOverload) == 1); -static_assert(alignof(struct crubit::test::ArgumentToUnboundOverload) == 1); +static_assert(sizeof(struct ::crubit::test::ArgumentToUnboundOverload) == 1); +static_assert(alignof(struct ::crubit::test::ArgumentToUnboundOverload) == 1); extern "C" void __rust_thunk___ZN6crubit4test25ArgumentToUnboundOverloadC1Ev( - struct crubit::test::ArgumentToUnboundOverload* __this) { + struct ::crubit::test::ArgumentToUnboundOverload* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN6crubit4test11DoNotBindFnENS0_23ArgumentToBoundOverloadE( - struct crubit::test::ArgumentToBoundOverload* __param_0) { - crubit::test::DoNotBindFn(std::move(*__param_0)); + struct ::crubit::test::ArgumentToBoundOverload* __param_0) { + ::crubit::test::DoNotBindFn(std::move(*__param_0)); } -static_assert((void (*)(struct crubit::test::ArgumentToBoundOverload)) & +static_assert((void (*)(struct ::crubit::test::ArgumentToBoundOverload)) & ::crubit::test::DoNotBindFn); -static_assert(sizeof(struct crubit::test::StructWithDoNotBindConstructor) == 1); -static_assert(alignof(struct crubit::test::StructWithDoNotBindConstructor) == +static_assert(sizeof(struct ::crubit::test::StructWithDoNotBindConstructor) == + 1); +static_assert(alignof(struct ::crubit::test::StructWithDoNotBindConstructor) == 1); extern "C" void __rust_thunk___ZN6crubit4test30StructWithDoNotBindConstructorC1ENS0_23ArgumentToBoundOverloadE( - struct crubit::test::StructWithDoNotBindConstructor* __this, - struct crubit::test::ArgumentToBoundOverload* __param_0) { + struct ::crubit::test::StructWithDoNotBindConstructor* __this, + struct ::crubit::test::ArgumentToBoundOverload* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } -static_assert(sizeof(struct crubit::test::StructWithDoNotBindMethod) == 1); -static_assert(alignof(struct crubit::test::StructWithDoNotBindMethod) == 1); +static_assert(sizeof(struct ::crubit::test::StructWithDoNotBindMethod) == 1); +static_assert(alignof(struct ::crubit::test::StructWithDoNotBindMethod) == 1); extern "C" void __rust_thunk___ZN6crubit4test25StructWithDoNotBindMethodC1Ev( - struct crubit::test::StructWithDoNotBindMethod* __this) { + struct ::crubit::test::StructWithDoNotBindMethod* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN6crubit4test25StructWithDoNotBindMethod15DoNotBindMethodENS0_23ArgumentToBoundOverloadE( - struct crubit::test::StructWithDoNotBindMethod* __this, - struct crubit::test::ArgumentToBoundOverload* __param_0) { + struct ::crubit::test::StructWithDoNotBindMethod* __this, + struct ::crubit::test::ArgumentToBoundOverload* __param_0) { __this->DoNotBindMethod(std::move(*__param_0)); } static_assert((void (::crubit::test::StructWithDoNotBindMethod::*)( - struct crubit::test::ArgumentToBoundOverload)) & + struct ::crubit::test::ArgumentToBoundOverload)) & ::crubit::test::StructWithDoNotBindMethod::DoNotBindMethod); #pragma clang diagnostic pop 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 e61c6115f..81a1a29a4 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:do_not_bind -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -20,14 +20,14 @@ pub mod crubit { /// Generated from: rs_bindings_from_cc/test/annotations/do_not_bind.h;l=12 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: ArgumentToBoundOverload + ///CRUBIT_ANNOTATE: cpp_type=:: crubit :: test :: ArgumentToBoundOverload pub struct ArgumentToBoundOverload { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for ArgumentToBoundOverload {} impl !Sync for ArgumentToBoundOverload {} unsafe impl ::cxx::ExternType for ArgumentToBoundOverload { - type Id = ::cxx::type_id!("crubit :: test :: ArgumentToBoundOverload"); + type Id = ::cxx::type_id!(":: crubit :: test :: ArgumentToBoundOverload"); type Kind = ::cxx::kind::Trivial; } @@ -48,14 +48,14 @@ pub mod crubit { /// Generated from: rs_bindings_from_cc/test/annotations/do_not_bind.h;l=13 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: ArgumentToUnboundOverload + ///CRUBIT_ANNOTATE: cpp_type=:: crubit :: test :: ArgumentToUnboundOverload pub struct ArgumentToUnboundOverload { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for ArgumentToUnboundOverload {} impl !Sync for ArgumentToUnboundOverload {} unsafe impl ::cxx::ExternType for ArgumentToUnboundOverload { - type Id = ::cxx::type_id!("crubit :: test :: ArgumentToUnboundOverload"); + type Id = ::cxx::type_id!(":: crubit :: test :: ArgumentToUnboundOverload"); type Kind = ::cxx::kind::Trivial; } @@ -88,14 +88,14 @@ pub mod crubit { /// Generated from: rs_bindings_from_cc/test/annotations/do_not_bind.h;l=28 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: StructWithDoNotBindConstructor + ///CRUBIT_ANNOTATE: cpp_type=:: crubit :: test :: StructWithDoNotBindConstructor pub struct StructWithDoNotBindConstructor { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for StructWithDoNotBindConstructor {} impl !Sync for StructWithDoNotBindConstructor {} unsafe impl ::cxx::ExternType for StructWithDoNotBindConstructor { - type Id = ::cxx::type_id!("crubit :: test :: StructWithDoNotBindConstructor"); + type Id = ::cxx::type_id!(":: crubit :: test :: StructWithDoNotBindConstructor"); type Kind = ::cxx::kind::Trivial; } @@ -125,14 +125,14 @@ pub mod crubit { /// Generated from: rs_bindings_from_cc/test/annotations/do_not_bind.h;l=34 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: StructWithDoNotBindMethod + ///CRUBIT_ANNOTATE: cpp_type=:: crubit :: test :: StructWithDoNotBindMethod pub struct StructWithDoNotBindMethod { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for StructWithDoNotBindMethod {} impl !Sync for StructWithDoNotBindMethod {} unsafe impl ::cxx::ExternType for StructWithDoNotBindMethod { - type Id = ::cxx::type_id!("crubit :: test :: StructWithDoNotBindMethod"); + type Id = ::cxx::type_id!(":: crubit :: test :: StructWithDoNotBindMethod"); type Kind = ::cxx::kind::Trivial; } impl StructWithDoNotBindMethod { diff --git a/rs_bindings_from_cc/test/annotations/owned_ptr_api_impl.cc b/rs_bindings_from_cc/test/annotations/owned_ptr_api_impl.cc index 84f091703..728292b7c 100644 --- a/rs_bindings_from_cc/test/annotations/owned_ptr_api_impl.cc +++ b/rs_bindings_from_cc/test/annotations/owned_ptr_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:owned_ptr -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,16 +19,16 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct Thing) == 4); -static_assert(alignof(struct Thing) == 4); -static_assert(CRUBIT_OFFSET_OF(value, struct Thing) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Thing) == 4); +static_assert(alignof(struct ::Thing) == 4); +static_assert(CRUBIT_OFFSET_OF(value, struct ::Thing) == 0); -extern "C" void __rust_thunk___ZN5ThingC1Ei(struct Thing* __this, +extern "C" void __rust_thunk___ZN5ThingC1Ei(struct ::Thing* __this, int32_t value) { crubit::construct_at(__this, value); } -extern "C" void __rust_thunk___ZN5Thing5CloseEv(struct Thing* __this) { +extern "C" void __rust_thunk___ZN5Thing5CloseEv(struct ::Thing* __this) { __this->Close(); } 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 1e19b6109..739722edb 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:owned_ptr -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -24,7 +24,7 @@ /// Generated from: rs_bindings_from_cc/test/annotations/owned_ptr.h;l=17 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Thing +///CRUBIT_ANNOTATE: cpp_type=:: Thing pub struct RawThing { __non_field_data: [::core::mem::MaybeUninit; 0], pub value: i32, @@ -32,7 +32,7 @@ pub struct RawThing { impl !Send for RawThing {} impl !Sync for RawThing {} unsafe impl ::cxx::ExternType for RawThing { - type Id = ::cxx::type_id!("Thing"); + type Id = ::cxx::type_id!(":: Thing"); type Kind = ::cxx::kind::Trivial; } impl RawThing { diff --git a/rs_bindings_from_cc/test/annotations/owned_ptr_user_api_impl.cc b/rs_bindings_from_cc/test/annotations/owned_ptr_user_api_impl.cc index c0cbf82eb..a9160afc5 100644 --- a/rs_bindings_from_cc/test/annotations/owned_ptr_user_api_impl.cc +++ b/rs_bindings_from_cc/test/annotations/owned_ptr_user_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:owned_ptr_user -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,12 +19,12 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert((struct Thing * (*)(int)) & ::MakeOwnedThing); +static_assert((struct ::Thing * (*)(int)) & ::MakeOwnedThing); -static_assert((struct Thing * (*)(int)) & ::MakeThing); +static_assert((struct ::Thing * (*)(int)) & ::MakeThing); -static_assert((int (*)(struct Thing*)) & ::ThingToValue); +static_assert((int (*)(struct ::Thing*)) & ::ThingToValue); -static_assert((int (*)(struct Thing*)) & ::GetThingValue); +static_assert((int (*)(struct ::Thing*)) & ::GetThingValue); #pragma clang diagnostic pop 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 9ac83d367..6f87841c8 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:owned_ptr_user -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] diff --git a/rs_bindings_from_cc/test/annotations/rust_name_api_impl.cc b/rs_bindings_from_cc/test/annotations/rust_name_api_impl.cc index 98bbf82fd..971520dbb 100644 --- a/rs_bindings_from_cc/test/annotations/rust_name_api_impl.cc +++ b/rs_bindings_from_cc/test/annotations/rust_name_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:rust_name -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -20,36 +20,36 @@ #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" void __rust_thunk___ZN6crubit4test13FreeFnOldNameEv() { - crubit::test::FreeFnOldName(); + ::crubit::test::FreeFnOldName(); } static_assert((void (*)()) & ::crubit::test::FreeFnOldName); -static_assert(sizeof(struct crubit::test::StructOldName) == 1); -static_assert(alignof(struct crubit::test::StructOldName) == 1); +static_assert(sizeof(struct ::crubit::test::StructOldName) == 1); +static_assert(alignof(struct ::crubit::test::StructOldName) == 1); extern "C" void __rust_thunk___ZN6crubit4test13StructOldNameC1Ev( - struct crubit::test::StructOldName* __this) { + struct ::crubit::test::StructOldName* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct crubit::test::SomeStruct) == 4); -static_assert(alignof(struct crubit::test::SomeStruct) == 4); +static_assert(CRUBIT_SIZEOF(struct ::crubit::test::SomeStruct) == 4); +static_assert(alignof(struct ::crubit::test::SomeStruct) == 4); static_assert(CRUBIT_OFFSET_OF(field_old_name, - struct crubit::test::SomeStruct) == 0); + struct ::crubit::test::SomeStruct) == 0); extern "C" void __rust_thunk___ZN6crubit4test10SomeStructC1Ev( - struct crubit::test::SomeStruct* __this) { + struct ::crubit::test::SomeStruct* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN6crubit4test10SomeStructC1Eiii( - struct crubit::test::SomeStruct* __this, int a, int b, int c) { + struct ::crubit::test::SomeStruct* __this, int a, int b, int c) { crubit::construct_at(__this, a, b, c); } extern "C" void __rust_thunk___ZNK6crubit4test10SomeStruct13MethodOldNameEv( - struct crubit::test::SomeStruct const* __this) { + struct ::crubit::test::SomeStruct const* __this) { __this->MethodOldName(); } 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 0dda5a8c4..5b310575b 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/annotations:rust_name -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -26,14 +26,14 @@ pub mod crubit { /// Generated from: rs_bindings_from_cc/test/annotations/rust_name.h;l=15 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: StructOldName + ///CRUBIT_ANNOTATE: cpp_type=:: crubit :: test :: StructOldName pub struct StructNewName { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for StructNewName {} impl !Sync for StructNewName {} unsafe impl ::cxx::ExternType for StructNewName { - type Id = ::cxx::type_id!("crubit :: test :: StructOldName"); + type Id = ::cxx::type_id!(":: crubit :: test :: StructOldName"); type Kind = ::cxx::kind::Trivial; } @@ -54,7 +54,7 @@ pub mod crubit { /// Generated from: rs_bindings_from_cc/test/annotations/rust_name.h;l=17 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=crubit :: test :: SomeStruct + ///CRUBIT_ANNOTATE: cpp_type=:: crubit :: test :: SomeStruct pub struct SomeStruct { __non_field_data: [::core::mem::MaybeUninit; 0], pub field_new_name: ::ffi_11::c_int, @@ -62,7 +62,7 @@ pub mod crubit { impl !Send for SomeStruct {} impl !Sync for SomeStruct {} unsafe impl ::cxx::ExternType for SomeStruct { - type Id = ::cxx::type_id!("crubit :: test :: SomeStruct"); + type Id = ::cxx::type_id!(":: crubit :: test :: SomeStruct"); type Kind = ::cxx::kind::Trivial; } impl SomeStruct { diff --git a/rs_bindings_from_cc/test/assume_lifetimes/free_function_api_impl.cc b/rs_bindings_from_cc/test/assume_lifetimes/free_function_api_impl.cc index b5809ee56..def66e304 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/free_function_api_impl.cc +++ b/rs_bindings_from_cc/test/assume_lifetimes/free_function_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:free_function -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" 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 65c1b5e9e..c3ed6ae1c 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:free_function -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] diff --git a/rs_bindings_from_cc/test/assume_lifetimes/member_function_api_impl.cc b/rs_bindings_from_cc/test/assume_lifetimes/member_function_api_impl.cc index 5b2672a3c..b5dd9e66d 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/member_function_api_impl.cc +++ b/rs_bindings_from_cc/test/assume_lifetimes/member_function_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:member_function -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,25 +19,25 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct S) == 4); -static_assert(alignof(struct S) == 4); -static_assert(CRUBIT_OFFSET_OF(int_field, struct S) == 0); +static_assert(CRUBIT_SIZEOF(struct ::S) == 4); +static_assert(alignof(struct ::S) == 4); +static_assert(CRUBIT_OFFSET_OF(int_field, struct ::S) == 0); -extern "C" void __rust_thunk___ZN1SC1Ev(struct S* __this) { +extern "C" void __rust_thunk___ZN1SC1Ev(struct ::S* __this) { crubit::construct_at(__this); } extern "C" int const* __rust_thunk___ZNK1S12int_accessorEv( - struct S const* __this) { + struct ::S const* __this) { return std::addressof(__this->int_accessor()); } static_assert((int const& (::S::*)() const) & ::S::int_accessor); -extern "C" struct S* __rust_thunk___ZN1S2meEv(struct S* __this) { +extern "C" struct ::S* __rust_thunk___ZN1S2meEv(struct ::S* __this) { return std::addressof(__this->me()); } -static_assert((struct S & (::S::*)()) & ::S::me); +static_assert((struct ::S & (::S::*)()) & ::S::me); #pragma clang diagnostic pop 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 687b8f97c..b4242a610 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:member_function -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -18,14 +18,14 @@ /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/member_function.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=S +///CRUBIT_ANNOTATE: cpp_type=:: S pub struct S { pub int_field: ::ffi_11::c_int, } impl !Send for S {} impl !Sync for S {} unsafe impl ::cxx::ExternType for S { - type Id = ::cxx::type_id!("S"); + type Id = ::cxx::type_id!(":: S"); type Kind = ::cxx::kind::Trivial; } impl S { diff --git a/rs_bindings_from_cc/test/assume_lifetimes/string_view_api_impl.cc b/rs_bindings_from_cc/test/assume_lifetimes/string_view_api_impl.cc index ee84cfe4e..97ff3cdb4 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/string_view_api_impl.cc +++ b/rs_bindings_from_cc/test/assume_lifetimes/string_view_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:string_view -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -22,7 +22,7 @@ extern "C" void __rust_thunk___Z16string_view_sinkNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEE( ::std::__u::string_view* s) { - string_view_sink(std::move(*s)); + ::string_view_sink(std::move(*s)); } static_assert((void (*)(::std::__u::string_view)) & ::string_view_sink); @@ -30,7 +30,7 @@ static_assert((void (*)(::std::__u::string_view)) & ::string_view_sink); extern "C" void __rust_thunk___Z18string_view_returnNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEE( ::std::__u::string_view* __return, ::std::__u::string_view* s) { - new (__return) auto(string_view_return(std::move(*s))); + new (__return) auto(::string_view_return(std::move(*s))); } static_assert((::std::__u::string_view (*)(::std::__u::string_view)) & @@ -41,7 +41,7 @@ __rust_thunk___Z28ambiguous_string_view_returnNSt3__u17basic_string_viewIcNS_11c ::std::__u::string_view* __return, ::std::__u::string_view* a, ::std::__u::string_view* b) { new (__return) auto( - ambiguous_string_view_return(std::move(*a), std::move(*b))); + ::ambiguous_string_view_return(std::move(*a), std::move(*b))); } static_assert((::std::__u::string_view (*)(::std::__u::string_view, @@ -51,7 +51,7 @@ static_assert((::std::__u::string_view (*)(::std::__u::string_view, extern "C" void __rust_thunk___Z29explicit_lifetime_string_viewNSt3__u17basic_string_viewIcNS_11char_traitsIcEEEE( ::std::__u::string_view* x) { - explicit_lifetime_string_view(std::move(*x)); + ::explicit_lifetime_string_view(std::move(*x)); } static_assert((void (*)(::std::__u::string_view)) & @@ -62,7 +62,7 @@ __rust_thunk___Z40unambiguous_string_view_return_annotatedNSt3__u17basic_string_ ::std::__u::string_view* __return, ::std::__u::string_view* x, ::std::__u::string_view* y) { new (__return) auto( - unambiguous_string_view_return_annotated(std::move(*x), std::move(*y))); + ::unambiguous_string_view_return_annotated(std::move(*x), std::move(*y))); } static_assert((::std::__u::string_view (*)(::std::__u::string_view, 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 2d3618bff..dc74bc6cf 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:string_view -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] diff --git a/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_api_impl.cc b/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_api_impl.cc index 58210ad0c..03594bab1 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_api_impl.cc +++ b/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:struct_with_lifetimebound -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,285 +19,288 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct PlainStruct) == 1); -static_assert(alignof(struct PlainStruct) == 1); +static_assert(sizeof(struct ::PlainStruct) == 1); +static_assert(alignof(struct ::PlainStruct) == 1); -extern "C" void __rust_thunk___ZN11PlainStructC1Ev(struct PlainStruct* __this) { +extern "C" void __rust_thunk___ZN11PlainStructC1Ev( + struct ::PlainStruct* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct StructWithLifetimeboundMemberFunction) == 1); -static_assert(alignof(struct StructWithLifetimeboundMemberFunction) == 1); +static_assert(sizeof(struct ::StructWithLifetimeboundMemberFunction) == 1); +static_assert(alignof(struct ::StructWithLifetimeboundMemberFunction) == 1); extern "C" void __rust_thunk___ZN37StructWithLifetimeboundMemberFunctionC1Ev( - struct StructWithLifetimeboundMemberFunction* __this) { + struct ::StructWithLifetimeboundMemberFunction* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZNK37StructWithLifetimeboundMemberFunction1fEv( - struct PlainStruct* __return, - struct StructWithLifetimeboundMemberFunction const* __this) { + struct ::PlainStruct* __return, + struct ::StructWithLifetimeboundMemberFunction const* __this) { new (__return) auto(__this->f()); } -static_assert((struct PlainStruct const ( +static_assert((struct ::PlainStruct const ( ::StructWithLifetimeboundMemberFunction::*)() const) & ::StructWithLifetimeboundMemberFunction::f); -static_assert(sizeof(struct StructWithLifetimeboundRefMemberFunction) == 1); -static_assert(alignof(struct StructWithLifetimeboundRefMemberFunction) == 1); +static_assert(sizeof(struct ::StructWithLifetimeboundRefMemberFunction) == 1); +static_assert(alignof(struct ::StructWithLifetimeboundRefMemberFunction) == 1); extern "C" void __rust_thunk___ZN40StructWithLifetimeboundRefMemberFunctionC1Ev( - struct StructWithLifetimeboundRefMemberFunction* __this) { + struct ::StructWithLifetimeboundRefMemberFunction* __this) { crubit::construct_at(__this); } -static_assert((struct PlainStruct const& ( +static_assert((struct ::PlainStruct const& ( ::StructWithLifetimeboundRefMemberFunction::*)() const) & ::StructWithLifetimeboundRefMemberFunction::f); -static_assert(sizeof(class DropClassWithLifetimeboundMemberFunction) == 1); -static_assert(alignof(class DropClassWithLifetimeboundMemberFunction) == 1); +static_assert(sizeof(class ::DropClassWithLifetimeboundMemberFunction) == 1); +static_assert(alignof(class ::DropClassWithLifetimeboundMemberFunction) == 1); extern "C" void __rust_thunk___ZN40DropClassWithLifetimeboundMemberFunctionC1Ev( - class DropClassWithLifetimeboundMemberFunction* __this) { + class ::DropClassWithLifetimeboundMemberFunction* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN40DropClassWithLifetimeboundMemberFunctionC1ERKS_( - class DropClassWithLifetimeboundMemberFunction* __this, - class DropClassWithLifetimeboundMemberFunction const* __param_0) { + class ::DropClassWithLifetimeboundMemberFunction* __this, + class ::DropClassWithLifetimeboundMemberFunction const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" class DropClassWithLifetimeboundMemberFunction* +extern "C" class ::DropClassWithLifetimeboundMemberFunction* __rust_thunk___ZN40DropClassWithLifetimeboundMemberFunctionaSERKS_( - class DropClassWithLifetimeboundMemberFunction* __this, - class DropClassWithLifetimeboundMemberFunction const* __param_0) { + class ::DropClassWithLifetimeboundMemberFunction* __this, + class ::DropClassWithLifetimeboundMemberFunction const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZNK40DropClassWithLifetimeboundMemberFunction1fEv( - struct PlainStruct* __return, - class DropClassWithLifetimeboundMemberFunction const* __this) { + struct ::PlainStruct* __return, + class ::DropClassWithLifetimeboundMemberFunction const* __this) { new (__return) auto(__this->f()); } -static_assert((struct PlainStruct const ( +static_assert((struct ::PlainStruct const ( ::DropClassWithLifetimeboundMemberFunction::*)() const) & ::DropClassWithLifetimeboundMemberFunction::f); -static_assert(sizeof(class DropClassWithLifetimeboundRefMemberFunction) == 1); -static_assert(alignof(class DropClassWithLifetimeboundRefMemberFunction) == 1); +static_assert(sizeof(class ::DropClassWithLifetimeboundRefMemberFunction) == 1); +static_assert(alignof(class ::DropClassWithLifetimeboundRefMemberFunction) == + 1); extern "C" void __rust_thunk___ZN43DropClassWithLifetimeboundRefMemberFunctionC1Ev( - class DropClassWithLifetimeboundRefMemberFunction* __this) { + class ::DropClassWithLifetimeboundRefMemberFunction* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN43DropClassWithLifetimeboundRefMemberFunctionC1ERKS_( - class DropClassWithLifetimeboundRefMemberFunction* __this, - class DropClassWithLifetimeboundRefMemberFunction const* __param_0) { + class ::DropClassWithLifetimeboundRefMemberFunction* __this, + class ::DropClassWithLifetimeboundRefMemberFunction const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" class DropClassWithLifetimeboundRefMemberFunction* +extern "C" class ::DropClassWithLifetimeboundRefMemberFunction* __rust_thunk___ZN43DropClassWithLifetimeboundRefMemberFunctionaSERKS_( - class DropClassWithLifetimeboundRefMemberFunction* __this, - class DropClassWithLifetimeboundRefMemberFunction const* __param_0) { + class ::DropClassWithLifetimeboundRefMemberFunction* __this, + class ::DropClassWithLifetimeboundRefMemberFunction const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } -static_assert((struct PlainStruct const& ( +static_assert((struct ::PlainStruct const& ( ::DropClassWithLifetimeboundRefMemberFunction::*)() const) & ::DropClassWithLifetimeboundRefMemberFunction::f); -static_assert(sizeof(struct StructWithLifetimeboundCtor) == 1); -static_assert(alignof(struct StructWithLifetimeboundCtor) == 1); +static_assert(sizeof(struct ::StructWithLifetimeboundCtor) == 1); +static_assert(alignof(struct ::StructWithLifetimeboundCtor) == 1); extern "C" void __rust_thunk___ZN27StructWithLifetimeboundCtorC1E11PlainStruct( - struct StructWithLifetimeboundCtor* __this, struct PlainStruct* s) { + struct ::StructWithLifetimeboundCtor* __this, struct ::PlainStruct* s) { crubit::construct_at(__this, std::move(*s)); } -static_assert(sizeof(struct StructWithLifetimeboundRefCtor) == 1); -static_assert(alignof(struct StructWithLifetimeboundRefCtor) == 1); +static_assert(sizeof(struct ::StructWithLifetimeboundRefCtor) == 1); +static_assert(alignof(struct ::StructWithLifetimeboundRefCtor) == 1); extern "C" void __rust_thunk___ZN30StructWithLifetimeboundRefCtorC1ERK11PlainStruct( - struct StructWithLifetimeboundRefCtor* __this, - struct PlainStruct const* s) { + struct ::StructWithLifetimeboundRefCtor* __this, + struct ::PlainStruct const* s) { crubit::construct_at(__this, *s); } -static_assert(sizeof(struct DropStructWithLifetimeboundCtor) == 1); -static_assert(alignof(struct DropStructWithLifetimeboundCtor) == 1); +static_assert(sizeof(struct ::DropStructWithLifetimeboundCtor) == 1); +static_assert(alignof(struct ::DropStructWithLifetimeboundCtor) == 1); extern "C" void __rust_thunk___ZN31DropStructWithLifetimeboundCtorC1ERKS_( - struct DropStructWithLifetimeboundCtor* __this, - struct DropStructWithLifetimeboundCtor const* __param_0) { + struct ::DropStructWithLifetimeboundCtor* __this, + struct ::DropStructWithLifetimeboundCtor const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" struct DropStructWithLifetimeboundCtor* +extern "C" struct ::DropStructWithLifetimeboundCtor* __rust_thunk___ZN31DropStructWithLifetimeboundCtoraSERKS_( - struct DropStructWithLifetimeboundCtor* __this, - struct DropStructWithLifetimeboundCtor const* __param_0) { + struct ::DropStructWithLifetimeboundCtor* __this, + struct ::DropStructWithLifetimeboundCtor const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZN31DropStructWithLifetimeboundCtorC1E11PlainStruct( - struct DropStructWithLifetimeboundCtor* __this, struct PlainStruct* s) { + struct ::DropStructWithLifetimeboundCtor* __this, struct ::PlainStruct* s) { crubit::construct_at(__this, std::move(*s)); } -static_assert(sizeof(struct DropStructWithLifetimeboundRefCtor) == 1); -static_assert(alignof(struct DropStructWithLifetimeboundRefCtor) == 1); +static_assert(sizeof(struct ::DropStructWithLifetimeboundRefCtor) == 1); +static_assert(alignof(struct ::DropStructWithLifetimeboundRefCtor) == 1); extern "C" void __rust_thunk___ZN34DropStructWithLifetimeboundRefCtorC1ERKS_( - struct DropStructWithLifetimeboundRefCtor* __this, - struct DropStructWithLifetimeboundRefCtor const* __param_0) { + struct ::DropStructWithLifetimeboundRefCtor* __this, + struct ::DropStructWithLifetimeboundRefCtor const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" struct DropStructWithLifetimeboundRefCtor* +extern "C" struct ::DropStructWithLifetimeboundRefCtor* __rust_thunk___ZN34DropStructWithLifetimeboundRefCtoraSERKS_( - struct DropStructWithLifetimeboundRefCtor* __this, - struct DropStructWithLifetimeboundRefCtor const* __param_0) { + struct ::DropStructWithLifetimeboundRefCtor* __this, + struct ::DropStructWithLifetimeboundRefCtor const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZN34DropStructWithLifetimeboundRefCtorC1ERK11PlainStruct( - struct DropStructWithLifetimeboundRefCtor* __this, - struct PlainStruct const* s) { + struct ::DropStructWithLifetimeboundRefCtor* __this, + struct ::PlainStruct const* s) { crubit::construct_at(__this, *s); } -static_assert(sizeof(struct DropStructWithRefCtorAndRefMemberFunction) == 1); -static_assert(alignof(struct DropStructWithRefCtorAndRefMemberFunction) == 1); +static_assert(sizeof(struct ::DropStructWithRefCtorAndRefMemberFunction) == 1); +static_assert(alignof(struct ::DropStructWithRefCtorAndRefMemberFunction) == 1); extern "C" void __rust_thunk___ZN41DropStructWithRefCtorAndRefMemberFunctionC1ERKS_( - struct DropStructWithRefCtorAndRefMemberFunction* __this, - struct DropStructWithRefCtorAndRefMemberFunction const* __param_0) { + struct ::DropStructWithRefCtorAndRefMemberFunction* __this, + struct ::DropStructWithRefCtorAndRefMemberFunction const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" struct DropStructWithRefCtorAndRefMemberFunction* +extern "C" struct ::DropStructWithRefCtorAndRefMemberFunction* __rust_thunk___ZN41DropStructWithRefCtorAndRefMemberFunctionaSERKS_( - struct DropStructWithRefCtorAndRefMemberFunction* __this, - struct DropStructWithRefCtorAndRefMemberFunction const* __param_0) { + struct ::DropStructWithRefCtorAndRefMemberFunction* __this, + struct ::DropStructWithRefCtorAndRefMemberFunction const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZN41DropStructWithRefCtorAndRefMemberFunctionC1ERK11PlainStruct( - struct DropStructWithRefCtorAndRefMemberFunction* __this, - struct PlainStruct const* s) { + struct ::DropStructWithRefCtorAndRefMemberFunction* __this, + struct ::PlainStruct const* s) { crubit::construct_at(__this, *s); } -static_assert((struct PlainStruct const& ( +static_assert((struct ::PlainStruct const& ( ::DropStructWithRefCtorAndRefMemberFunction::*)() const) & ::DropStructWithRefCtorAndRefMemberFunction::f); -static_assert(sizeof(struct DropStructWithCtorAndMemberFunction) == 1); -static_assert(alignof(struct DropStructWithCtorAndMemberFunction) == 1); +static_assert(sizeof(struct ::DropStructWithCtorAndMemberFunction) == 1); +static_assert(alignof(struct ::DropStructWithCtorAndMemberFunction) == 1); extern "C" void __rust_thunk___ZN35DropStructWithCtorAndMemberFunctionC1ERKS_( - struct DropStructWithCtorAndMemberFunction* __this, - struct DropStructWithCtorAndMemberFunction const* __param_0) { + struct ::DropStructWithCtorAndMemberFunction* __this, + struct ::DropStructWithCtorAndMemberFunction const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" struct DropStructWithCtorAndMemberFunction* +extern "C" struct ::DropStructWithCtorAndMemberFunction* __rust_thunk___ZN35DropStructWithCtorAndMemberFunctionaSERKS_( - struct DropStructWithCtorAndMemberFunction* __this, - struct DropStructWithCtorAndMemberFunction const* __param_0) { + struct ::DropStructWithCtorAndMemberFunction* __this, + struct ::DropStructWithCtorAndMemberFunction const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZN35DropStructWithCtorAndMemberFunctionC1E11PlainStruct( - struct DropStructWithCtorAndMemberFunction* __this, struct PlainStruct* s) { + struct ::DropStructWithCtorAndMemberFunction* __this, + struct ::PlainStruct* s) { crubit::construct_at(__this, std::move(*s)); } extern "C" void __rust_thunk___ZNK35DropStructWithCtorAndMemberFunction1fEv( - struct PlainStruct* __return, - struct DropStructWithCtorAndMemberFunction const* __this) { + struct ::PlainStruct* __return, + struct ::DropStructWithCtorAndMemberFunction const* __this) { new (__return) auto(__this->f()); } -static_assert((struct PlainStruct const ( +static_assert((struct ::PlainStruct const ( ::DropStructWithCtorAndMemberFunction::*)() const) & ::DropStructWithCtorAndMemberFunction::f); -static_assert(sizeof(struct DropStructWithCtorAndRefMemberFunction) == 1); -static_assert(alignof(struct DropStructWithCtorAndRefMemberFunction) == 1); +static_assert(sizeof(struct ::DropStructWithCtorAndRefMemberFunction) == 1); +static_assert(alignof(struct ::DropStructWithCtorAndRefMemberFunction) == 1); extern "C" void __rust_thunk___ZN38DropStructWithCtorAndRefMemberFunctionC1ERKS_( - struct DropStructWithCtorAndRefMemberFunction* __this, - struct DropStructWithCtorAndRefMemberFunction const* __param_0) { + struct ::DropStructWithCtorAndRefMemberFunction* __this, + struct ::DropStructWithCtorAndRefMemberFunction const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" struct DropStructWithCtorAndRefMemberFunction* +extern "C" struct ::DropStructWithCtorAndRefMemberFunction* __rust_thunk___ZN38DropStructWithCtorAndRefMemberFunctionaSERKS_( - struct DropStructWithCtorAndRefMemberFunction* __this, - struct DropStructWithCtorAndRefMemberFunction const* __param_0) { + struct ::DropStructWithCtorAndRefMemberFunction* __this, + struct ::DropStructWithCtorAndRefMemberFunction const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZN38DropStructWithCtorAndRefMemberFunctionC1E11PlainStruct( - struct DropStructWithCtorAndRefMemberFunction* __this, - struct PlainStruct* s) { + struct ::DropStructWithCtorAndRefMemberFunction* __this, + struct ::PlainStruct* s) { crubit::construct_at(__this, std::move(*s)); } -static_assert((struct PlainStruct const& ( +static_assert((struct ::PlainStruct const& ( ::DropStructWithCtorAndRefMemberFunction::*)() const) & ::DropStructWithCtorAndRefMemberFunction::f); -static_assert(sizeof(struct DropStructWithRefCtorAndMemberFunction) == 1); -static_assert(alignof(struct DropStructWithRefCtorAndMemberFunction) == 1); +static_assert(sizeof(struct ::DropStructWithRefCtorAndMemberFunction) == 1); +static_assert(alignof(struct ::DropStructWithRefCtorAndMemberFunction) == 1); extern "C" void __rust_thunk___ZN38DropStructWithRefCtorAndMemberFunctionC1ERKS_( - struct DropStructWithRefCtorAndMemberFunction* __this, - struct DropStructWithRefCtorAndMemberFunction const* __param_0) { + struct ::DropStructWithRefCtorAndMemberFunction* __this, + struct ::DropStructWithRefCtorAndMemberFunction const* __param_0) { crubit::construct_at(__this, *__param_0); } -extern "C" struct DropStructWithRefCtorAndMemberFunction* +extern "C" struct ::DropStructWithRefCtorAndMemberFunction* __rust_thunk___ZN38DropStructWithRefCtorAndMemberFunctionaSERKS_( - struct DropStructWithRefCtorAndMemberFunction* __this, - struct DropStructWithRefCtorAndMemberFunction const* __param_0) { + struct ::DropStructWithRefCtorAndMemberFunction* __this, + struct ::DropStructWithRefCtorAndMemberFunction const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZN38DropStructWithRefCtorAndMemberFunctionC1ERK11PlainStruct( - struct DropStructWithRefCtorAndMemberFunction* __this, - struct PlainStruct const* s) { + struct ::DropStructWithRefCtorAndMemberFunction* __this, + struct ::PlainStruct const* s) { crubit::construct_at(__this, *s); } extern "C" void __rust_thunk___ZNK38DropStructWithRefCtorAndMemberFunction1fEv( - struct PlainStruct* __return, - struct DropStructWithRefCtorAndMemberFunction const* __this) { + struct ::PlainStruct* __return, + struct ::DropStructWithRefCtorAndMemberFunction const* __this) { new (__return) auto(__this->f()); } -static_assert((struct PlainStruct const ( +static_assert((struct ::PlainStruct const ( ::DropStructWithRefCtorAndMemberFunction::*)() const) & ::DropStructWithRefCtorAndMemberFunction::f); diff --git a/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_rs_api.rs b/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_rs_api.rs index 0060d37b7..4990081b9 100644 --- a/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_rs_api.rs +++ b/rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound_rs_api.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/assume_lifetimes:struct_with_lifetimebound -// Features: assume_lifetimes, fmt, supported, types +// Features: assume_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, impl_trait_in_assoc_type, negative_impls)] @@ -18,14 +18,14 @@ /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=PlainStruct +///CRUBIT_ANNOTATE: cpp_type=:: PlainStruct pub struct PlainStruct { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for PlainStruct {} impl !Sync for PlainStruct {} unsafe impl ::cxx::ExternType for PlainStruct { - type Id = ::cxx::type_id!("PlainStruct"); + type Id = ::cxx::type_id!(":: PlainStruct"); type Kind = ::cxx::kind::Trivial; } @@ -44,14 +44,14 @@ impl Default for PlainStruct { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=10 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=StructWithLifetimeboundMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: StructWithLifetimeboundMemberFunction pub struct StructWithLifetimeboundMemberFunction { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for StructWithLifetimeboundMemberFunction {} impl !Sync for StructWithLifetimeboundMemberFunction {} unsafe impl ::cxx::ExternType for StructWithLifetimeboundMemberFunction { - type Id = ::cxx::type_id!("StructWithLifetimeboundMemberFunction"); + type Id = ::cxx::type_id!(":: StructWithLifetimeboundMemberFunction"); type Kind = ::cxx::kind::Trivial; } impl StructWithLifetimeboundMemberFunction { @@ -96,7 +96,7 @@ pub mod struct_with_lifetimebound_member_function { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=14 #[derive(Clone, Copy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=StructWithLifetimeboundRefMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: StructWithLifetimeboundRefMemberFunction pub struct StructWithLifetimeboundRefMemberFunction<'__implicit> { __non_field_data: [::core::mem::MaybeUninit; 1], __marker___implicit: ::core::marker::PhantomData<&'__implicit ()>, @@ -106,7 +106,7 @@ impl<'__implicit> !Sync for StructWithLifetimeboundRefMemberFunction<'__implicit unsafe impl<'__implicit> ::cxx::ExternType for StructWithLifetimeboundRefMemberFunction<'__implicit> { - type Id = ::cxx::type_id!("StructWithLifetimeboundRefMemberFunction"); + type Id = ::cxx::type_id!(":: StructWithLifetimeboundRefMemberFunction"); type Kind = ::cxx::kind::Trivial; } impl<'__implicit> StructWithLifetimeboundRefMemberFunction<'__implicit> { @@ -146,14 +146,14 @@ pub mod struct_with_lifetimebound_ref_member_function { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=18 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropClassWithLifetimeboundMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: DropClassWithLifetimeboundMemberFunction pub struct DropClassWithLifetimeboundMemberFunction { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for DropClassWithLifetimeboundMemberFunction {} impl !Sync for DropClassWithLifetimeboundMemberFunction {} unsafe impl ::cxx::ExternType for DropClassWithLifetimeboundMemberFunction { - type Id = ::cxx::type_id!("DropClassWithLifetimeboundMemberFunction"); + type Id = ::cxx::type_id!(":: DropClassWithLifetimeboundMemberFunction"); type Kind = ::cxx::kind::Opaque; } impl DropClassWithLifetimeboundMemberFunction { @@ -250,7 +250,7 @@ pub mod drop_class_with_lifetimebound_member_function { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=24 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropClassWithLifetimeboundRefMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: DropClassWithLifetimeboundRefMemberFunction pub struct DropClassWithLifetimeboundRefMemberFunction<'__implicit> { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], __marker___implicit: ::core::marker::PhantomData<&'__implicit ()>, @@ -260,7 +260,7 @@ impl<'__implicit> !Sync for DropClassWithLifetimeboundRefMemberFunction<'__impli unsafe impl<'__implicit> ::cxx::ExternType for DropClassWithLifetimeboundRefMemberFunction<'__implicit> { - type Id = ::cxx::type_id!("DropClassWithLifetimeboundRefMemberFunction"); + type Id = ::cxx::type_id!(":: DropClassWithLifetimeboundRefMemberFunction"); type Kind = ::cxx::kind::Opaque; } impl<'__implicit> DropClassWithLifetimeboundRefMemberFunction<'__implicit> { @@ -371,14 +371,14 @@ pub mod drop_class_with_lifetimebound_ref_member_function { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=30 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=StructWithLifetimeboundCtor +///CRUBIT_ANNOTATE: cpp_type=:: StructWithLifetimeboundCtor pub struct StructWithLifetimeboundCtor { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for StructWithLifetimeboundCtor {} impl !Sync for StructWithLifetimeboundCtor {} unsafe impl ::cxx::ExternType for StructWithLifetimeboundCtor { - type Id = ::cxx::type_id!("StructWithLifetimeboundCtor"); + type Id = ::cxx::type_id!(":: StructWithLifetimeboundCtor"); type Kind = ::cxx::kind::Trivial; } @@ -409,7 +409,7 @@ impl ::ctor::CtorNew for StructWithLifetimeboundCtor { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=35 #[derive(Clone, Copy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=StructWithLifetimeboundRefCtor +///CRUBIT_ANNOTATE: cpp_type=:: StructWithLifetimeboundRefCtor pub struct StructWithLifetimeboundRefCtor<'__implicit> { __non_field_data: [::core::mem::MaybeUninit; 1], __marker___implicit: ::core::marker::PhantomData<&'__implicit ()>, @@ -417,7 +417,7 @@ pub struct StructWithLifetimeboundRefCtor<'__implicit> { impl<'__implicit> !Send for StructWithLifetimeboundRefCtor<'__implicit> {} impl<'__implicit> !Sync for StructWithLifetimeboundRefCtor<'__implicit> {} unsafe impl<'__implicit> ::cxx::ExternType for StructWithLifetimeboundRefCtor<'__implicit> { - type Id = ::cxx::type_id!("StructWithLifetimeboundRefCtor"); + type Id = ::cxx::type_id!(":: StructWithLifetimeboundRefCtor"); type Kind = ::cxx::kind::Trivial; } @@ -454,14 +454,14 @@ impl<'__implicit> ::ctor::CtorNew<&'__implicit crate::PlainStruct> /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=40 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropStructWithLifetimeboundCtor +///CRUBIT_ANNOTATE: cpp_type=:: DropStructWithLifetimeboundCtor pub struct DropStructWithLifetimeboundCtor { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for DropStructWithLifetimeboundCtor {} impl !Sync for DropStructWithLifetimeboundCtor {} unsafe impl ::cxx::ExternType for DropStructWithLifetimeboundCtor { - type Id = ::cxx::type_id!("DropStructWithLifetimeboundCtor"); + type Id = ::cxx::type_id!(":: DropStructWithLifetimeboundCtor"); type Kind = ::cxx::kind::Opaque; } @@ -542,7 +542,7 @@ impl ::ctor::PinnedDrop for DropStructWithLifetimeboundCtor { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=46 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropStructWithLifetimeboundRefCtor +///CRUBIT_ANNOTATE: cpp_type=:: DropStructWithLifetimeboundRefCtor pub struct DropStructWithLifetimeboundRefCtor<'__implicit> { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], __marker___implicit: ::core::marker::PhantomData<&'__implicit ()>, @@ -550,7 +550,7 @@ pub struct DropStructWithLifetimeboundRefCtor<'__implicit> { impl<'__implicit> !Send for DropStructWithLifetimeboundRefCtor<'__implicit> {} impl<'__implicit> !Sync for DropStructWithLifetimeboundRefCtor<'__implicit> {} unsafe impl<'__implicit> ::cxx::ExternType for DropStructWithLifetimeboundRefCtor<'__implicit> { - type Id = ::cxx::type_id!("DropStructWithLifetimeboundRefCtor"); + type Id = ::cxx::type_id!(":: DropStructWithLifetimeboundRefCtor"); type Kind = ::cxx::kind::Opaque; } @@ -654,7 +654,7 @@ impl<'__implicit> ::ctor::PinnedDrop for DropStructWithLifetimeboundRefCtor<'__i /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=52 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropStructWithRefCtorAndRefMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: DropStructWithRefCtorAndRefMemberFunction pub struct DropStructWithRefCtorAndRefMemberFunction<'__implicit> { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], __marker___implicit: ::core::marker::PhantomData<&'__implicit ()>, @@ -664,7 +664,7 @@ impl<'__implicit> !Sync for DropStructWithRefCtorAndRefMemberFunction<'__implici unsafe impl<'__implicit> ::cxx::ExternType for DropStructWithRefCtorAndRefMemberFunction<'__implicit> { - type Id = ::cxx::type_id!("DropStructWithRefCtorAndRefMemberFunction"); + type Id = ::cxx::type_id!(":: DropStructWithRefCtorAndRefMemberFunction"); type Kind = ::cxx::kind::Opaque; } impl<'__implicit> DropStructWithRefCtorAndRefMemberFunction<'__implicit> { @@ -789,14 +789,14 @@ pub mod drop_struct_with_ref_ctor_and_ref_member_function { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=60 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropStructWithCtorAndMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: DropStructWithCtorAndMemberFunction pub struct DropStructWithCtorAndMemberFunction { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for DropStructWithCtorAndMemberFunction {} impl !Sync for DropStructWithCtorAndMemberFunction {} unsafe impl ::cxx::ExternType for DropStructWithCtorAndMemberFunction { - type Id = ::cxx::type_id!("DropStructWithCtorAndMemberFunction"); + type Id = ::cxx::type_id!(":: DropStructWithCtorAndMemberFunction"); type Kind = ::cxx::kind::Opaque; } impl DropStructWithCtorAndMemberFunction { @@ -898,14 +898,14 @@ pub mod drop_struct_with_ctor_and_member_function { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=67 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropStructWithCtorAndRefMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: DropStructWithCtorAndRefMemberFunction pub struct DropStructWithCtorAndRefMemberFunction { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for DropStructWithCtorAndRefMemberFunction {} impl !Sync for DropStructWithCtorAndRefMemberFunction {} unsafe impl ::cxx::ExternType for DropStructWithCtorAndRefMemberFunction { - type Id = ::cxx::type_id!("DropStructWithCtorAndRefMemberFunction"); + type Id = ::cxx::type_id!(":: DropStructWithCtorAndRefMemberFunction"); type Kind = ::cxx::kind::Opaque; } impl DropStructWithCtorAndRefMemberFunction { @@ -1004,7 +1004,7 @@ pub mod drop_struct_with_ctor_and_ref_member_function { /// Generated from: rs_bindings_from_cc/test/assume_lifetimes/struct_with_lifetimebound.h;l=74 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DropStructWithRefCtorAndMemberFunction +///CRUBIT_ANNOTATE: cpp_type=:: DropStructWithRefCtorAndMemberFunction pub struct DropStructWithRefCtorAndMemberFunction<'__implicit> { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], __marker___implicit: ::core::marker::PhantomData<&'__implicit ()>, @@ -1012,7 +1012,7 @@ pub struct DropStructWithRefCtorAndMemberFunction<'__implicit> { impl<'__implicit> !Send for DropStructWithRefCtorAndMemberFunction<'__implicit> {} impl<'__implicit> !Sync for DropStructWithRefCtorAndMemberFunction<'__implicit> {} unsafe impl<'__implicit> ::cxx::ExternType for DropStructWithRefCtorAndMemberFunction<'__implicit> { - type Id = ::cxx::type_id!("DropStructWithRefCtorAndMemberFunction"); + type Id = ::cxx::type_id!(":: DropStructWithRefCtorAndMemberFunction"); type Kind = ::cxx::kind::Opaque; } impl<'__implicit> DropStructWithRefCtorAndMemberFunction<'__implicit> { diff --git a/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.cc b/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.cc index 46e088c57..c7b34eaa2 100644 --- a/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.cc +++ b/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/consume_absl:absl_functional -// Features: callables, fmt, supported, types +// Features: callables, fmt, leading_colons_for_cpp_type, supported, types #include "support/bridge.h" #include "support/internal/cxx20_backports.h" @@ -60,7 +60,8 @@ __crubit_invoke_any_invocable___CcTemplateInstN4absl12AnyInvocableIFvvOEEE__2f_2 } extern "C" void __crubit_invoke_any_invocable___CcTemplateInstN4absl12AnyInvocableIKF8MyOptionIiES2_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional( - ::absl::AnyInvocable(struct MyOption) const>* f, + ::absl::AnyInvocable(struct ::MyOption) const>* + f, unsigned char* param_0, unsigned char* out) { ::crubit::internal::Encode( ::crubit::MyOptionAbi<::crubit::TransmuteAbi>( @@ -80,7 +81,7 @@ __crubit_invoke_any_invocable___CcTemplateInstN4absl12AnyInvocableIKFiiEEE__2f_2 extern "C" void __rust_thunk___Z12CallVoidVoidN4absl12AnyInvocableIFvvOEEE( const unsigned char* f) { ::crubit::Decoder __f_decoder(::crubit::AnyInvocableAbi::kSize, f); - CallVoidVoid( + ::CallVoidVoid( ::crubit::AnyInvocableAbi( __crubit_manager___CcTemplateInstN4absl12AnyInvocableIFvvOEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional, [](::absl::internal_any_invocable::TypeErasedState* state) noexcept @@ -91,7 +92,8 @@ extern "C" void __rust_thunk___Z12CallVoidVoidN4absl12AnyInvocableIFvvOEEE( .Decode(__f_decoder)); } -static_assert((void (*)(class absl::AnyInvocable)) & ::CallVoidVoid); +static_assert((void (*)(class ::absl::AnyInvocable)) & + ::CallVoidVoid); extern "C" void __rust_thunk___Z13ReturnIntVoidv( unsigned char* __return_abi_buffer) { @@ -105,24 +107,25 @@ extern "C" void __rust_thunk___Z13ReturnIntVoidv( return __crubit_invoker___CcTemplateInstN4absl12AnyInvocableIKFiiEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional( state, param_0); }) - .Encode(ReturnIntVoid(), __return_encoder); + .Encode(::ReturnIntVoid(), __return_encoder); } -static_assert((class absl::AnyInvocable (*)()) & +static_assert((class ::absl::AnyInvocable (*)()) & ::ReturnIntVoid); extern "C" void __rust_thunk___Z17MyOptionIntMapperv( unsigned char* __return_abi_buffer) { ::crubit::Encoder __return_encoder( - ::crubit::AnyInvocableAbi(struct MyOption) + ::crubit::AnyInvocableAbi(struct ::MyOption) const>::kSize, __return_abi_buffer); - ::crubit::AnyInvocableAbi(struct MyOption) const>( + ::crubit::AnyInvocableAbi(struct ::MyOption) + const>( __crubit_manager___CcTemplateInstN4absl12AnyInvocableIKF8MyOptionIiES2_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fconsume_5fabsl_3aabsl_5ffunctional, [](::absl::internal_any_invocable::TypeErasedState* state, ::absl::internal_any_invocable::ForwardedParameterType< - struct MyOption> - param_0) noexcept -> struct MyOption { + struct ::MyOption> + param_0) noexcept -> struct ::MyOption { unsigned char bridge_param_0 [::crubit::MyOptionAbi<::crubit::TransmuteAbi>::kSize]; ::crubit::internal::Encode( @@ -139,11 +142,11 @@ extern "C" void __rust_thunk___Z17MyOptionIntMapperv( ::crubit::TransmuteAbi()), out); }) - .Encode(MyOptionIntMapper(), __return_encoder); + .Encode(::MyOptionIntMapper(), __return_encoder); } static_assert( - (class absl::AnyInvocable(MyOption) const> (*)()) & + (class ::absl::AnyInvocable(MyOption) const> (*)()) & ::MyOptionIntMapper); #pragma clang diagnostic pop 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 7e94b2fd6..111e6383e 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/consume_absl:absl_functional -// Features: callables, fmt, supported, types +// Features: callables, fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] diff --git a/rs_bindings_from_cc/test/display/displayables_api.rs b/rs_bindings_from_cc/test/display/displayables_api.rs index 35c50fb6d..9d45104a1 100644 --- a/rs_bindings_from_cc/test/display/displayables_api.rs +++ b/rs_bindings_from_cc/test/display/displayables_api.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/display:displayables -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -18,14 +18,14 @@ /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=15 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=CanAbslStringify +///CRUBIT_ANNOTATE: cpp_type=:: CanAbslStringify pub struct CanAbslStringify { pub value: ::cc_std::std::__u::raw_string_view, } impl !Send for CanAbslStringify {} impl !Sync for CanAbslStringify {} unsafe impl ::cxx::ExternType for CanAbslStringify { - type Id = ::cxx::type_id!("CanAbslStringify"); + type Id = ::cxx::type_id!(":: CanAbslStringify"); type Kind = ::cxx::kind::Trivial; } impl ::core::fmt::Display for CanAbslStringify { @@ -56,7 +56,7 @@ impl Default for CanAbslStringify { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=24 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=CanAbslStringifyByFill +///CRUBIT_ANNOTATE: cpp_type=:: CanAbslStringifyByFill pub struct CanAbslStringifyByFill { pub count: usize, pub ch: ::ffi_11::c_char, @@ -64,7 +64,7 @@ pub struct CanAbslStringifyByFill { impl !Send for CanAbslStringifyByFill {} impl !Sync for CanAbslStringifyByFill {} unsafe impl ::cxx::ExternType for CanAbslStringifyByFill { - type Id = ::cxx::type_id!("CanAbslStringifyByFill"); + type Id = ::cxx::type_id!(":: CanAbslStringifyByFill"); type Kind = ::cxx::kind::Trivial; } impl ::core::fmt::Display for CanAbslStringifyByFill { @@ -95,14 +95,14 @@ impl Default for CanAbslStringifyByFill { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=34 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=CanAbslStringifyByFormat +///CRUBIT_ANNOTATE: cpp_type=:: CanAbslStringifyByFormat pub struct CanAbslStringifyByFormat { pub value: ::cc_std::std::__u::raw_string_view, } impl !Send for CanAbslStringifyByFormat {} impl !Sync for CanAbslStringifyByFormat {} unsafe impl ::cxx::ExternType for CanAbslStringifyByFormat { - type Id = ::cxx::type_id!("CanAbslStringifyByFormat"); + type Id = ::cxx::type_id!(":: CanAbslStringifyByFormat"); type Kind = ::cxx::kind::Trivial; } impl ::core::fmt::Display for CanAbslStringifyByFormat { @@ -133,14 +133,14 @@ impl Default for CanAbslStringifyByFormat { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=43 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=CanOstream +///CRUBIT_ANNOTATE: cpp_type=:: CanOstream pub struct CanOstream { pub value: ::cc_std::std::__u::raw_string_view, } impl !Send for CanOstream {} impl !Sync for CanOstream {} unsafe impl ::cxx::ExternType for CanOstream { - type Id = ::cxx::type_id!("CanOstream"); + type Id = ::cxx::type_id!(":: CanOstream"); type Kind = ::cxx::kind::Trivial; } impl ::core::fmt::Display for CanOstream { @@ -178,7 +178,7 @@ impl Default for CanOstream { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=51 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=CanAbslStringifyAndOstream +///CRUBIT_ANNOTATE: cpp_type=:: CanAbslStringifyAndOstream pub struct CanAbslStringifyAndOstream { pub stringify: ::cc_std::std::__u::raw_string_view, pub ostream: ::cc_std::std::__u::raw_string_view, @@ -186,7 +186,7 @@ pub struct CanAbslStringifyAndOstream { impl !Send for CanAbslStringifyAndOstream {} impl !Sync for CanAbslStringifyAndOstream {} unsafe impl ::cxx::ExternType for CanAbslStringifyAndOstream { - type Id = ::cxx::type_id!("CanAbslStringifyAndOstream"); + type Id = ::cxx::type_id!(":: CanAbslStringifyAndOstream"); type Kind = ::cxx::kind::Trivial; } impl ::core::fmt::Display for CanAbslStringifyAndOstream { @@ -226,7 +226,7 @@ impl Default for CanAbslStringifyAndOstream { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=67 #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=DisplayableEnum +///CRUBIT_ANNOTATE: cpp_type=:: DisplayableEnum pub struct DisplayableEnum(::ffi_11::c_int); impl DisplayableEnum { pub const kKnown: DisplayableEnum = DisplayableEnum(::ffi_11::new_c_int(1)); @@ -269,14 +269,14 @@ impl ::core::fmt::Display for DisplayableEnum { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=91 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NotDisplayable +///CRUBIT_ANNOTATE: cpp_type=:: NotDisplayable pub struct NotDisplayable { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for NotDisplayable {} impl !Sync for NotDisplayable {} unsafe impl ::cxx::ExternType for NotDisplayable { - type Id = ::cxx::type_id!("NotDisplayable"); + type Id = ::cxx::type_id!(":: NotDisplayable"); type Kind = ::cxx::kind::Trivial; } @@ -295,14 +295,14 @@ impl Default for NotDisplayable { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=92 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=TemplatedStringView +///CRUBIT_ANNOTATE: cpp_type=:: TemplatedStringView pub struct TemplatedStringView { __non_field_data: [::core::mem::MaybeUninit; 16], } impl !Send for TemplatedStringView {} impl !Sync for TemplatedStringView {} unsafe impl ::cxx::ExternType for TemplatedStringView { - type Id = ::cxx::type_id!("TemplatedStringView"); + type Id = ::cxx::type_id!(":: TemplatedStringView"); type Kind = ::cxx::kind::Trivial; } impl ::core::fmt::Display for TemplatedStringView { @@ -342,14 +342,14 @@ impl ::ctor::CtorNew<::cc_std::std::__u::raw_string_view> for TemplatedStringVie /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=95 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TemplatedNotDisplayable +///CRUBIT_ANNOTATE: cpp_type=:: TemplatedNotDisplayable pub struct TemplatedNotDisplayable { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for TemplatedNotDisplayable {} impl !Sync for TemplatedNotDisplayable {} unsafe impl ::cxx::ExternType for TemplatedNotDisplayable { - type Id = ::cxx::type_id!("TemplatedNotDisplayable"); + type Id = ::cxx::type_id!(":: TemplatedNotDisplayable"); type Kind = ::cxx::kind::Trivial; } @@ -368,7 +368,7 @@ impl Default for TemplatedNotDisplayable { /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=99 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DisplayInRust +///CRUBIT_ANNOTATE: cpp_type=:: DisplayInRust pub struct DisplayInRust { pub cc_value: ::cc_std::std::__u::raw_string_view, pub rust_value: ::cc_std::std::__u::raw_string_view, @@ -376,7 +376,7 @@ pub struct DisplayInRust { impl !Send for DisplayInRust {} impl !Sync for DisplayInRust {} unsafe impl ::cxx::ExternType for DisplayInRust { - type Id = ::cxx::type_id!("DisplayInRust"); + type Id = ::cxx::type_id!(":: DisplayInRust"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/display/displayables_api_impl.cc b/rs_bindings_from_cc/test/display/displayables_api_impl.cc index fef1b780e..f92098dea 100644 --- a/rs_bindings_from_cc/test/display/displayables_api_impl.cc +++ b/rs_bindings_from_cc/test/display/displayables_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/display:displayables -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/bridge.h" #include "support/internal/cxx20_backports.h" @@ -23,135 +23,135 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct CanAbslStringify) == 16); -static_assert(alignof(struct CanAbslStringify) == 8); -static_assert(CRUBIT_OFFSET_OF(value, struct CanAbslStringify) == 0); +static_assert(CRUBIT_SIZEOF(struct ::CanAbslStringify) == 16); +static_assert(alignof(struct ::CanAbslStringify) == 8); +static_assert(CRUBIT_OFFSET_OF(value, struct ::CanAbslStringify) == 0); extern "C" void __rust_thunk___ZN16CanAbslStringifyC1Ev( - struct CanAbslStringify* __this) { + struct ::CanAbslStringify* __this) { crubit::construct_at(__this); } extern "C" bool __crubit_fmt__16CanAbslStringify___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( - const struct CanAbslStringify& value, + const struct ::CanAbslStringify& value, ::lossy_formatter::LossyFormatter& formatter) { return ::crubit::Fmt(value, formatter); } -static_assert(CRUBIT_SIZEOF(struct CanAbslStringifyByFill) == 16); -static_assert(alignof(struct CanAbslStringifyByFill) == 8); -static_assert(CRUBIT_OFFSET_OF(count, struct CanAbslStringifyByFill) == 0); -static_assert(CRUBIT_OFFSET_OF(ch, struct CanAbslStringifyByFill) == 8); +static_assert(CRUBIT_SIZEOF(struct ::CanAbslStringifyByFill) == 16); +static_assert(alignof(struct ::CanAbslStringifyByFill) == 8); +static_assert(CRUBIT_OFFSET_OF(count, struct ::CanAbslStringifyByFill) == 0); +static_assert(CRUBIT_OFFSET_OF(ch, struct ::CanAbslStringifyByFill) == 8); extern "C" void __rust_thunk___ZN22CanAbslStringifyByFillC1Ev( - struct CanAbslStringifyByFill* __this) { + struct ::CanAbslStringifyByFill* __this) { crubit::construct_at(__this); } extern "C" bool __crubit_fmt__22CanAbslStringifyByFill___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( - const struct CanAbslStringifyByFill& value, + const struct ::CanAbslStringifyByFill& value, ::lossy_formatter::LossyFormatter& formatter) { return ::crubit::Fmt(value, formatter); } -static_assert(CRUBIT_SIZEOF(struct CanAbslStringifyByFormat) == 16); -static_assert(alignof(struct CanAbslStringifyByFormat) == 8); -static_assert(CRUBIT_OFFSET_OF(value, struct CanAbslStringifyByFormat) == 0); +static_assert(CRUBIT_SIZEOF(struct ::CanAbslStringifyByFormat) == 16); +static_assert(alignof(struct ::CanAbslStringifyByFormat) == 8); +static_assert(CRUBIT_OFFSET_OF(value, struct ::CanAbslStringifyByFormat) == 0); extern "C" void __rust_thunk___ZN24CanAbslStringifyByFormatC1Ev( - struct CanAbslStringifyByFormat* __this) { + struct ::CanAbslStringifyByFormat* __this) { crubit::construct_at(__this); } extern "C" bool __crubit_fmt__24CanAbslStringifyByFormat___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( - const struct CanAbslStringifyByFormat& value, + const struct ::CanAbslStringifyByFormat& value, ::lossy_formatter::LossyFormatter& formatter) { return ::crubit::Fmt(value, formatter); } -static_assert(CRUBIT_SIZEOF(struct CanOstream) == 16); -static_assert(alignof(struct CanOstream) == 8); -static_assert(CRUBIT_OFFSET_OF(value, struct CanOstream) == 0); +static_assert(CRUBIT_SIZEOF(struct ::CanOstream) == 16); +static_assert(alignof(struct ::CanOstream) == 8); +static_assert(CRUBIT_OFFSET_OF(value, struct ::CanOstream) == 0); -extern "C" void __rust_thunk___ZN10CanOstreamC1Ev(struct CanOstream* __this) { +extern "C" void __rust_thunk___ZN10CanOstreamC1Ev(struct ::CanOstream* __this) { crubit::construct_at(__this); } extern "C" bool __crubit_fmt__10CanOstream___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( - const struct CanOstream& value, + const struct ::CanOstream& value, ::lossy_formatter::LossyFormatter& formatter) { return ::crubit::Fmt(value, formatter); } -static_assert(CRUBIT_SIZEOF(struct CanAbslStringifyAndOstream) == 32); -static_assert(alignof(struct CanAbslStringifyAndOstream) == 8); -static_assert(CRUBIT_OFFSET_OF(stringify, struct CanAbslStringifyAndOstream) == - 0); -static_assert(CRUBIT_OFFSET_OF(ostream, struct CanAbslStringifyAndOstream) == +static_assert(CRUBIT_SIZEOF(struct ::CanAbslStringifyAndOstream) == 32); +static_assert(alignof(struct ::CanAbslStringifyAndOstream) == 8); +static_assert(CRUBIT_OFFSET_OF(stringify, + struct ::CanAbslStringifyAndOstream) == 0); +static_assert(CRUBIT_OFFSET_OF(ostream, struct ::CanAbslStringifyAndOstream) == 16); extern "C" void __rust_thunk___ZN26CanAbslStringifyAndOstreamC1Ev( - struct CanAbslStringifyAndOstream* __this) { + struct ::CanAbslStringifyAndOstream* __this) { crubit::construct_at(__this); } extern "C" bool __crubit_fmt__26CanAbslStringifyAndOstream___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( - const struct CanAbslStringifyAndOstream& value, + const struct ::CanAbslStringifyAndOstream& value, ::lossy_formatter::LossyFormatter& formatter) { return ::crubit::Fmt(value, formatter); } extern "C" bool __crubit_fmt__DisplayableEnum___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( - const DisplayableEnum& value, + const ::DisplayableEnum& value, ::lossy_formatter::LossyFormatter& formatter) { return ::crubit::Fmt(value, formatter); } -static_assert(sizeof(struct NotDisplayable) == 1); -static_assert(alignof(struct NotDisplayable) == 1); +static_assert(sizeof(struct ::NotDisplayable) == 1); +static_assert(alignof(struct ::NotDisplayable) == 1); extern "C" void __rust_thunk___ZN14NotDisplayableC1Ev( - struct NotDisplayable* __this) { + struct ::NotDisplayable* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct TemplatedStringView) == 16); -static_assert(alignof(struct TemplatedStringView) == 8); +static_assert(CRUBIT_SIZEOF(struct ::TemplatedStringView) == 16); +static_assert(alignof(struct ::TemplatedStringView) == 8); extern "C" void __rust_thunk___ZN19TemplatedStringViewC1ENSt3__u17basic_string_viewIcNS0_11char_traitsIcEEEE( - struct TemplatedStringView* __this, ::std::__u::string_view* v) { + struct ::TemplatedStringView* __this, ::std::__u::string_view* v) { crubit::construct_at(__this, std::move(*v)); } extern "C" bool __crubit_fmt__19TemplatedStringView___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fdisplay_3adisplayables( - const struct TemplatedStringView& value, + const struct ::TemplatedStringView& value, ::lossy_formatter::LossyFormatter& formatter) { return ::crubit::Fmt(value, formatter); } -static_assert(sizeof(struct TemplatedNotDisplayable) == 1); -static_assert(alignof(struct TemplatedNotDisplayable) == 1); +static_assert(sizeof(struct ::TemplatedNotDisplayable) == 1); +static_assert(alignof(struct ::TemplatedNotDisplayable) == 1); extern "C" void __rust_thunk___ZN23TemplatedNotDisplayableC1Ev( - struct TemplatedNotDisplayable* __this) { + struct ::TemplatedNotDisplayable* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct DisplayInRust) == 32); -static_assert(alignof(struct DisplayInRust) == 8); -static_assert(CRUBIT_OFFSET_OF(cc_value, struct DisplayInRust) == 0); -static_assert(CRUBIT_OFFSET_OF(rust_value, struct DisplayInRust) == 16); +static_assert(CRUBIT_SIZEOF(struct ::DisplayInRust) == 32); +static_assert(alignof(struct ::DisplayInRust) == 8); +static_assert(CRUBIT_OFFSET_OF(cc_value, struct ::DisplayInRust) == 0); +static_assert(CRUBIT_OFFSET_OF(rust_value, struct ::DisplayInRust) == 16); extern "C" void __rust_thunk___ZN13DisplayInRustC1Ev( - struct DisplayInRust* __this) { + struct ::DisplayInRust* __this) { crubit::construct_at(__this); } diff --git a/rs_bindings_from_cc/test/function/inline/inline_api_impl.cc b/rs_bindings_from_cc/test/function/inline/inline_api_impl.cc index 305a7d2c0..93deb67d9 100644 --- a/rs_bindings_from_cc/test/function/inline/inline_api_impl.cc +++ b/rs_bindings_from_cc/test/function/inline/inline_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/function/inline:inline -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -20,35 +20,36 @@ #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" int __rust_thunk___Z18hello_world_inlinev() { - return hello_world_inline(); + return ::hello_world_inline(); } static_assert((int (*)()) & ::hello_world_inline); -static_assert(CRUBIT_SIZEOF(struct SomeStruct) == 4); -static_assert(alignof(struct SomeStruct) == 4); -static_assert(CRUBIT_OFFSET_OF(int_field, struct SomeStruct) == 0); +static_assert(CRUBIT_SIZEOF(struct ::SomeStruct) == 4); +static_assert(alignof(struct ::SomeStruct) == 4); +static_assert(CRUBIT_OFFSET_OF(int_field, struct ::SomeStruct) == 0); -extern "C" void __rust_thunk___ZN10SomeStructC1Ev(struct SomeStruct* __this) { +extern "C" void __rust_thunk___ZN10SomeStructC1Ev(struct ::SomeStruct* __this) { crubit::construct_at(__this); } extern "C" int __rust_thunk___Z24take_struct_by_const_ptrPK10SomeStruct( - struct SomeStruct const* s) { - return take_struct_by_const_ptr(s); + struct ::SomeStruct const* s) { + return ::take_struct_by_const_ptr(s); } -static_assert((int (*)(struct SomeStruct const*)) & ::take_struct_by_const_ptr); +static_assert((int (*)(struct ::SomeStruct const*)) & + ::take_struct_by_const_ptr); extern "C" unsigned int __rust_thunk___Z19double_unsigned_intj(unsigned int i) { - return double_unsigned_int(i); + return ::double_unsigned_int(i); } static_assert((unsigned int (*)(unsigned int)) & ::double_unsigned_int); extern "C" int __rust_thunk___ZN10namespaced24forward_declared_doublerEi( int x) { - return namespaced::forward_declared_doubler(x); + return ::namespaced::forward_declared_doubler(x); } static_assert((int (*)(int)) & ::namespaced::forward_declared_doubler); 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 82e2a034a..5572cc349 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/function/inline:inline -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -27,14 +27,14 @@ pub fn hello_world_inline() -> ::ffi_11::c_int { /// Generated from: rs_bindings_from_cc/test/function/inline/inline.h;l=12 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeStruct +///CRUBIT_ANNOTATE: cpp_type=:: SomeStruct pub struct SomeStruct { pub int_field: ::ffi_11::c_int, } impl !Send for SomeStruct {} impl !Sync for SomeStruct {} unsafe impl ::cxx::ExternType for SomeStruct { - type Id = ::cxx::type_id!("SomeStruct"); + type Id = ::cxx::type_id!(":: SomeStruct"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/function/simple/simple_api_impl.cc b/rs_bindings_from_cc/test/function/simple/simple_api_impl.cc index 03a956e7a..8c6d28150 100644 --- a/rs_bindings_from_cc/test/function/simple/simple_api_impl.cc +++ b/rs_bindings_from_cc/test/function/simple/simple_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/function/simple:simple -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -52,7 +52,7 @@ static_assert((crubit::type_identity_t & (*)()) & extern "C" crubit::type_identity_t* __rust_thunk___Z39inline_get_pointer_to_multiply_functionv() { - return inline_get_pointer_to_multiply_function(); + return ::inline_get_pointer_to_multiply_function(); } static_assert((crubit::type_identity_t * (*)()) & @@ -60,7 +60,7 @@ static_assert((crubit::type_identity_t * (*)()) & extern "C" int __rust_thunk___Z15apply_binary_opiiPFiiiE( int x, int y, crubit::type_identity_t* op) { - return apply_binary_op(x, y, op); + return ::apply_binary_op(x, y, op); } static_assert((int (*)(int, int, crubit::type_identity_t*)) & 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 2aa986a17..adc6a6e20 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/function/simple:simple -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes)] diff --git a/rs_bindings_from_cc/test/global/global_api_impl.cc b/rs_bindings_from_cc/test/global/global_api_impl.cc index a6942c828..32b1f932b 100644 --- a/rs_bindings_from_cc/test/global/global_api_impl.cc +++ b/rs_bindings_from_cc/test/global/global_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/global:global -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,7 +19,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -extern "C" void __rust_thunk___Z6Unusedi(int arg) { Unused(arg); } +extern "C" void __rust_thunk___Z6Unusedi(int arg) { ::Unused(arg); } static_assert((void (*)(int)) & ::Unused); @@ -31,11 +31,11 @@ static_assert((int (*)()) & ::GetCNamespacedIntVal); static_assert((int (*)()) & ::GetInlineIntVal); -static_assert(sizeof(struct StructWithAnonEnum) == 1); -static_assert(alignof(struct StructWithAnonEnum) == 1); +static_assert(sizeof(struct ::StructWithAnonEnum) == 1); +static_assert(alignof(struct ::StructWithAnonEnum) == 1); extern "C" void __rust_thunk___ZN18StructWithAnonEnumC1Ev( - struct StructWithAnonEnum* __this) { + struct ::StructWithAnonEnum* __this) { crubit::construct_at(__this); } 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 b192da4f9..44e846e0f 100644 --- a/rs_bindings_from_cc/test/global/global_rs_api.rs +++ b/rs_bindings_from_cc/test/global/global_rs_api.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/global:global -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -95,14 +95,14 @@ pub mod foo { /// Generated from: rs_bindings_from_cc/test/global/global.h;l=44 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=StructWithAnonEnum +///CRUBIT_ANNOTATE: cpp_type=:: StructWithAnonEnum pub struct StructWithAnonEnum { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for StructWithAnonEnum {} impl !Sync for StructWithAnonEnum {} unsafe impl ::cxx::ExternType for StructWithAnonEnum { - type Id = ::cxx::type_id!("StructWithAnonEnum"); + type Id = ::cxx::type_id!(":: StructWithAnonEnum"); type Kind = ::cxx::kind::Trivial; } 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 b77b336c0..53a37a042 100644 --- a/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs @@ -16,7 +16,7 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=WithBitfields +///CRUBIT_ANNOTATE: cpp_type=:: WithBitfields pub struct WithBitfields { // f1 : 2 bits __bitfields0: [::core::mem::MaybeUninit; 1], @@ -37,7 +37,7 @@ pub struct WithBitfields { impl !Send for WithBitfields {} impl !Sync for WithBitfields {} unsafe impl ::cxx::ExternType for WithBitfields { - type Id = ::cxx::type_id!("WithBitfields"); + type Id = ::cxx::type_id!(":: WithBitfields"); type Kind = ::cxx::kind::Trivial; } @@ -62,7 +62,7 @@ impl Default for WithBitfields { /// * `status`: Rust type is unknown; safety requirements cannot be automatically generated: Unsupported type 'enum AlignmentRegressionTest::(unnamed at ./rs_bindings_from_cc/test/golden/bitfields.h:25:3)': No generated bindings found for '' #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=AlignmentRegressionTest +///CRUBIT_ANNOTATE: cpp_type=:: AlignmentRegressionTest pub struct AlignmentRegressionTest { // code_point : 31 bits // status : 1 bits @@ -71,7 +71,7 @@ pub struct AlignmentRegressionTest { impl !Send for AlignmentRegressionTest {} impl !Sync for AlignmentRegressionTest {} unsafe impl ::cxx::ExternType for AlignmentRegressionTest { - type Id = ::cxx::type_id!("AlignmentRegressionTest"); + type Id = ::cxx::type_id!(":: AlignmentRegressionTest"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc index 6cf04703b..102f4b203 100644 --- a/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/bitfields_rs_api_impl.cc @@ -18,22 +18,22 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct WithBitfields) == 32); -static_assert(alignof(struct WithBitfields) == 4); -static_assert(CRUBIT_OFFSET_OF(f2, struct WithBitfields) == 4); -static_assert(CRUBIT_OFFSET_OF(f5, struct WithBitfields) == 20); -static_assert(CRUBIT_OFFSET_OF(f7, struct WithBitfields) == 27); +static_assert(CRUBIT_SIZEOF(struct ::WithBitfields) == 32); +static_assert(alignof(struct ::WithBitfields) == 4); +static_assert(CRUBIT_OFFSET_OF(f2, struct ::WithBitfields) == 4); +static_assert(CRUBIT_OFFSET_OF(f5, struct ::WithBitfields) == 20); +static_assert(CRUBIT_OFFSET_OF(f7, struct ::WithBitfields) == 27); extern "C" void __rust_thunk___ZN13WithBitfieldsC1Ev( - struct WithBitfields* __this) { + struct ::WithBitfields* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct AlignmentRegressionTest) == 4); -static_assert(alignof(struct AlignmentRegressionTest) == 4); +static_assert(CRUBIT_SIZEOF(struct ::AlignmentRegressionTest) == 4); +static_assert(alignof(struct ::AlignmentRegressionTest) == 4); extern "C" void __rust_thunk___ZN23AlignmentRegressionTestC1Ev( - struct AlignmentRegressionTest* __this) { + struct ::AlignmentRegressionTest* __this) { crubit::construct_at(__this); } 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 2eb42314f..f1e4295db 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 @@ -18,14 +18,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=X +///CRUBIT_ANNOTATE: cpp_type=:: X pub struct X { pub a: ::ffi_11::c_int, } impl !Send for X {} impl !Sync for X {} unsafe impl ::cxx::ExternType for X { - type Id = ::cxx::type_id!("X"); + type Id = ::cxx::type_id!(":: X"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api_impl.cc index cccb1a333..fb8017627 100644 --- a/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/c_abi_compatible_type_rs_api_impl.cc @@ -18,24 +18,24 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct X) == 4); -static_assert(alignof(struct X) == 4); -static_assert(CRUBIT_OFFSET_OF(a, struct X) == 0); +static_assert(CRUBIT_SIZEOF(struct ::X) == 4); +static_assert(alignof(struct ::X) == 4); +static_assert(CRUBIT_OFFSET_OF(a, struct ::X) == 0); -extern "C" void __rust_thunk___ZN1XC1Ev(struct X* __this) { +extern "C" void __rust_thunk___ZN1XC1Ev(struct ::X* __this) { crubit::construct_at(__this); } -extern "C" MyI8 __rust_thunk___Z3ffi4MyI81X(MyI8 a, struct X* b) { - return ffi(std::move(a), std::move(*b)); +extern "C" MyI8 __rust_thunk___Z3ffi4MyI81X(MyI8 a, struct ::X* b) { + return ::ffi(std::move(a), std::move(*b)); } -static_assert((MyI8 (*)(MyI8, struct X)) & ::ffi); +static_assert((MyI8 (*)(MyI8, struct ::X)) & ::ffi); -extern "C" void __rust_thunk___Z1fiPvi(MyTypedefDecl a, void* b, int c) { - f(a, b, c); +extern "C" void __rust_thunk___Z1fiPvi(::MyTypedefDecl a, void* b, int c) { + ::f(a, b, c); } -static_assert((void (*)(MyTypedefDecl, void*, int)) & ::f); +static_assert((void (*)(::MyTypedefDecl, void*, int)) & ::f); #pragma clang diagnostic pop 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 afe9e9cb8..9f31f9de4 100644 --- a/rs_bindings_from_cc/test/golden/callables_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/callables_rs_api.rs @@ -81,14 +81,14 @@ pub fn map_bridged( #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ABICompatible +///CRUBIT_ANNOTATE: cpp_type=:: ABICompatible pub struct ABICompatible { pub x: ::ffi_11::c_int, } impl !Send for ABICompatible {} impl !Sync for ABICompatible {} unsafe impl ::cxx::ExternType for ABICompatible { - type Id = ::cxx::type_id!("ABICompatible"); + type Id = ::cxx::type_id!(":: ABICompatible"); type Kind = ::cxx::kind::Trivial; } @@ -122,7 +122,7 @@ pub fn map_abi_compatible( #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=LayoutCompatible +///CRUBIT_ANNOTATE: cpp_type=:: LayoutCompatible pub struct LayoutCompatible { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -132,7 +132,7 @@ pub struct LayoutCompatible { impl !Send for LayoutCompatible {} impl !Sync for LayoutCompatible {} unsafe impl ::cxx::ExternType for LayoutCompatible { - type Id = ::cxx::type_id!("LayoutCompatible"); + type Id = ::cxx::type_id!(":: LayoutCompatible"); type Kind = ::cxx::kind::Trivial; } impl LayoutCompatible { diff --git a/rs_bindings_from_cc/test/golden/callables_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/callables_rs_api_impl.cc index 6a90ecff5..2d720760e 100644 --- a/rs_bindings_from_cc/test/golden/callables_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/callables_rs_api_impl.cc @@ -43,7 +43,7 @@ __crubit_manager___CcTemplateInstN6rs_std11DynCallableIFvvOEEE__2f_2fthird_5fpar extern "C" void __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKF13ABICompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( ::absl::internal_any_invocable::TypeErasedState* state, - struct ABICompatible* param_0, struct ABICompatible* out); + struct ::ABICompatible* param_0, struct ::ABICompatible* out); extern "C" void __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF13ABICompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( ::absl::internal_any_invocable::FunctionToCall operation, @@ -53,7 +53,7 @@ __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF13ABICompatibleS1_EEE__ extern "C" void __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( ::absl::internal_any_invocable::TypeErasedState* state, - class LayoutCompatible* param_0, class LayoutCompatible* out); + class ::LayoutCompatible* param_0, class ::LayoutCompatible* out); extern "C" void __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( ::absl::internal_any_invocable::FunctionToCall operation, @@ -92,7 +92,7 @@ extern "C" void __rust_thunk___Z11invoke_onceN6rs_std11DynCallableIFvvOEEE( const unsigned char* f) { ::crubit::Decoder __f_decoder( ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, f); - invoke_once( + ::invoke_once( ::rs_std::internal_dyn_callable::DynCallableAbi( __crubit_manager___CcTemplateInstN6rs_std11DynCallableIFvvOEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc, [](::absl::internal_any_invocable::TypeErasedState* state) noexcept @@ -103,13 +103,14 @@ extern "C" void __rust_thunk___Z11invoke_onceN6rs_std11DynCallableIFvvOEEE( .Decode(__f_decoder)); } -static_assert((void (*)(class rs_std::DynCallable)) & ::invoke_once); +static_assert((void (*)(class ::rs_std::DynCallable)) & + ::invoke_once); extern "C" void __rust_thunk___Z6invokeN6rs_std11DynCallableIFvvEEE( const unsigned char* f) { ::crubit::Decoder __f_decoder( ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, f); - invoke( + ::invoke( ::rs_std::internal_dyn_callable::DynCallableAbi( __crubit_manager___CcTemplateInstN6rs_std11DynCallableIFvvEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc, [](::absl::internal_any_invocable::TypeErasedState* state) noexcept @@ -120,13 +121,13 @@ extern "C" void __rust_thunk___Z6invokeN6rs_std11DynCallableIFvvEEE( .Decode(__f_decoder)); } -static_assert((void (*)(class rs_std::DynCallable)) & ::invoke); +static_assert((void (*)(class ::rs_std::DynCallable)) & ::invoke); extern "C" void __rust_thunk___Z12invoke_constN6rs_std11DynCallableIKFvvEEE( const unsigned char* f) { ::crubit::Decoder __f_decoder( ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, f); - invoke_const( + ::invoke_const( ::rs_std::internal_dyn_callable::DynCallableAbi( __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKFvvEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc, [](::absl::internal_any_invocable::TypeErasedState* state) noexcept @@ -137,7 +138,7 @@ extern "C" void __rust_thunk___Z12invoke_constN6rs_std11DynCallableIKFvvEEE( .Decode(__f_decoder)); } -static_assert((void (*)(class rs_std::DynCallable)) & +static_assert((void (*)(class ::rs_std::DynCallable)) & ::invoke_const); extern "C" int __rust_thunk___Z7map_intN6rs_std11DynCallableIKFiiEEEi( @@ -145,7 +146,7 @@ extern "C" int __rust_thunk___Z7map_intN6rs_std11DynCallableIKFiiEEEi( ::crubit::Decoder __f_decoder( ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, f); - return map_int( + return ::map_int( ::rs_std::internal_dyn_callable::DynCallableAbi( __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKFiiEEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc, [](::absl::internal_any_invocable::TypeErasedState* state, @@ -158,7 +159,7 @@ extern "C" int __rust_thunk___Z7map_intN6rs_std11DynCallableIKFiiEEEi( arg); } -static_assert((int (*)(class rs_std::DynCallable, int)) & +static_assert((int (*)(class ::rs_std::DynCallable, int)) & ::map_int); extern "C" void @@ -166,21 +167,21 @@ __rust_thunk___Z11map_bridgedN6rs_std11DynCallableIKF7BridgedS1_EEES1_( unsigned char* __return_abi_buffer, const unsigned char* f, const unsigned char* arg) { ::crubit::Decoder __f_decoder( - ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, + ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, f); ::crubit::Decoder __arg_decoder(::crubit::BridgedAbi::kSize, arg); ::crubit::Encoder __return_encoder(::crubit::BridgedAbi::kSize, __return_abi_buffer); ::crubit::BridgedAbi().Encode( - map_bridged( - ::rs_std::internal_dyn_callable::DynCallableAbi( + ::map_bridged( + ::rs_std::internal_dyn_callable::DynCallableAbi( __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF7BridgedS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc, [](::absl::internal_any_invocable::TypeErasedState* state, ::absl::internal_any_invocable::ForwardedParameterType< - struct Bridged> - param_0) noexcept -> struct Bridged { + struct ::Bridged> + param_0) noexcept -> struct ::Bridged { unsigned char bridge_param_0[::crubit::BridgedAbi::kSize]; ::crubit::internal::Encode(::crubit::BridgedAbi(), bridge_param_0, param_0); @@ -196,38 +197,38 @@ __rust_thunk___Z11map_bridgedN6rs_std11DynCallableIKF7BridgedS1_EEES1_( } static_assert( - (struct Bridged (*)(class rs_std::DynCallable, - struct Bridged)) & + (struct ::Bridged (*)(class ::rs_std::DynCallable, + struct ::Bridged)) & ::map_bridged); -static_assert(CRUBIT_SIZEOF(struct ABICompatible) == 4); -static_assert(alignof(struct ABICompatible) == 4); -static_assert(CRUBIT_OFFSET_OF(x, struct ABICompatible) == 0); +static_assert(CRUBIT_SIZEOF(struct ::ABICompatible) == 4); +static_assert(alignof(struct ::ABICompatible) == 4); +static_assert(CRUBIT_OFFSET_OF(x, struct ::ABICompatible) == 0); extern "C" void __rust_thunk___ZN13ABICompatibleC1Ev( - struct ABICompatible* __this) { + struct ::ABICompatible* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___Z18map_abi_compatibleN6rs_std11DynCallableIKF13ABICompatibleS1_EEES1_( - struct ABICompatible* __return, const unsigned char* f, - struct ABICompatible* arg) { + struct ::ABICompatible* __return, const unsigned char* f, + struct ::ABICompatible* arg) { ::crubit::Decoder __f_decoder( - ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, + ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, f); - new (__return) auto(map_abi_compatible( - ::rs_std::internal_dyn_callable::DynCallableAbi( + new (__return) auto(::map_abi_compatible( + ::rs_std::internal_dyn_callable::DynCallableAbi( __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF13ABICompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc, [](::absl::internal_any_invocable::TypeErasedState* state, ::absl::internal_any_invocable::ForwardedParameterType< - struct ABICompatible> - param_0) noexcept -> struct ABICompatible { - ::crubit::Slot stack_param_0( + struct ::ABICompatible> + param_0) noexcept -> struct ::ABICompatible { + ::crubit::Slot stack_param_0( std::move(param_0)); - ::crubit::Slot out; + ::crubit::Slot out; __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKF13ABICompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( state, stack_param_0.Get(), out.Get()); return std::move(out).AssumeInitAndTakeValue(); @@ -236,23 +237,24 @@ __rust_thunk___Z18map_abi_compatibleN6rs_std11DynCallableIKF13ABICompatibleS1_EE std::move(*arg))); } -static_assert((struct ABICompatible (*)( - class rs_std::DynCallable, - struct ABICompatible)) & - ::map_abi_compatible); +static_assert( + (struct ::ABICompatible (*)( + class ::rs_std::DynCallable, + struct ::ABICompatible)) & + ::map_abi_compatible); -static_assert(CRUBIT_SIZEOF(class LayoutCompatible) == 4); -static_assert(alignof(class LayoutCompatible) == 4); +static_assert(CRUBIT_SIZEOF(class ::LayoutCompatible) == 4); +static_assert(alignof(class ::LayoutCompatible) == 4); extern "C" void __rust_thunk___ZN16LayoutCompatible6CreateEi( - class LayoutCompatible* __return, int x) { - new (__return) auto(LayoutCompatible::Create(x)); + class ::LayoutCompatible* __return, int x) { + new (__return) auto(::LayoutCompatible::Create(x)); } -static_assert((class LayoutCompatible (*)(int)) & ::LayoutCompatible::Create); +static_assert((class ::LayoutCompatible (*)(int)) & ::LayoutCompatible::Create); extern "C" int __rust_thunk___ZNK16LayoutCompatible3getEv( - class LayoutCompatible const* __this) { + class ::LayoutCompatible const* __this) { return __this->get(); } @@ -260,23 +262,23 @@ static_assert((int (::LayoutCompatible::*)() const) & ::LayoutCompatible::get); extern "C" void __rust_thunk___Z21map_layout_compatibleN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEES1_( - class LayoutCompatible* __return, const unsigned char* f, - class LayoutCompatible* arg) { + class ::LayoutCompatible* __return, const unsigned char* f, + class ::LayoutCompatible* arg) { ::crubit::Decoder __f_decoder( - ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, + ::rs_std::internal_dyn_callable::DynCallableAbi::kSize, f); - new (__return) auto(map_layout_compatible( - ::rs_std::internal_dyn_callable::DynCallableAbi( + new (__return) auto(::map_layout_compatible( + ::rs_std::internal_dyn_callable::DynCallableAbi( __crubit_manager___CcTemplateInstN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc, [](::absl::internal_any_invocable::TypeErasedState* state, ::absl::internal_any_invocable::ForwardedParameterType< - class LayoutCompatible> - param_0) noexcept -> class LayoutCompatible { - ::crubit::Slot stack_param_0( + class ::LayoutCompatible> + param_0) noexcept -> class ::LayoutCompatible { + ::crubit::Slot stack_param_0( std::move(param_0)); - ::crubit::Slot out; + ::crubit::Slot out; __crubit_invoker___CcTemplateInstN6rs_std11DynCallableIKF16LayoutCompatibleS1_EEE__2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3acallables_5fcc( state, stack_param_0.Get(), out.Get()); return std::move(out).AssumeInitAndTakeValue(); @@ -286,9 +288,9 @@ __rust_thunk___Z21map_layout_compatibleN6rs_std11DynCallableIKF16LayoutCompatibl } static_assert( - (class LayoutCompatible (*)( - class rs_std::DynCallable, - class LayoutCompatible)) & + (class ::LayoutCompatible (*)( + class ::rs_std::DynCallable, + class ::LayoutCompatible)) & ::map_layout_compatible); #pragma clang diagnostic pop 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 95d08c183..02aa57216 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 @@ -31,14 +31,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ABICompatible +///CRUBIT_ANNOTATE: cpp_type=:: ABICompatible pub struct ABICompatible { pub x: ::ffi_11::c_int, } impl !Send for ABICompatible {} impl !Sync for ABICompatible {} unsafe impl ::cxx::ExternType for ABICompatible { - type Id = ::cxx::type_id!("ABICompatible"); + type Id = ::cxx::type_id!(":: ABICompatible"); type Kind = ::cxx::kind::Trivial; } @@ -58,7 +58,7 @@ impl Default for ABICompatible { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=LayoutCompatible +///CRUBIT_ANNOTATE: cpp_type=:: LayoutCompatible pub struct LayoutCompatible { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -68,7 +68,7 @@ pub struct LayoutCompatible { impl !Send for LayoutCompatible {} impl !Sync for LayoutCompatible {} unsafe impl ::cxx::ExternType for LayoutCompatible { - type Id = ::cxx::type_id!("LayoutCompatible"); + type Id = ::cxx::type_id!(":: LayoutCompatible"); type Kind = ::cxx::kind::Trivial; } impl LayoutCompatible { diff --git a/rs_bindings_from_cc/test/golden/callables_supported_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/callables_supported_rs_api_impl.cc index 4693c8c39..28570a450 100644 --- a/rs_bindings_from_cc/test/golden/callables_supported_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/callables_supported_rs_api_impl.cc @@ -20,27 +20,27 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct ABICompatible) == 4); -static_assert(alignof(struct ABICompatible) == 4); -static_assert(CRUBIT_OFFSET_OF(x, struct ABICompatible) == 0); +static_assert(CRUBIT_SIZEOF(struct ::ABICompatible) == 4); +static_assert(alignof(struct ::ABICompatible) == 4); +static_assert(CRUBIT_OFFSET_OF(x, struct ::ABICompatible) == 0); extern "C" void __rust_thunk___ZN13ABICompatibleC1Ev( - struct ABICompatible* __this) { + struct ::ABICompatible* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class LayoutCompatible) == 4); -static_assert(alignof(class LayoutCompatible) == 4); +static_assert(CRUBIT_SIZEOF(class ::LayoutCompatible) == 4); +static_assert(alignof(class ::LayoutCompatible) == 4); extern "C" void __rust_thunk___ZN16LayoutCompatible6CreateEi( - class LayoutCompatible* __return, int x) { - new (__return) auto(LayoutCompatible::Create(x)); + class ::LayoutCompatible* __return, int x) { + new (__return) auto(::LayoutCompatible::Create(x)); } -static_assert((class LayoutCompatible (*)(int)) & ::LayoutCompatible::Create); +static_assert((class ::LayoutCompatible (*)(int)) & ::LayoutCompatible::Create); extern "C" int __rust_thunk___ZNK16LayoutCompatible3getEv( - class LayoutCompatible const* __this) { + class ::LayoutCompatible const* __this) { return __this->get(); } 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 10a938ba9..00a8e56b0 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(64))] -///CRUBIT_ANNOTATE: cpp_type=HasCustomAlignment +///CRUBIT_ANNOTATE: cpp_type=:: HasCustomAlignment pub struct HasCustomAlignment { __non_field_data: [::core::mem::MaybeUninit; 64], } impl !Send for HasCustomAlignment {} impl !Sync for HasCustomAlignment {} unsafe impl ::cxx::ExternType for HasCustomAlignment { - type Id = ::cxx::type_id!("HasCustomAlignment"); + type Id = ::cxx::type_id!(":: HasCustomAlignment"); type Kind = ::cxx::kind::Trivial; } @@ -40,14 +40,14 @@ impl Default for HasCustomAlignment { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=HasFieldWithCustomAlignment +///CRUBIT_ANNOTATE: cpp_type=:: HasFieldWithCustomAlignment pub struct HasFieldWithCustomAlignment { pub field: crate::HasCustomAlignment, } impl !Send for HasFieldWithCustomAlignment {} impl !Sync for HasFieldWithCustomAlignment {} unsafe impl ::cxx::ExternType for HasFieldWithCustomAlignment { - type Id = ::cxx::type_id!("HasFieldWithCustomAlignment"); + type Id = ::cxx::type_id!(":: HasFieldWithCustomAlignment"); type Kind = ::cxx::kind::Trivial; } @@ -66,14 +66,14 @@ impl Default for HasFieldWithCustomAlignment { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(64))] -///CRUBIT_ANNOTATE: cpp_type=InheritsFromBaseWithCustomAlignment +///CRUBIT_ANNOTATE: cpp_type=:: InheritsFromBaseWithCustomAlignment pub struct InheritsFromBaseWithCustomAlignment { __non_field_data: [::core::mem::MaybeUninit; 64], } impl !Send for InheritsFromBaseWithCustomAlignment {} impl !Sync for InheritsFromBaseWithCustomAlignment {} unsafe impl ::cxx::ExternType for InheritsFromBaseWithCustomAlignment { - type Id = ::cxx::type_id!("InheritsFromBaseWithCustomAlignment"); + type Id = ::cxx::type_id!(":: InheritsFromBaseWithCustomAlignment"); type Kind = ::cxx::kind::Trivial; } @@ -92,14 +92,14 @@ impl Default for InheritsFromBaseWithCustomAlignment { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(64))] -///CRUBIT_ANNOTATE: cpp_type=HasCustomAlignmentWithGnuAttr +///CRUBIT_ANNOTATE: cpp_type=:: HasCustomAlignmentWithGnuAttr pub struct HasCustomAlignmentWithGnuAttr { __non_field_data: [::core::mem::MaybeUninit; 64], } impl !Send for HasCustomAlignmentWithGnuAttr {} impl !Sync for HasCustomAlignmentWithGnuAttr {} unsafe impl ::cxx::ExternType for HasCustomAlignmentWithGnuAttr { - type Id = ::cxx::type_id!("HasCustomAlignmentWithGnuAttr"); + type Id = ::cxx::type_id!(":: HasCustomAlignmentWithGnuAttr"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc index c1814170c..bef6defea 100644 --- a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api_impl.cc @@ -18,36 +18,38 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct HasCustomAlignment) == 64); -static_assert(alignof(struct HasCustomAlignment) == 64); +static_assert(CRUBIT_SIZEOF(struct ::HasCustomAlignment) == 64); +static_assert(alignof(struct ::HasCustomAlignment) == 64); extern "C" void __rust_thunk___ZN18HasCustomAlignmentC1Ev( - struct HasCustomAlignment* __this) { + struct ::HasCustomAlignment* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct HasFieldWithCustomAlignment) == 64); -static_assert(alignof(struct HasFieldWithCustomAlignment) == 64); -static_assert(CRUBIT_OFFSET_OF(field, struct HasFieldWithCustomAlignment) == 0); +static_assert(CRUBIT_SIZEOF(struct ::HasFieldWithCustomAlignment) == 64); +static_assert(alignof(struct ::HasFieldWithCustomAlignment) == 64); +static_assert(CRUBIT_OFFSET_OF(field, struct ::HasFieldWithCustomAlignment) == + 0); extern "C" void __rust_thunk___ZN27HasFieldWithCustomAlignmentC1Ev( - struct HasFieldWithCustomAlignment* __this) { + struct ::HasFieldWithCustomAlignment* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct InheritsFromBaseWithCustomAlignment) == 64); -static_assert(alignof(struct InheritsFromBaseWithCustomAlignment) == 64); +static_assert(CRUBIT_SIZEOF(struct ::InheritsFromBaseWithCustomAlignment) == + 64); +static_assert(alignof(struct ::InheritsFromBaseWithCustomAlignment) == 64); extern "C" void __rust_thunk___ZN35InheritsFromBaseWithCustomAlignmentC1Ev( - struct InheritsFromBaseWithCustomAlignment* __this) { + struct ::InheritsFromBaseWithCustomAlignment* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct HasCustomAlignmentWithGnuAttr) == 64); -static_assert(alignof(struct HasCustomAlignmentWithGnuAttr) == 64); +static_assert(CRUBIT_SIZEOF(struct ::HasCustomAlignmentWithGnuAttr) == 64); +static_assert(alignof(struct ::HasCustomAlignmentWithGnuAttr) == 64); extern "C" void __rust_thunk___ZN29HasCustomAlignmentWithGnuAttrC1Ev( - struct HasCustomAlignmentWithGnuAttr* __this) { + struct ::HasCustomAlignmentWithGnuAttr* __this) { crubit::construct_at(__this); } 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 c5f73fd7f..3d31a58dd 100644 --- a/rs_bindings_from_cc/test/golden/comment_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/comment_rs_api.rs @@ -22,7 +22,7 @@ pub mod ns { /// Foo #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=ns :: Foo + ///CRUBIT_ANNOTATE: cpp_type=:: ns :: Foo pub struct Foo { /// A field pub i: ::ffi_11::c_int, @@ -32,7 +32,7 @@ pub mod ns { impl !Send for Foo {} impl !Sync for Foo {} unsafe impl ::cxx::ExternType for Foo { - type Id = ::cxx::type_id!("ns :: Foo"); + type Id = ::cxx::type_id!(":: ns :: Foo"); type Kind = ::cxx::kind::Trivial; } @@ -72,14 +72,14 @@ pub fn foo() { /// Bar #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Bar +///CRUBIT_ANNOTATE: cpp_type=:: Bar pub struct Bar { pub i: ::ffi_11::c_int, } impl !Send for Bar {} impl !Sync for Bar {} unsafe impl ::cxx::ExternType for Bar { - type Id = ::cxx::type_id!("Bar"); + type Id = ::cxx::type_id!(":: Bar"); type Kind = ::cxx::kind::Trivial; } @@ -97,14 +97,14 @@ impl Default for Bar { /// d #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=HasNoComments +///CRUBIT_ANNOTATE: cpp_type=:: HasNoComments pub struct HasNoComments { pub i: ::ffi_11::c_int, } impl !Send for HasNoComments {} impl !Sync for HasNoComments {} unsafe impl ::cxx::ExternType for HasNoComments { - type Id = ::cxx::type_id!("HasNoComments"); + type Id = ::cxx::type_id!(":: HasNoComments"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc index 27da191c6..624460eab 100644 --- a/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/comment_rs_api_impl.cc @@ -18,33 +18,33 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct ns::Foo) == 8); -static_assert(alignof(struct ns::Foo) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct ns::Foo) == 0); -static_assert(CRUBIT_OFFSET_OF(j, struct ns::Foo) == 4); +static_assert(CRUBIT_SIZEOF(struct ::ns::Foo) == 8); +static_assert(alignof(struct ::ns::Foo) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::ns::Foo) == 0); +static_assert(CRUBIT_OFFSET_OF(j, struct ::ns::Foo) == 4); -extern "C" void __rust_thunk___ZN2ns3FooC1Ev(struct ns::Foo* __this) { +extern "C" void __rust_thunk___ZN2ns3FooC1Ev(struct ::ns::Foo* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___Z3foov() { foo(); } +extern "C" void __rust_thunk___Z3foov() { ::foo(); } static_assert((void (*)()) & ::foo); -static_assert(CRUBIT_SIZEOF(struct Bar) == 4); -static_assert(alignof(struct Bar) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct Bar) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Bar) == 4); +static_assert(alignof(struct ::Bar) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::Bar) == 0); -extern "C" void __rust_thunk___ZN3BarC1Ev(struct Bar* __this) { +extern "C" void __rust_thunk___ZN3BarC1Ev(struct ::Bar* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct HasNoComments) == 4); -static_assert(alignof(struct HasNoComments) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct HasNoComments) == 0); +static_assert(CRUBIT_SIZEOF(struct ::HasNoComments) == 4); +static_assert(alignof(struct ::HasNoComments) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::HasNoComments) == 0); extern "C" void __rust_thunk___ZN13HasNoCommentsC1Ev( - struct HasNoComments* __this) { + struct ::HasNoComments* __this) { crubit::construct_at(__this); } 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 06252283f..12c9c0f75 100644 --- a/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs @@ -20,14 +20,14 @@ /// additional_rust_srcs_for_crubit_bindings_aspect_hint.bzl #[::ctor::recursively_pinned] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=CompatibleType +///CRUBIT_ANNOTATE: cpp_type=:: CompatibleType pub struct CompatibleType { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for CompatibleType {} impl !Sync for CompatibleType {} unsafe impl ::cxx::ExternType for CompatibleType { - type Id = ::cxx::type_id!("CompatibleType"); + type Id = ::cxx::type_id!(":: CompatibleType"); type Kind = ::cxx::kind::Opaque; } impl CompatibleType { diff --git a/rs_bindings_from_cc/test/golden/compatibility_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/compatibility_rs_api_impl.cc index 1fdc01730..bf48e7b60 100644 --- a/rs_bindings_from_cc/test/golden/compatibility_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/compatibility_rs_api_impl.cc @@ -18,7 +18,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class CompatibleType) == 1); -static_assert(alignof(class CompatibleType) == 1); +static_assert(sizeof(class ::CompatibleType) == 1); +static_assert(alignof(class ::CompatibleType) == 1); #pragma clang diagnostic pop 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 1f1497a9e..b89ecdd24 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 @@ -66,7 +66,7 @@ pub fn TakeCppStruct(__param_0: crate::RustStruct) { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Vec3 +///CRUBIT_ANNOTATE: cpp_type=:: Vec3 pub struct Vec3 { pub x: f32, pub y: f32, @@ -75,7 +75,7 @@ pub struct Vec3 { impl !Send for Vec3 {} impl !Sync for Vec3 {} unsafe impl ::cxx::ExternType for Vec3 { - type Id = ::cxx::type_id!("Vec3"); + type Id = ::cxx::type_id!(":: Vec3"); type Kind = ::cxx::kind::Trivial; } @@ -153,7 +153,7 @@ pub fn ReturnsCStrArray() -> crate::MyOption<*mut *const ::ffi_11::c_char> { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=DefaultEnum +///CRUBIT_ANNOTATE: cpp_type=:: DefaultEnum pub struct DefaultEnum(::ffi_11::c_int); impl DefaultEnum { pub const kZero: DefaultEnum = DefaultEnum(::ffi_11::new_c_int(0)); @@ -180,7 +180,7 @@ pub fn ReturnsDefaultEnumInComposableBridgeType() -> crate::MyOption crate::MyOption pub mod some_namespace { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] - ///CRUBIT_ANNOTATE: cpp_type=some_namespace :: EnumInNamespace + ///CRUBIT_ANNOTATE: cpp_type=:: some_namespace :: EnumInNamespace pub struct EnumInNamespace(::ffi_11::c_int); impl EnumInNamespace { pub const kZero: EnumInNamespace = EnumInNamespace(::ffi_11::new_c_int(0)); diff --git a/rs_bindings_from_cc/test/golden/composable_bridging_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/composable_bridging_rs_api_impl.cc index 9cd511a6c..7dcb3fb92 100644 --- a/rs_bindings_from_cc/test/golden/composable_bridging_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/composable_bridging_rs_api_impl.cc @@ -34,27 +34,27 @@ extern "C" void __rust_thunk___Z15ReturnCppStructv( unsigned char* __return_abi_buffer) { ::crubit::Encoder __return_encoder(::crubit::CppStructAbi::kSize, __return_abi_buffer); - ::crubit::CppStructAbi().Encode(ReturnCppStruct(), __return_encoder); + ::crubit::CppStructAbi().Encode(::ReturnCppStruct(), __return_encoder); } -static_assert((struct CppStruct (*)()) & ::ReturnCppStruct); +static_assert((struct ::CppStruct (*)()) & ::ReturnCppStruct); extern "C" void __rust_thunk___Z13TakeCppStruct9CppStruct( const unsigned char* __param_0) { ::crubit::Decoder ____param_0_decoder(::crubit::CppStructAbi::kSize, __param_0); - TakeCppStruct(::crubit::CppStructAbi().Decode(____param_0_decoder)); + ::TakeCppStruct(::crubit::CppStructAbi().Decode(____param_0_decoder)); } -static_assert((void (*)(struct CppStruct)) & ::TakeCppStruct); +static_assert((void (*)(struct ::CppStruct)) & ::TakeCppStruct); -static_assert(CRUBIT_SIZEOF(struct Vec3) == 12); -static_assert(alignof(struct Vec3) == 4); -static_assert(CRUBIT_OFFSET_OF(x, struct Vec3) == 0); -static_assert(CRUBIT_OFFSET_OF(y, struct Vec3) == 4); -static_assert(CRUBIT_OFFSET_OF(z, struct Vec3) == 8); +static_assert(CRUBIT_SIZEOF(struct ::Vec3) == 12); +static_assert(alignof(struct ::Vec3) == 4); +static_assert(CRUBIT_OFFSET_OF(x, struct ::Vec3) == 0); +static_assert(CRUBIT_OFFSET_OF(y, struct ::Vec3) == 4); +static_assert(CRUBIT_OFFSET_OF(z, struct ::Vec3) == 8); -extern "C" void __rust_thunk___ZN4Vec3C1Ev(struct Vec3* __this) { +extern "C" void __rust_thunk___ZN4Vec3C1Ev(struct ::Vec3* __this) { crubit::construct_at(__this); } @@ -66,10 +66,10 @@ extern "C" void __rust_thunk___Z16MakeOptionalVec3fffb( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi<::Vec3>>( ::crubit::TransmuteAbi<::Vec3>()) - .Encode(MakeOptionalVec3(x, y, z, is_present), __return_encoder); + .Encode(::MakeOptionalVec3(x, y, z, is_present), __return_encoder); } -static_assert((struct MyOption (*)(float, float, float, bool)) & +static_assert((struct ::MyOption (*)(float, float, float, bool)) & ::MakeOptionalVec3); extern "C" void __rust_thunk___Z11MapMultiply8MyOptionI4Vec3Ef( @@ -81,14 +81,15 @@ extern "C" void __rust_thunk___Z11MapMultiply8MyOptionI4Vec3Ef( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi<::Vec3>>( ::crubit::TransmuteAbi<::Vec3>()) - .Encode(MapMultiply(::crubit::MyOptionAbi<::crubit::TransmuteAbi<::Vec3>>( - ::crubit::TransmuteAbi<::Vec3>()) - .Decode(__v_decoder), - factor), - __return_encoder); + .Encode( + ::MapMultiply(::crubit::MyOptionAbi<::crubit::TransmuteAbi<::Vec3>>( + ::crubit::TransmuteAbi<::Vec3>()) + .Decode(__v_decoder), + factor), + __return_encoder); } -static_assert((struct MyOption (*)(struct MyOption, float)) & +static_assert((struct ::MyOption (*)(struct ::MyOption, float)) & ::MapMultiply); extern "C" void __rust_thunk___Z14MakeMyI8Structv( @@ -98,10 +99,10 @@ extern "C" void __rust_thunk___Z14MakeMyI8Structv( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi<::MyI8Struct>>( ::crubit::TransmuteAbi<::MyI8Struct>()) - .Encode(MakeMyI8Struct(), __return_encoder); + .Encode(::MakeMyI8Struct(), __return_encoder); } -static_assert((struct MyOption (*)()) & ::MakeMyI8Struct); +static_assert((struct ::MyOption (*)()) & ::MakeMyI8Struct); static_assert((void (*)(::rs_std::SliceRef<::std::__u::string_view>)) & ::InspectStringViews); @@ -113,10 +114,10 @@ extern "C" void __rust_thunk___Z12MaybeVoidPtrv( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi>( ::crubit::TransmuteAbi()) - .Encode(MaybeVoidPtr(), __return_encoder); + .Encode(::MaybeVoidPtr(), __return_encoder); } -static_assert((struct MyOption (*)()) & ::MaybeVoidPtr); +static_assert((struct ::MyOption (*)()) & ::MaybeVoidPtr); extern "C" void __rust_thunk___Z40AcceptsSliceAndReturnsStatusErrorIfEmptyN6rs_std8SliceRefIKiEE( @@ -127,11 +128,11 @@ __rust_thunk___Z40AcceptsSliceAndReturnsStatusErrorIfEmptyN6rs_std8SliceRefIKiEE __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi<::rs_std::SliceRef>>( ::crubit::TransmuteAbi<::rs_std::SliceRef>()) - .Encode(AcceptsSliceAndReturnsStatusErrorIfEmpty(slice), + .Encode(::AcceptsSliceAndReturnsStatusErrorIfEmpty(slice), __return_encoder); } -static_assert((struct MyOption> (*)( +static_assert((struct ::MyOption> (*)( ::rs_std::SliceRef)) & ::AcceptsSliceAndReturnsStatusErrorIfEmpty); @@ -142,10 +143,10 @@ extern "C" void __rust_thunk___Z16ReturnsCStrArrayv( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi>( ::crubit::TransmuteAbi()) - .Encode(ReturnsCStrArray(), __return_encoder); + .Encode(::ReturnsCStrArray(), __return_encoder); } -static_assert((struct MyOption (*)()) & ::ReturnsCStrArray); +static_assert((struct ::MyOption (*)()) & ::ReturnsCStrArray); extern "C" void __rust_thunk___Z40ReturnsDefaultEnumInComposableBridgeTypev( unsigned char* __return_abi_buffer) { @@ -154,10 +155,10 @@ extern "C" void __rust_thunk___Z40ReturnsDefaultEnumInComposableBridgeTypev( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi<::DefaultEnum>>( ::crubit::TransmuteAbi<::DefaultEnum>()) - .Encode(ReturnsDefaultEnumInComposableBridgeType(), __return_encoder); + .Encode(::ReturnsDefaultEnumInComposableBridgeType(), __return_encoder); } -static_assert((struct MyOption (*)()) & +static_assert((struct ::MyOption (*)()) & ::ReturnsDefaultEnumInComposableBridgeType); extern "C" void __rust_thunk___Z36ReturnsI64EnumInComposableBridgeTypev( @@ -167,10 +168,10 @@ extern "C" void __rust_thunk___Z36ReturnsI64EnumInComposableBridgeTypev( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi<::I64Enum>>( ::crubit::TransmuteAbi<::I64Enum>()) - .Encode(ReturnsI64EnumInComposableBridgeType(), __return_encoder); + .Encode(::ReturnsI64EnumInComposableBridgeType(), __return_encoder); } -static_assert((struct MyOption (*)()) & +static_assert((struct ::MyOption (*)()) & ::ReturnsI64EnumInComposableBridgeType); extern "C" void __rust_thunk___Z44ReturnsEnumInNamespaceInComposableBridgeTypev( @@ -182,10 +183,11 @@ extern "C" void __rust_thunk___Z44ReturnsEnumInNamespaceInComposableBridgeTypev( ::crubit::MyOptionAbi< ::crubit::TransmuteAbi<::some_namespace::EnumInNamespace>>( ::crubit::TransmuteAbi<::some_namespace::EnumInNamespace>()) - .Encode(ReturnsEnumInNamespaceInComposableBridgeType(), __return_encoder); + .Encode(::ReturnsEnumInNamespaceInComposableBridgeType(), + __return_encoder); } -static_assert((struct MyOption (*)()) & +static_assert((struct ::MyOption (*)()) & ::ReturnsEnumInNamespaceInComposableBridgeType); #pragma clang diagnostic pop 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 33891e625..29dacb281 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 @@ -30,14 +30,14 @@ pub fn ReturnsValue() -> crate::MyOption { /// A basic templated type that does nothing fancy. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Value < int > +///CRUBIT_ANNOTATE: cpp_type=:: Value < int > pub(crate) struct __CcTemplateInst5ValueIiE { pub value: ::ffi_11::c_int, } impl !Send for __CcTemplateInst5ValueIiE {} impl !Sync for __CcTemplateInst5ValueIiE {} forward_declare::unsafe_define!( - forward_declare::symbol!("Value < int >"), + forward_declare::symbol!(":: Value < int >"), crate::__CcTemplateInst5ValueIiE ); diff --git a/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api_impl.cc index a60cdc267..79f458c74 100644 --- a/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/composable_bridging_template_type_rs_api_impl.cc @@ -27,13 +27,13 @@ extern "C" void __rust_thunk___Z12ReturnsValuev( __return_abi_buffer); ::crubit::MyOptionAbi<::crubit::TransmuteAbi<::Value>>( ::crubit::TransmuteAbi<::Value>()) - .Encode(ReturnsValue(), __return_encoder); + .Encode(::ReturnsValue(), __return_encoder); } -static_assert((struct MyOption> (*)()) & ::ReturnsValue); +static_assert((struct ::MyOption> (*)()) & ::ReturnsValue); -static_assert(CRUBIT_SIZEOF(struct Value) == 4); -static_assert(alignof(struct Value) == 4); -static_assert(CRUBIT_OFFSET_OF(value, struct Value) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Value) == 4); +static_assert(alignof(struct ::Value) == 4); +static_assert(CRUBIT_OFFSET_OF(value, struct ::Value) == 0); #pragma clang diagnostic pop 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 b7fd372c6..c0c3abb42 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 @@ -51,7 +51,7 @@ pub type BadSameAbiAttr = ::ffi_11::c_uchar; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ExistingRustTypeFieldTypes +///CRUBIT_ANNOTATE: cpp_type=:: ExistingRustTypeFieldTypes pub struct ExistingRustTypeFieldTypes { pub my_i8_struct: i8, pub my_i8_class: i8, @@ -62,7 +62,7 @@ pub struct ExistingRustTypeFieldTypes { impl !Send for ExistingRustTypeFieldTypes {} impl !Sync for ExistingRustTypeFieldTypes {} unsafe impl ::cxx::ExternType for ExistingRustTypeFieldTypes { - type Id = ::cxx::type_id!("ExistingRustTypeFieldTypes"); + type Id = ::cxx::type_id!(":: ExistingRustTypeFieldTypes"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api_impl.cc index db4c707fd..697c1f633 100644 --- a/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/crubit_internal_rust_type_rs_api_impl.cc @@ -18,25 +18,26 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct ExistingRustTypeFieldTypes) == 5); -static_assert(alignof(struct ExistingRustTypeFieldTypes) == 1); +static_assert(sizeof(struct ::ExistingRustTypeFieldTypes) == 5); +static_assert(alignof(struct ::ExistingRustTypeFieldTypes) == 1); static_assert(CRUBIT_OFFSET_OF(my_i8_struct, - struct ExistingRustTypeFieldTypes) == 0); + struct ::ExistingRustTypeFieldTypes) == 0); static_assert(CRUBIT_OFFSET_OF(my_i8_class, - struct ExistingRustTypeFieldTypes) == 1); -static_assert(CRUBIT_OFFSET_OF(my_i8_enum, struct ExistingRustTypeFieldTypes) == - 2); + struct ::ExistingRustTypeFieldTypes) == 1); +static_assert(CRUBIT_OFFSET_OF(my_i8_enum, + struct ::ExistingRustTypeFieldTypes) == 2); static_assert(CRUBIT_OFFSET_OF(my_i8_alias, - struct ExistingRustTypeFieldTypes) == 3); -static_assert(CRUBIT_OFFSET_OF(error, struct ExistingRustTypeFieldTypes) == 4); + struct ::ExistingRustTypeFieldTypes) == 3); +static_assert(CRUBIT_OFFSET_OF(error, struct ::ExistingRustTypeFieldTypes) == + 4); extern "C" void __rust_thunk___ZN26ExistingRustTypeFieldTypesC1Ev( - struct ExistingRustTypeFieldTypes* __this) { + struct ::ExistingRustTypeFieldTypes* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___Z12AcceptPtrInt3PtrIiE(Ptr* ptr) { - AcceptPtrInt(std::move(*ptr)); + ::AcceptPtrInt(std::move(*ptr)); } static_assert((void (*)(Ptr)) & ::AcceptPtrInt); @@ -44,7 +45,7 @@ static_assert((void (*)(Ptr)) & ::AcceptPtrInt); extern "C" void __rust_thunk___Z29AcceptCppTypeWithTemplateArgs23CppTypeWithTemplateArgsIifLb1EE( CppTypeWithTemplateArgs* cpp_type) { - AcceptCppTypeWithTemplateArgs(std::move(*cpp_type)); + ::AcceptCppTypeWithTemplateArgs(std::move(*cpp_type)); } static_assert((void (*)(CppTypeWithTemplateArgs)) & @@ -52,21 +53,21 @@ static_assert((void (*)(CppTypeWithTemplateArgs)) & extern "C" void __rust_thunk___Z15AcceptReordered11ConvertPtrsIfiE( ConvertPtrs* x) { - AcceptReordered(std::move(*x)); + ::AcceptReordered(std::move(*x)); } static_assert((void (*)(ConvertPtrs)) & ::AcceptReordered); extern "C" void __rust_thunk___Z17AcceptWithDefault11WithDefaultIfiE( WithDefault* x) { - AcceptWithDefault(std::move(*x)); + ::AcceptWithDefault(std::move(*x)); } static_assert((void (*)(WithDefault)) & ::AcceptWithDefault); extern "C" void __rust_thunk___Z17AcceptSpecialized11MyContainerIiES_IvE( MyContainer* a, MyContainer* b) { - AcceptSpecialized(std::move(*a), std::move(*b)); + ::AcceptSpecialized(std::move(*a), std::move(*b)); } static_assert((void (*)(MyContainer, MyContainer)) & 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 5c865db34..af3b193db 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ForwardDeclaredStruct +///CRUBIT_ANNOTATE: cpp_type=:: ForwardDeclaredStruct pub struct ForwardDeclaredStruct { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for ForwardDeclaredStruct {} impl !Sync for ForwardDeclaredStruct {} unsafe impl ::cxx::ExternType for ForwardDeclaredStruct { - type Id = ::cxx::type_id!("ForwardDeclaredStruct"); + type Id = ::cxx::type_id!(":: ForwardDeclaredStruct"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api_impl.cc index 683131aae..c1c606662 100644 --- a/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/definition_of_forward_declaration_rs_api_impl.cc @@ -18,11 +18,11 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct ForwardDeclaredStruct) == 1); -static_assert(alignof(struct ForwardDeclaredStruct) == 1); +static_assert(sizeof(struct ::ForwardDeclaredStruct) == 1); +static_assert(alignof(struct ::ForwardDeclaredStruct) == 1); extern "C" void __rust_thunk___ZN21ForwardDeclaredStructC1Ev( - struct ForwardDeclaredStruct* __this) { + struct ::ForwardDeclaredStruct* __this) { crubit::construct_at(__this); } 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 efb2213f5..ac3f1a427 100644 --- a/rs_bindings_from_cc/test/golden/deprecated_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/deprecated_rs_api.rs @@ -29,14 +29,14 @@ pub fn deprecated_function_with_message() { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[deprecated] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DeprecatedStruct +///CRUBIT_ANNOTATE: cpp_type=:: DeprecatedStruct pub struct DeprecatedStruct { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for DeprecatedStruct {} impl !Sync for DeprecatedStruct {} unsafe impl ::cxx::ExternType for DeprecatedStruct { - type Id = ::cxx::type_id!("DeprecatedStruct"); + type Id = ::cxx::type_id!(":: DeprecatedStruct"); type Kind = ::cxx::kind::Trivial; } @@ -54,14 +54,14 @@ impl Default for DeprecatedStruct { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[deprecated = "old"] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DeprecatedStructWithMessage +///CRUBIT_ANNOTATE: cpp_type=:: DeprecatedStructWithMessage pub struct DeprecatedStructWithMessage { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for DeprecatedStructWithMessage {} impl !Sync for DeprecatedStructWithMessage {} unsafe impl ::cxx::ExternType for DeprecatedStructWithMessage { - type Id = ::cxx::type_id!("DeprecatedStructWithMessage"); + type Id = ::cxx::type_id!(":: DeprecatedStructWithMessage"); type Kind = ::cxx::kind::Trivial; } @@ -81,7 +81,7 @@ impl Default for DeprecatedStructWithMessage { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] #[deprecated] -///CRUBIT_ANNOTATE: cpp_type=DeprecatedEnum +///CRUBIT_ANNOTATE: cpp_type=:: DeprecatedEnum pub struct DeprecatedEnum(::ffi_11::c_uint); impl DeprecatedEnum {} impl From<::ffi_11::c_uint> for DeprecatedEnum { @@ -98,7 +98,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] #[deprecated = "old"] -///CRUBIT_ANNOTATE: cpp_type=DeprecatedEnumWithMessage +///CRUBIT_ANNOTATE: cpp_type=:: DeprecatedEnumWithMessage pub struct DeprecatedEnumWithMessage(::ffi_11::c_uint); impl DeprecatedEnumWithMessage {} impl From<::ffi_11::c_uint> for DeprecatedEnumWithMessage { @@ -134,7 +134,7 @@ pub mod DeprecatedNamespaceWithMessage { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=DeprecatedEnumerators +///CRUBIT_ANNOTATE: cpp_type=:: DeprecatedEnumerators pub struct DeprecatedEnumerators(::ffi_11::c_uint); impl DeprecatedEnumerators { #[deprecated] @@ -163,7 +163,7 @@ pub type DeprecatedUsingWithMessage = ::ffi_11::c_int; #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DeprecatedFields +///CRUBIT_ANNOTATE: cpp_type=:: DeprecatedFields pub struct DeprecatedFields { #[deprecated] pub no_message: ::ffi_11::c_int, @@ -173,7 +173,7 @@ pub struct DeprecatedFields { impl !Send for DeprecatedFields {} impl !Sync for DeprecatedFields {} unsafe impl ::cxx::ExternType for DeprecatedFields { - type Id = ::cxx::type_id!("DeprecatedFields"); + type Id = ::cxx::type_id!(":: DeprecatedFields"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/deprecated_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/deprecated_rs_api_impl.cc index cc1e921e2..290623722 100644 --- a/rs_bindings_from_cc/test/golden/deprecated_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/deprecated_rs_api_impl.cc @@ -19,52 +19,52 @@ #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" void __rust_thunk___Z19deprecated_functionv() { - deprecated_function(); + ::deprecated_function(); } static_assert((void (*)()) & ::deprecated_function); extern "C" void __rust_thunk___Z32deprecated_function_with_messagev() { - deprecated_function_with_message(); + ::deprecated_function_with_message(); } static_assert((void (*)()) & ::deprecated_function_with_message); -static_assert(sizeof(struct DeprecatedStruct) == 1); -static_assert(alignof(struct DeprecatedStruct) == 1); +static_assert(sizeof(struct ::DeprecatedStruct) == 1); +static_assert(alignof(struct ::DeprecatedStruct) == 1); extern "C" void __rust_thunk___ZN16DeprecatedStructC1Ev( - struct DeprecatedStruct* __this) { + struct ::DeprecatedStruct* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct DeprecatedStructWithMessage) == 1); -static_assert(alignof(struct DeprecatedStructWithMessage) == 1); +static_assert(sizeof(struct ::DeprecatedStructWithMessage) == 1); +static_assert(alignof(struct ::DeprecatedStructWithMessage) == 1); extern "C" void __rust_thunk___ZN27DeprecatedStructWithMessageC1Ev( - struct DeprecatedStructWithMessage* __this) { + struct ::DeprecatedStructWithMessage* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN19DeprecatedNamespace1fEv() { - DeprecatedNamespace::f(); + ::DeprecatedNamespace::f(); } static_assert((void (*)()) & ::DeprecatedNamespace::f); extern "C" void __rust_thunk___ZN30DeprecatedNamespaceWithMessage1fEv() { - DeprecatedNamespaceWithMessage::f(); + ::DeprecatedNamespaceWithMessage::f(); } static_assert((void (*)()) & ::DeprecatedNamespaceWithMessage::f); -static_assert(CRUBIT_SIZEOF(struct DeprecatedFields) == 8); -static_assert(alignof(struct DeprecatedFields) == 4); -static_assert(CRUBIT_OFFSET_OF(no_message, struct DeprecatedFields) == 0); -static_assert(CRUBIT_OFFSET_OF(message, struct DeprecatedFields) == 4); +static_assert(CRUBIT_SIZEOF(struct ::DeprecatedFields) == 8); +static_assert(alignof(struct ::DeprecatedFields) == 4); +static_assert(CRUBIT_OFFSET_OF(no_message, struct ::DeprecatedFields) == 0); +static_assert(CRUBIT_OFFSET_OF(message, struct ::DeprecatedFields) == 4); extern "C" void __rust_thunk___ZN16DeprecatedFieldsC1Ev( - struct DeprecatedFields* __this) { + struct ::DeprecatedFields* __this) { crubit::construct_at(__this); } 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 b8db6c577..28df4fa0f 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 @@ -19,7 +19,7 @@ /// * with three slashes #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DocCommentSlashes +///CRUBIT_ANNOTATE: cpp_type=:: DocCommentSlashes pub struct DocCommentSlashes { __non_field_data: [::core::mem::MaybeUninit; 0], /// A field. @@ -28,7 +28,7 @@ pub struct DocCommentSlashes { impl !Send for DocCommentSlashes {} impl !Sync for DocCommentSlashes {} unsafe impl ::cxx::ExternType for DocCommentSlashes { - type Id = ::cxx::type_id!("DocCommentSlashes"); + type Id = ::cxx::type_id!(":: DocCommentSlashes"); type Kind = ::cxx::kind::Trivial; } impl DocCommentSlashes { @@ -137,7 +137,7 @@ pub mod doc_comment_slashes { /// * with slashes and bang #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DocCommentBang +///CRUBIT_ANNOTATE: cpp_type=:: DocCommentBang pub struct DocCommentBang { /// A field pub i: ::ffi_11::c_int, @@ -145,7 +145,7 @@ pub struct DocCommentBang { impl !Send for DocCommentBang {} impl !Sync for DocCommentBang {} unsafe impl ::cxx::ExternType for DocCommentBang { - type Id = ::cxx::type_id!("DocCommentBang"); + type Id = ::cxx::type_id!(":: DocCommentBang"); type Kind = ::cxx::kind::Trivial; } @@ -185,7 +185,7 @@ impl Default for DocCommentBang { /// with two stars #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=MultilineCommentTwoStars +///CRUBIT_ANNOTATE: cpp_type=:: MultilineCommentTwoStars pub struct MultilineCommentTwoStars { /// A field pub i: ::ffi_11::c_int, @@ -193,7 +193,7 @@ pub struct MultilineCommentTwoStars { impl !Send for MultilineCommentTwoStars {} impl !Sync for MultilineCommentTwoStars {} unsafe impl ::cxx::ExternType for MultilineCommentTwoStars { - type Id = ::cxx::type_id!("MultilineCommentTwoStars"); + type Id = ::cxx::type_id!(":: MultilineCommentTwoStars"); type Kind = ::cxx::kind::Trivial; } @@ -233,7 +233,7 @@ impl Default for MultilineCommentTwoStars { /// * with two slashes #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=LineComment +///CRUBIT_ANNOTATE: cpp_type=:: LineComment pub struct LineComment { /// A field pub i: ::ffi_11::c_int, @@ -241,7 +241,7 @@ pub struct LineComment { impl !Send for LineComment {} impl !Sync for LineComment {} unsafe impl ::cxx::ExternType for LineComment { - type Id = ::cxx::type_id!("LineComment"); + type Id = ::cxx::type_id!(":: LineComment"); type Kind = ::cxx::kind::Trivial; } @@ -281,7 +281,7 @@ impl Default for LineComment { /// with one star #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=MultilineOneStar +///CRUBIT_ANNOTATE: cpp_type=:: MultilineOneStar pub struct MultilineOneStar { /// A field pub i: ::ffi_11::c_int, @@ -289,7 +289,7 @@ pub struct MultilineOneStar { impl !Send for MultilineOneStar {} impl !Sync for MultilineOneStar {} unsafe impl ::cxx::ExternType for MultilineOneStar { - type Id = ::cxx::type_id!("MultilineOneStar"); + type Id = ::cxx::type_id!(":: MultilineOneStar"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc index d8f1b1262..22c522f17 100644 --- a/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/doc_comment_rs_api_impl.cc @@ -18,9 +18,9 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct DocCommentSlashes) == 4); -static_assert(alignof(struct DocCommentSlashes) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct DocCommentSlashes) == 0); +static_assert(CRUBIT_SIZEOF(struct ::DocCommentSlashes) == 4); +static_assert(alignof(struct ::DocCommentSlashes) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::DocCommentSlashes) == 0); static_assert((int (::DocCommentSlashes::*)() const) & ::DocCommentSlashes::get_field_value); @@ -30,42 +30,43 @@ static_assert((void (::DocCommentSlashes::*)(int)) & static_assert((int (*)()) & ::DocCommentSlashes::static_method); -static_assert(CRUBIT_SIZEOF(struct DocCommentBang) == 4); -static_assert(alignof(struct DocCommentBang) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct DocCommentBang) == 0); +static_assert(CRUBIT_SIZEOF(struct ::DocCommentBang) == 4); +static_assert(alignof(struct ::DocCommentBang) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::DocCommentBang) == 0); extern "C" void __rust_thunk___ZN14DocCommentBangC1Ev( - struct DocCommentBang* __this) { + struct ::DocCommentBang* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct MultilineCommentTwoStars) == 4); -static_assert(alignof(struct MultilineCommentTwoStars) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct MultilineCommentTwoStars) == 0); +static_assert(CRUBIT_SIZEOF(struct ::MultilineCommentTwoStars) == 4); +static_assert(alignof(struct ::MultilineCommentTwoStars) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::MultilineCommentTwoStars) == 0); extern "C" void __rust_thunk___ZN24MultilineCommentTwoStarsC1Ev( - struct MultilineCommentTwoStars* __this) { + struct ::MultilineCommentTwoStars* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct LineComment) == 4); -static_assert(alignof(struct LineComment) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct LineComment) == 0); +static_assert(CRUBIT_SIZEOF(struct ::LineComment) == 4); +static_assert(alignof(struct ::LineComment) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::LineComment) == 0); -extern "C" void __rust_thunk___ZN11LineCommentC1Ev(struct LineComment* __this) { +extern "C" void __rust_thunk___ZN11LineCommentC1Ev( + struct ::LineComment* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct MultilineOneStar) == 4); -static_assert(alignof(struct MultilineOneStar) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct MultilineOneStar) == 0); +static_assert(CRUBIT_SIZEOF(struct ::MultilineOneStar) == 4); +static_assert(alignof(struct ::MultilineOneStar) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::MultilineOneStar) == 0); extern "C" void __rust_thunk___ZN16MultilineOneStarC1Ev( - struct MultilineOneStar* __this) { + struct ::MultilineOneStar* __this) { crubit::construct_at(__this); } -extern "C" int __rust_thunk___Z3foov() { return foo(); } +extern "C" int __rust_thunk___Z3foov() { return ::foo(); } static_assert((int (*)()) & ::foo); 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 b4ae50cc1..cad449fe3 100644 --- a/rs_bindings_from_cc/test/golden/enums_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/enums_rs_api.rs @@ -16,7 +16,7 @@ #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=Color +///CRUBIT_ANNOTATE: cpp_type=:: Color pub struct Color(::ffi_11::c_uint); impl Color { pub const kRed: Color = Color(::ffi_11::new_c_uint(0)); @@ -36,7 +36,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EnumToRename +///CRUBIT_ANNOTATE: cpp_type=:: EnumToRename pub struct RenamedEnum(::ffi_11::c_uint); impl RenamedEnum {} impl From<::ffi_11::c_uint> for RenamedEnum { @@ -52,7 +52,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EnumWithRenamedVariants +///CRUBIT_ANNOTATE: cpp_type=:: EnumWithRenamedVariants pub struct EnumWithRenamedVariants(::ffi_11::c_uint); impl EnumWithRenamedVariants { pub const FOO: EnumWithRenamedVariants = EnumWithRenamedVariants(::ffi_11::new_c_uint(0)); @@ -71,7 +71,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=Empty +///CRUBIT_ANNOTATE: cpp_type=:: Empty pub struct Empty(::ffi_11::c_uint); impl Empty {} impl From<::ffi_11::c_uint> for Empty { @@ -87,7 +87,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EmptyBool +///CRUBIT_ANNOTATE: cpp_type=:: EmptyBool pub struct EmptyBool(bool); impl EmptyBool {} impl From for EmptyBool { @@ -103,7 +103,7 @@ impl From for bool { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EmptyInt +///CRUBIT_ANNOTATE: cpp_type=:: EmptyInt pub struct EmptyInt(::ffi_11::c_uint); impl EmptyInt {} impl From<::ffi_11::c_uint> for EmptyInt { @@ -119,7 +119,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EmptyChar +///CRUBIT_ANNOTATE: cpp_type=:: EmptyChar pub struct EmptyChar(::ffi_11::c_char); impl EmptyChar {} impl From<::ffi_11::c_char> for EmptyChar { @@ -135,7 +135,7 @@ impl From for ::ffi_11::c_char { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=NonEmptyBool +///CRUBIT_ANNOTATE: cpp_type=:: NonEmptyBool pub struct NonEmptyBool(bool); impl NonEmptyBool { pub const kBool1: NonEmptyBool = NonEmptyBool(false); @@ -154,7 +154,7 @@ impl From for bool { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=NonEmptyInt +///CRUBIT_ANNOTATE: cpp_type=:: NonEmptyInt pub struct NonEmptyInt(::ffi_11::c_uint); impl NonEmptyInt { pub const kInt1: NonEmptyInt = NonEmptyInt(::ffi_11::new_c_uint(0)); @@ -173,7 +173,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=NonEmptyChar +///CRUBIT_ANNOTATE: cpp_type=:: NonEmptyChar pub struct NonEmptyChar(::ffi_11::c_char); impl NonEmptyChar { pub const kChar1: NonEmptyChar = NonEmptyChar(::ffi_11::new_c_char(0 as u8)); @@ -192,7 +192,7 @@ impl From for ::ffi_11::c_char { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EmptyClass +///CRUBIT_ANNOTATE: cpp_type=:: EmptyClass pub struct EmptyClass(::ffi_11::c_int); impl EmptyClass {} impl From<::ffi_11::c_int> for EmptyClass { @@ -208,7 +208,7 @@ impl From for ::ffi_11::c_int { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EmptyBoolClass +///CRUBIT_ANNOTATE: cpp_type=:: EmptyBoolClass pub struct EmptyBoolClass(bool); impl EmptyBoolClass {} impl From for EmptyBoolClass { @@ -224,7 +224,7 @@ impl From for bool { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EmptyIntClass +///CRUBIT_ANNOTATE: cpp_type=:: EmptyIntClass pub struct EmptyIntClass(::ffi_11::c_int); impl EmptyIntClass {} impl From<::ffi_11::c_int> for EmptyIntClass { @@ -240,7 +240,7 @@ impl From for ::ffi_11::c_int { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EmptyCharClass +///CRUBIT_ANNOTATE: cpp_type=:: EmptyCharClass pub struct EmptyCharClass(::ffi_11::c_char); impl EmptyCharClass {} impl From<::ffi_11::c_char> for EmptyCharClass { @@ -256,7 +256,7 @@ impl From for ::ffi_11::c_char { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=NonEmptyBoolClass +///CRUBIT_ANNOTATE: cpp_type=:: NonEmptyBoolClass pub struct NonEmptyBoolClass(bool); impl NonEmptyBoolClass { pub const k1: NonEmptyBoolClass = NonEmptyBoolClass(false); @@ -275,7 +275,7 @@ impl From for bool { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=NonEmptyIntClass +///CRUBIT_ANNOTATE: cpp_type=:: NonEmptyIntClass pub struct NonEmptyIntClass(::ffi_11::c_uint); impl NonEmptyIntClass { pub const k1: NonEmptyIntClass = NonEmptyIntClass(::ffi_11::new_c_uint(0)); @@ -294,7 +294,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=NonEmptyCharClass +///CRUBIT_ANNOTATE: cpp_type=:: NonEmptyCharClass pub struct NonEmptyCharClass(::ffi_11::c_char); impl NonEmptyCharClass { pub const k1: NonEmptyCharClass = NonEmptyCharClass(::ffi_11::new_c_char(0 as u8)); 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 b0b7b417b..031108e9d 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=type +///CRUBIT_ANNOTATE: cpp_type=:: type pub struct r#type { pub r#dyn: ::ffi_11::c_int, } impl !Send for r#type {} impl !Sync for r#type {} unsafe impl ::cxx::ExternType for r#type { - type Id = ::cxx::type_id!("type"); + type Id = ::cxx::type_id!(":: type"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc index c81590ff7..1585601ef 100644 --- a/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/escaping_keywords_rs_api_impl.cc @@ -18,11 +18,11 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct type) == 4); -static_assert(alignof(struct type) == 4); -static_assert(CRUBIT_OFFSET_OF(dyn, struct type) == 0); +static_assert(CRUBIT_SIZEOF(struct ::type) == 4); +static_assert(alignof(struct ::type) == 4); +static_assert(CRUBIT_OFFSET_OF(dyn, struct ::type) == 0); -extern "C" void __rust_thunk___ZN4typeC1Ev(struct type* __this) { +extern "C" void __rust_thunk___ZN4typeC1Ev(struct ::type* __this) { crubit::construct_at(__this); } 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 34b5a5e37..5e8390b78 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeClass +///CRUBIT_ANNOTATE: cpp_type=:: SomeClass pub struct SomeClass { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeClass {} impl !Sync for SomeClass {} unsafe impl ::cxx::ExternType for SomeClass { - type Id = ::cxx::type_id!("SomeClass"); + type Id = ::cxx::type_id!(":: SomeClass"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/friend_functions_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/friend_functions_rs_api_impl.cc index 887bf3640..5e724716f 100644 --- a/rs_bindings_from_cc/test/golden/friend_functions_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/friend_functions_rs_api_impl.cc @@ -18,16 +18,16 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class SomeClass) == 1); -static_assert(alignof(class SomeClass) == 1); +static_assert(sizeof(class ::SomeClass) == 1); +static_assert(alignof(class ::SomeClass) == 1); -extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class SomeClass* __this) { +extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class ::SomeClass* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___Z11visible_val9SomeClass( - class SomeClass* __param_0) { - visible_val(std::move(*__param_0)); + class ::SomeClass* __param_0) { + ::visible_val(std::move(*__param_0)); } #pragma clang diagnostic pop 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 312fa1bf2..26e2edc95 100644 --- a/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs @@ -19,14 +19,14 @@ /// objects, even if the POD type is potentially-overlapping. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Base0 +///CRUBIT_ANNOTATE: cpp_type=:: Base0 pub struct Base0 { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Base0 {} impl !Sync for Base0 {} unsafe impl ::cxx::ExternType for Base0 { - type Id = ::cxx::type_id!("Base0"); + type Id = ::cxx::type_id!(":: Base0"); type Kind = ::cxx::kind::Trivial; } @@ -63,7 +63,7 @@ impl Default for Base0 { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=Base1 +///CRUBIT_ANNOTATE: cpp_type=:: Base1 pub struct Base1 { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -76,7 +76,7 @@ pub struct Base1 { impl !Send for Base1 {} impl !Sync for Base1 {} unsafe impl ::cxx::ExternType for Base1 { - type Id = ::cxx::type_id!("Base1"); + type Id = ::cxx::type_id!(":: Base1"); type Kind = ::cxx::kind::Trivial; } @@ -113,7 +113,7 @@ impl Default for Base1 { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(2))] -///CRUBIT_ANNOTATE: cpp_type=Base2 +///CRUBIT_ANNOTATE: cpp_type=:: Base2 pub struct Base2 { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -123,7 +123,7 @@ pub struct Base2 { impl !Send for Base2 {} impl !Sync for Base2 {} unsafe impl ::cxx::ExternType for Base2 { - type Id = ::cxx::type_id!("Base2"); + type Id = ::cxx::type_id!(":: Base2"); type Kind = ::cxx::kind::Trivial; } @@ -160,7 +160,7 @@ impl Default for Base2 { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=Derived +///CRUBIT_ANNOTATE: cpp_type=:: Derived pub struct Derived { __non_field_data: [::core::mem::MaybeUninit; 12], pub derived_1: ::ffi_11::c_char, @@ -168,7 +168,7 @@ pub struct Derived { impl !Send for Derived {} impl !Sync for Derived {} unsafe impl ::cxx::ExternType for Derived { - type Id = ::cxx::type_id!("Derived"); + type Id = ::cxx::type_id!(":: Derived"); type Kind = ::cxx::kind::Trivial; } @@ -205,14 +205,14 @@ impl Default for Derived { #[::ctor::recursively_pinned] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=VirtualBase1 +///CRUBIT_ANNOTATE: cpp_type=:: VirtualBase1 pub struct VirtualBase1 { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 24], } impl !Send for VirtualBase1 {} impl !Sync for VirtualBase1 {} unsafe impl ::cxx::ExternType for VirtualBase1 { - type Id = ::cxx::type_id!("VirtualBase1"); + type Id = ::cxx::type_id!(":: VirtualBase1"); type Kind = ::cxx::kind::Opaque; } @@ -254,14 +254,14 @@ impl ::ctor::CtorNew<()> for VirtualBase1 { #[::ctor::recursively_pinned] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=VirtualBase2 +///CRUBIT_ANNOTATE: cpp_type=:: VirtualBase2 pub struct VirtualBase2 { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 24], } impl !Send for VirtualBase2 {} impl !Sync for VirtualBase2 {} unsafe impl ::cxx::ExternType for VirtualBase2 { - type Id = ::cxx::type_id!("VirtualBase2"); + type Id = ::cxx::type_id!(":: VirtualBase2"); type Kind = ::cxx::kind::Opaque; } @@ -303,14 +303,14 @@ impl ::ctor::CtorNew<()> for VirtualBase2 { #[::ctor::recursively_pinned] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=VirtualDerived +///CRUBIT_ANNOTATE: cpp_type=:: VirtualDerived pub struct VirtualDerived { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 32], } impl !Send for VirtualDerived {} impl !Sync for VirtualDerived {} unsafe impl ::cxx::ExternType for VirtualDerived { - type Id = ::cxx::type_id!("VirtualDerived"); + type Id = ::cxx::type_id!(":: VirtualDerived"); type Kind = ::cxx::kind::Opaque; } @@ -352,14 +352,14 @@ impl ::ctor::CtorNew<()> for VirtualDerived { #[::ctor::recursively_pinned] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=MyAbstractClass +///CRUBIT_ANNOTATE: cpp_type=:: MyAbstractClass pub struct MyAbstractClass { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], } impl !Send for MyAbstractClass {} impl !Sync for MyAbstractClass {} unsafe impl ::cxx::ExternType for MyAbstractClass { - type Id = ::cxx::type_id!("MyAbstractClass"); + type Id = ::cxx::type_id!(":: MyAbstractClass"); type Kind = ::cxx::kind::Opaque; } @@ -378,14 +378,14 @@ unsafe impl ::cxx::ExternType for MyAbstractClass { /// Method inheritance #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=MethodBase1 +///CRUBIT_ANNOTATE: cpp_type=:: MethodBase1 pub struct MethodBase1 { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for MethodBase1 {} impl !Sync for MethodBase1 {} unsafe impl ::cxx::ExternType for MethodBase1 { - type Id = ::cxx::type_id!("MethodBase1"); + type Id = ::cxx::type_id!(":: MethodBase1"); type Kind = ::cxx::kind::Trivial; } impl MethodBase1 { @@ -470,14 +470,14 @@ pub mod method_base1 { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=MethodBase2 +///CRUBIT_ANNOTATE: cpp_type=:: MethodBase2 pub struct MethodBase2 { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for MethodBase2 {} impl !Sync for MethodBase2 {} unsafe impl ::cxx::ExternType for MethodBase2 { - type Id = ::cxx::type_id!("MethodBase2"); + type Id = ::cxx::type_id!(":: MethodBase2"); type Kind = ::cxx::kind::Trivial; } impl MethodBase2 { @@ -535,14 +535,14 @@ pub mod method_base2 { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=MethodDerived +///CRUBIT_ANNOTATE: cpp_type=:: MethodDerived pub struct MethodDerived { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for MethodDerived {} impl !Sync for MethodDerived {} unsafe impl ::cxx::ExternType for MethodDerived { - type Id = ::cxx::type_id!("MethodDerived"); + type Id = ::cxx::type_id!(":: MethodDerived"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc index 63d2bd5ae..ae27f0f37 100644 --- a/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/inheritance_rs_api_impl.cc @@ -18,82 +18,84 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class Base0) == 1); -static_assert(alignof(class Base0) == 1); +static_assert(sizeof(class ::Base0) == 1); +static_assert(alignof(class ::Base0) == 1); -extern "C" void __rust_thunk___ZN5Base0C1Ev(class Base0* __this) { +extern "C" void __rust_thunk___ZN5Base0C1Ev(class ::Base0* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class Base1) == 16); -static_assert(alignof(class Base1) == 8); +static_assert(CRUBIT_SIZEOF(class ::Base1) == 16); +static_assert(alignof(class ::Base1) == 8); -extern "C" void __rust_thunk___ZN5Base1C1Ev(class Base1* __this) { +extern "C" void __rust_thunk___ZN5Base1C1Ev(class ::Base1* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class Base2) == 2); -static_assert(alignof(class Base2) == 2); +static_assert(CRUBIT_SIZEOF(class ::Base2) == 2); +static_assert(alignof(class ::Base2) == 2); -extern "C" void __rust_thunk___ZN5Base2C1Ev(class Base2* __this) { +extern "C" void __rust_thunk___ZN5Base2C1Ev(class ::Base2* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct Derived) == 16); -static_assert(alignof(struct Derived) == 8); -static_assert(CRUBIT_OFFSET_OF(derived_1, struct Derived) == 12); +static_assert(CRUBIT_SIZEOF(struct ::Derived) == 16); +static_assert(alignof(struct ::Derived) == 8); +static_assert(CRUBIT_OFFSET_OF(derived_1, struct ::Derived) == 12); -extern "C" void __rust_thunk___ZN7DerivedC1Ev(struct Derived* __this) { +extern "C" void __rust_thunk___ZN7DerivedC1Ev(struct ::Derived* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class VirtualBase1) == 24); -static_assert(alignof(class VirtualBase1) == 8); +static_assert(CRUBIT_SIZEOF(class ::VirtualBase1) == 24); +static_assert(alignof(class ::VirtualBase1) == 8); extern "C" void __rust_thunk___ZN12VirtualBase1C1Ev( - class VirtualBase1* __this) { + class ::VirtualBase1* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class VirtualBase2) == 24); -static_assert(alignof(class VirtualBase2) == 8); +static_assert(CRUBIT_SIZEOF(class ::VirtualBase2) == 24); +static_assert(alignof(class ::VirtualBase2) == 8); extern "C" void __rust_thunk___ZN12VirtualBase2C1Ev( - class VirtualBase2* __this) { + class ::VirtualBase2* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class VirtualDerived) == 32); -static_assert(alignof(class VirtualDerived) == 8); +static_assert(CRUBIT_SIZEOF(class ::VirtualDerived) == 32); +static_assert(alignof(class ::VirtualDerived) == 8); extern "C" void __rust_thunk___ZN14VirtualDerivedC1Ev( - class VirtualDerived* __this) { + class ::VirtualDerived* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class MyAbstractClass) == 8); -static_assert(alignof(class MyAbstractClass) == 8); +static_assert(CRUBIT_SIZEOF(class ::MyAbstractClass) == 8); +static_assert(alignof(class ::MyAbstractClass) == 8); -static_assert(sizeof(class MethodBase1) == 1); -static_assert(alignof(class MethodBase1) == 1); +static_assert(sizeof(class ::MethodBase1) == 1); +static_assert(alignof(class ::MethodBase1) == 1); -extern "C" void __rust_thunk___ZN11MethodBase1C1Ev(class MethodBase1* __this) { +extern "C" void __rust_thunk___ZN11MethodBase1C1Ev( + class ::MethodBase1* __this) { crubit::construct_at(__this); } static_assert((void (::MethodBase1::*)()) & ::MethodBase1::Public); -static_assert((void (::MethodBase1::*)(class MethodBase1 const*)) & +static_assert((void (::MethodBase1::*)(class ::MethodBase1 const*)) & ::MethodBase1::Equals); static_assert((void (::MethodBase1::*)()) & ::MethodBase1::Colliding1); static_assert((void (::MethodBase1::*)()) & ::MethodBase1::Colliding2); -static_assert(sizeof(class MethodBase2) == 1); -static_assert(alignof(class MethodBase2) == 1); +static_assert(sizeof(class ::MethodBase2) == 1); +static_assert(alignof(class ::MethodBase2) == 1); -extern "C" void __rust_thunk___ZN11MethodBase2C1Ev(class MethodBase2* __this) { +extern "C" void __rust_thunk___ZN11MethodBase2C1Ev( + class ::MethodBase2* __this) { crubit::construct_at(__this); } @@ -101,11 +103,11 @@ static_assert((void (::MethodBase2::*)()) & ::MethodBase2::Colliding1); static_assert((void (::MethodBase2::*)()) & ::MethodBase2::Colliding2); -static_assert(sizeof(class MethodDerived) == 1); -static_assert(alignof(class MethodDerived) == 1); +static_assert(sizeof(class ::MethodDerived) == 1); +static_assert(alignof(class ::MethodDerived) == 1); extern "C" void __rust_thunk___ZN13MethodDerivedC1Ev( - class MethodDerived* __this) { + class ::MethodDerived* __this) { crubit::construct_at(__this); } 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 00f9d619a..8ec074cd8 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=FirstStruct +///CRUBIT_ANNOTATE: cpp_type=:: FirstStruct pub struct FirstStruct { pub field: ::ffi_11::c_int, } impl !Send for FirstStruct {} impl !Sync for FirstStruct {} unsafe impl ::cxx::ExternType for FirstStruct { - type Id = ::cxx::type_id!("FirstStruct"); + type Id = ::cxx::type_id!(":: FirstStruct"); type Kind = ::cxx::kind::Trivial; } @@ -45,14 +45,14 @@ pub fn first_func() -> ::ffi_11::c_int { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SecondStruct +///CRUBIT_ANNOTATE: cpp_type=:: SecondStruct pub struct SecondStruct { pub field: ::ffi_11::c_int, } impl !Send for SecondStruct {} impl !Sync for SecondStruct {} unsafe impl ::cxx::ExternType for SecondStruct { - type Id = ::cxx::type_id!("SecondStruct"); + type Id = ::cxx::type_id!(":: SecondStruct"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc index a223c8161..8a2312167 100644 --- a/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/item_order_rs_api_impl.cc @@ -18,28 +18,29 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct FirstStruct) == 4); -static_assert(alignof(struct FirstStruct) == 4); -static_assert(CRUBIT_OFFSET_OF(field, struct FirstStruct) == 0); +static_assert(CRUBIT_SIZEOF(struct ::FirstStruct) == 4); +static_assert(alignof(struct ::FirstStruct) == 4); +static_assert(CRUBIT_OFFSET_OF(field, struct ::FirstStruct) == 0); -extern "C" void __rust_thunk___ZN11FirstStructC1Ev(struct FirstStruct* __this) { +extern "C" void __rust_thunk___ZN11FirstStructC1Ev( + struct ::FirstStruct* __this) { crubit::construct_at(__this); } -extern "C" int __rust_thunk___Z10first_funcv() { return first_func(); } +extern "C" int __rust_thunk___Z10first_funcv() { return ::first_func(); } static_assert((int (*)()) & ::first_func); -static_assert(CRUBIT_SIZEOF(struct SecondStruct) == 4); -static_assert(alignof(struct SecondStruct) == 4); -static_assert(CRUBIT_OFFSET_OF(field, struct SecondStruct) == 0); +static_assert(CRUBIT_SIZEOF(struct ::SecondStruct) == 4); +static_assert(alignof(struct ::SecondStruct) == 4); +static_assert(CRUBIT_OFFSET_OF(field, struct ::SecondStruct) == 0); extern "C" void __rust_thunk___ZN12SecondStructC1Ev( - struct SecondStruct* __this) { + struct ::SecondStruct* __this) { crubit::construct_at(__this); } -extern "C" int __rust_thunk___Z11second_funcv() { return second_func(); } +extern "C" int __rust_thunk___Z11second_funcv() { return ::second_func(); } static_assert((int (*)()) & ::second_func); 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 ab3d812e5..89301fabf 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Struct +///CRUBIT_ANNOTATE: cpp_type=:: Struct pub struct Struct { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Struct {} impl !Sync for Struct {} unsafe impl ::cxx::ExternType for Struct { - type Id = ::cxx::type_id!("Struct"); + type Id = ::cxx::type_id!(":: Struct"); type Kind = ::cxx::kind::Trivial; } impl Struct { @@ -77,14 +77,14 @@ pub mod r#struct { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Class +///CRUBIT_ANNOTATE: cpp_type=:: Class pub struct Class { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Class {} impl !Sync for Class {} unsafe impl ::cxx::ExternType for Class { - type Id = ::cxx::type_id!("Class"); + type Id = ::cxx::type_id!(":: Class"); type Kind = ::cxx::kind::Trivial; } impl Class { diff --git a/rs_bindings_from_cc/test/golden/method_access_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/method_access_rs_api_impl.cc index 377bc6704..ee44d6f42 100644 --- a/rs_bindings_from_cc/test/golden/method_access_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/method_access_rs_api_impl.cc @@ -18,10 +18,10 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct Struct) == 1); -static_assert(alignof(struct Struct) == 1); +static_assert(sizeof(struct ::Struct) == 1); +static_assert(alignof(struct ::Struct) == 1); -extern "C" void __rust_thunk___ZN6StructC1Ev(struct Struct* __this) { +extern "C" void __rust_thunk___ZN6StructC1Ev(struct ::Struct* __this) { crubit::construct_at(__this); } @@ -29,10 +29,10 @@ static_assert((void (::Struct::*)()) & ::Struct::AccessNone); static_assert((void (::Struct::*)()) & ::Struct::AccessPublic); -static_assert(sizeof(class Class) == 1); -static_assert(alignof(class Class) == 1); +static_assert(sizeof(class ::Class) == 1); +static_assert(alignof(class ::Class) == 1); -extern "C" void __rust_thunk___ZN5ClassC1Ev(class Class* __this) { +extern "C" void __rust_thunk___ZN5ClassC1Ev(class ::Class* __this) { crubit::construct_at(__this); } 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 e595dcca5..ac08d215d 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Noninline +///CRUBIT_ANNOTATE: cpp_type=:: Noninline pub struct Noninline { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Noninline {} impl !Sync for Noninline {} unsafe impl ::cxx::ExternType for Noninline { - type Id = ::cxx::type_id!("Noninline"); + type Id = ::cxx::type_id!(":: Noninline"); type Kind = ::cxx::kind::Trivial; } impl Noninline { @@ -125,14 +125,14 @@ pub mod noninline { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Inline +///CRUBIT_ANNOTATE: cpp_type=:: Inline pub struct Inline { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inline {} impl !Sync for Inline {} unsafe impl ::cxx::ExternType for Inline { - type Id = ::cxx::type_id!("Inline"); + type Id = ::cxx::type_id!(":: Inline"); type Kind = ::cxx::kind::Trivial; } impl Inline { diff --git a/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api_impl.cc index 5215bfc65..2564c5b58 100644 --- a/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/method_qualifiers_rs_api_impl.cc @@ -18,10 +18,10 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct Noninline) == 1); -static_assert(alignof(struct Noninline) == 1); +static_assert(sizeof(struct ::Noninline) == 1); +static_assert(alignof(struct ::Noninline) == 1); -extern "C" void __rust_thunk___ZN9NoninlineC1Ev(struct Noninline* __this) { +extern "C" void __rust_thunk___ZN9NoninlineC1Ev(struct ::Noninline* __this) { crubit::construct_at(__this); } @@ -35,43 +35,43 @@ static_assert((void (::Noninline::*)() &&)&::Noninline::RvalueMethod); static_assert((void (::Noninline::*)() const&&)&::Noninline::RvalueMethodConst); -static_assert(sizeof(struct Inline) == 1); -static_assert(alignof(struct Inline) == 1); +static_assert(sizeof(struct ::Inline) == 1); +static_assert(alignof(struct ::Inline) == 1); -extern "C" void __rust_thunk___ZN6InlineC1Ev(struct Inline* __this) { +extern "C" void __rust_thunk___ZN6InlineC1Ev(struct ::Inline* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN6Inline17UnqualifiedMethodEv( - struct Inline* __this) { + struct ::Inline* __this) { __this->UnqualifiedMethod(); } static_assert((void (::Inline::*)()) & ::Inline::UnqualifiedMethod); extern "C" void __rust_thunk___ZNR6Inline12LvalueMethodEv( - struct Inline* __this) { + struct ::Inline* __this) { __this->LvalueMethod(); } static_assert((void (::Inline::*)() &)&::Inline::LvalueMethod); extern "C" void __rust_thunk___ZNKR6Inline17LvalueMethodConstEv( - struct Inline const* __this) { + struct ::Inline const* __this) { __this->LvalueMethodConst(); } static_assert((void (::Inline::*)() const&)&::Inline::LvalueMethodConst); extern "C" void __rust_thunk___ZNO6Inline12RvalueMethodEv( - struct Inline* __this) { + struct ::Inline* __this) { std::move(*__this).RvalueMethod(); } static_assert((void (::Inline::*)() &&)&::Inline::RvalueMethod); extern "C" void __rust_thunk___ZNKO6Inline17RvalueMethodConstEv( - struct Inline const* __this) { + struct ::Inline const* __this) { std::move(*__this).RvalueMethodConst(); } 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 5b899474b..8a944d86f 100644 --- a/rs_bindings_from_cc/test/golden/namespace_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/namespace_rs_api.rs @@ -17,14 +17,14 @@ pub mod test_namespace_bindings { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings :: S + ///CRUBIT_ANNOTATE: cpp_type=:: test_namespace_bindings :: S pub struct S { pub i: ::ffi_11::c_int, } impl !Send for S {} impl !Sync for S {} unsafe impl ::cxx::ExternType for S { - type Id = ::cxx::type_id!("test_namespace_bindings :: S"); + type Id = ::cxx::type_id!(":: test_namespace_bindings :: S"); type Kind = ::cxx::kind::Trivial; } @@ -94,14 +94,14 @@ pub mod test_namespace_bindings_reopened { pub mod inner { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings_reopened :: inner :: S + ///CRUBIT_ANNOTATE: cpp_type=:: test_namespace_bindings_reopened :: inner :: S pub struct S { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for S {} impl !Sync for S {} unsafe impl ::cxx::ExternType for S { - type Id = ::cxx::type_id!("test_namespace_bindings_reopened :: inner :: S"); + type Id = ::cxx::type_id!(":: test_namespace_bindings_reopened :: inner :: S"); type Kind = ::cxx::kind::Trivial; } @@ -137,7 +137,7 @@ pub mod test_namespace_bindings_inline { pub mod inner { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings_inline :: inner :: StructInInlineNamespace + ///CRUBIT_ANNOTATE: cpp_type=:: test_namespace_bindings_inline :: inner :: StructInInlineNamespace pub struct StructInInlineNamespace { __non_field_data: [::core::mem::MaybeUninit; 1], } @@ -145,7 +145,7 @@ pub mod test_namespace_bindings_inline { impl !Sync for StructInInlineNamespace {} unsafe impl ::cxx::ExternType for StructInInlineNamespace { type Id = ::cxx::type_id!( - "test_namespace_bindings_inline :: inner :: StructInInlineNamespace" + ":: test_namespace_bindings_inline :: inner :: StructInInlineNamespace" ); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc index 9db5ae23e..07e3307bf 100644 --- a/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc @@ -18,26 +18,26 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct test_namespace_bindings::S) == 4); -static_assert(alignof(struct test_namespace_bindings::S) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct test_namespace_bindings::S) == 0); +static_assert(CRUBIT_SIZEOF(struct ::test_namespace_bindings::S) == 4); +static_assert(alignof(struct ::test_namespace_bindings::S) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::test_namespace_bindings::S) == 0); extern "C" void __rust_thunk___ZN23test_namespace_bindings1SC1Ev( - struct test_namespace_bindings::S* __this) { + struct ::test_namespace_bindings::S* __this) { crubit::construct_at(__this); } extern "C" int __rust_thunk___ZN23test_namespace_bindings1fENS_1SE( - struct test_namespace_bindings::S* s) { - return test_namespace_bindings::f(std::move(*s)); + struct ::test_namespace_bindings::S* s) { + return ::test_namespace_bindings::f(std::move(*s)); } -static_assert((int (*)(struct test_namespace_bindings::S)) & +static_assert((int (*)(struct ::test_namespace_bindings::S)) & ::test_namespace_bindings::f); extern "C" void __rust_thunk___ZN23test_namespace_bindings15inline_functionEv() { - test_namespace_bindings::inline_function(); + ::test_namespace_bindings::inline_function(); } static_assert((void (*)()) & ::test_namespace_bindings::inline_function); @@ -45,22 +45,23 @@ static_assert((void (*)()) & ::test_namespace_bindings::inline_function); static_assert((void (*)()) & ::test_namespace_bindings::inner::i); extern "C" void __rust_thunk___Z8identityN23test_namespace_bindings1SE( - struct test_namespace_bindings::S* __return, - struct test_namespace_bindings::S* s) { - new (__return) auto(identity(std::move(*s))); + struct ::test_namespace_bindings::S* __return, + struct ::test_namespace_bindings::S* s) { + new (__return) auto(::identity(std::move(*s))); } -static_assert( - (struct test_namespace_bindings::S (*)(struct test_namespace_bindings::S)) & - ::identity); +static_assert((struct ::test_namespace_bindings::S (*)( + struct ::test_namespace_bindings::S)) & + ::identity); static_assert((void (*)()) & ::test_namespace_bindings_reopened::x); -static_assert(sizeof(struct test_namespace_bindings_reopened::inner::S) == 1); -static_assert(alignof(struct test_namespace_bindings_reopened::inner::S) == 1); +static_assert(sizeof(struct ::test_namespace_bindings_reopened::inner::S) == 1); +static_assert(alignof(struct ::test_namespace_bindings_reopened::inner::S) == + 1); extern "C" void __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SC1Ev( - struct test_namespace_bindings_reopened::inner::S* __this) { + struct ::test_namespace_bindings_reopened::inner::S* __this) { crubit::construct_at(__this); } @@ -68,46 +69,48 @@ static_assert((void (*)()) & ::test_namespace_bindings_reopened::y); extern "C" void __rust_thunk___ZN32test_namespace_bindings_reopened5inner1zENS0_1SE( - struct test_namespace_bindings_reopened::inner::S* s) { - test_namespace_bindings_reopened::inner::z(std::move(*s)); + struct ::test_namespace_bindings_reopened::inner::S* s) { + ::test_namespace_bindings_reopened::inner::z(std::move(*s)); } -static_assert((void (*)(struct test_namespace_bindings_reopened::inner::S)) & +static_assert((void (*)(struct ::test_namespace_bindings_reopened::inner::S)) & ::test_namespace_bindings_reopened::inner::z); -static_assert(sizeof(struct test_namespace_bindings_inline::inner:: +static_assert(sizeof(struct ::test_namespace_bindings_inline::inner:: StructInInlineNamespace) == 1); -static_assert(alignof(struct test_namespace_bindings_inline::inner:: +static_assert(alignof(struct ::test_namespace_bindings_inline::inner:: StructInInlineNamespace) == 1); extern "C" void __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1Ev( - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* + struct ::test_namespace_bindings_inline::inner::StructInInlineNamespace* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___Z43useStructInInlineNamespaceWithFullQualifierN30test_namespace_bindings_inline5inner23StructInInlineNamespaceE( - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* s) { - useStructInInlineNamespaceWithFullQualifier(std::move(*s)); + struct ::test_namespace_bindings_inline::inner::StructInInlineNamespace* + s) { + ::useStructInInlineNamespaceWithFullQualifier(std::move(*s)); } -static_assert((void (*)(struct test_namespace_bindings_inline::inner:: +static_assert((void (*)(struct ::test_namespace_bindings_inline::inner:: StructInInlineNamespace)) & ::useStructInInlineNamespaceWithFullQualifier); extern "C" void __rust_thunk___Z45useStructInInlineNamespaceSkipInlineQualifierN30test_namespace_bindings_inline5inner23StructInInlineNamespaceE( - struct test_namespace_bindings_inline::inner::StructInInlineNamespace* s) { - useStructInInlineNamespaceSkipInlineQualifier(std::move(*s)); + struct ::test_namespace_bindings_inline::inner::StructInInlineNamespace* + s) { + ::useStructInInlineNamespaceSkipInlineQualifier(std::move(*s)); } -static_assert((void (*)(struct test_namespace_bindings_inline::inner:: +static_assert((void (*)(struct ::test_namespace_bindings_inline::inner:: StructInInlineNamespace)) & ::useStructInInlineNamespaceSkipInlineQualifier); -extern "C" void __rust_thunk___ZN4impl3fooEv() { impl::foo(); } +extern "C" void __rust_thunk___ZN4impl3fooEv() { ::impl::foo(); } static_assert((void (*)()) & ::impl::foo); 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 873afd1d7..c89cb0214 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 @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Foo +///CRUBIT_ANNOTATE: cpp_type=:: Foo pub struct Foo { pub foo: ::ffi_11::c_int, } impl !Send for Foo {} impl !Sync for Foo {} unsafe impl ::cxx::ExternType for Foo { - type Id = ::cxx::type_id!("Foo"); + type Id = ::cxx::type_id!(":: Foo"); type Kind = ::cxx::kind::Trivial; } @@ -41,14 +41,14 @@ impl Default for Foo { pub mod foo { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=Foo :: Bar + ///CRUBIT_ANNOTATE: cpp_type=:: Foo :: Bar pub struct Bar { pub bar: ::ffi_11::c_int, } impl !Send for Bar {} impl !Sync for Bar {} unsafe impl ::cxx::ExternType for Bar { - type Id = ::cxx::type_id!("Foo :: Bar"); + type Id = ::cxx::type_id!(":: Foo :: Bar"); type Kind = ::cxx::kind::Trivial; } @@ -66,14 +66,14 @@ pub mod foo { pub mod bar { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=Foo :: Bar :: Baz + ///CRUBIT_ANNOTATE: cpp_type=:: Foo :: Bar :: Baz pub struct Baz { pub baz: ::ffi_11::c_int, } impl !Send for Baz {} impl !Sync for Baz {} unsafe impl ::cxx::ExternType for Baz { - type Id = ::cxx::type_id!("Foo :: Bar :: Baz"); + type Id = ::cxx::type_id!(":: Foo :: Bar :: Baz"); type Kind = ::cxx::kind::Trivial; } @@ -92,14 +92,14 @@ pub mod foo { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=already_snake_case +///CRUBIT_ANNOTATE: cpp_type=:: already_snake_case pub struct already_snake_case { pub i: crate::already_snake_case_items::Inner, } impl !Send for already_snake_case {} impl !Sync for already_snake_case {} unsafe impl ::cxx::ExternType for already_snake_case { - type Id = ::cxx::type_id!("already_snake_case"); + type Id = ::cxx::type_id!(":: already_snake_case"); type Kind = ::cxx::kind::Trivial; } @@ -117,14 +117,14 @@ impl Default for already_snake_case { pub mod already_snake_case_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=already_snake_case :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: already_snake_case :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("already_snake_case :: Inner"); + type Id = ::cxx::type_id!(":: already_snake_case :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -144,14 +144,14 @@ pub mod already_snake_case_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ConflictingSnakeCaseNames +///CRUBIT_ANNOTATE: cpp_type=:: ConflictingSnakeCaseNames pub struct ConflictingSnakeCaseNames { pub i: crate::conflicting_snake_case_names::Inner, } impl !Send for ConflictingSnakeCaseNames {} impl !Sync for ConflictingSnakeCaseNames {} unsafe impl ::cxx::ExternType for ConflictingSnakeCaseNames { - type Id = ::cxx::type_id!("ConflictingSnakeCaseNames"); + type Id = ::cxx::type_id!(":: ConflictingSnakeCaseNames"); type Kind = ::cxx::kind::Trivial; } @@ -169,14 +169,14 @@ impl Default for ConflictingSnakeCaseNames { pub mod conflicting_snake_case_names { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=ConflictingSnakeCaseNames :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: ConflictingSnakeCaseNames :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("ConflictingSnakeCaseNames :: Inner"); + type Id = ::cxx::type_id!(":: ConflictingSnakeCaseNames :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -196,14 +196,14 @@ pub mod conflicting_snake_case_names { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ConflictingSnakeCaseNames_ +///CRUBIT_ANNOTATE: cpp_type=:: ConflictingSnakeCaseNames_ pub struct ConflictingSnakeCaseNames_ { pub i: crate::conflicting_snake_case_names_items::Inner, } impl !Send for ConflictingSnakeCaseNames_ {} impl !Sync for ConflictingSnakeCaseNames_ {} unsafe impl ::cxx::ExternType for ConflictingSnakeCaseNames_ { - type Id = ::cxx::type_id!("ConflictingSnakeCaseNames_"); + type Id = ::cxx::type_id!(":: ConflictingSnakeCaseNames_"); type Kind = ::cxx::kind::Trivial; } @@ -223,14 +223,14 @@ impl Default for ConflictingSnakeCaseNames_ { pub mod conflicting_snake_case_names_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=ConflictingSnakeCaseNames_ :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: ConflictingSnakeCaseNames_ :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("ConflictingSnakeCaseNames_ :: Inner"); + type Id = ::cxx::type_id!(":: ConflictingSnakeCaseNames_ :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -250,14 +250,14 @@ pub mod conflicting_snake_case_names_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=OnlyOneHasNestedItems +///CRUBIT_ANNOTATE: cpp_type=:: OnlyOneHasNestedItems pub struct OnlyOneHasNestedItems { pub i: crate::only_one_has_nested_items::Inner, } impl !Send for OnlyOneHasNestedItems {} impl !Sync for OnlyOneHasNestedItems {} unsafe impl ::cxx::ExternType for OnlyOneHasNestedItems { - type Id = ::cxx::type_id!("OnlyOneHasNestedItems"); + type Id = ::cxx::type_id!(":: OnlyOneHasNestedItems"); type Kind = ::cxx::kind::Trivial; } @@ -275,14 +275,14 @@ impl Default for OnlyOneHasNestedItems { pub mod only_one_has_nested_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=OnlyOneHasNestedItems :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: OnlyOneHasNestedItems :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("OnlyOneHasNestedItems :: Inner"); + type Id = ::cxx::type_id!(":: OnlyOneHasNestedItems :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -302,14 +302,14 @@ pub mod only_one_has_nested_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=OnlyOneHasNestedItems_ +///CRUBIT_ANNOTATE: cpp_type=:: OnlyOneHasNestedItems_ pub struct OnlyOneHasNestedItems_ { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for OnlyOneHasNestedItems_ {} impl !Sync for OnlyOneHasNestedItems_ {} unsafe impl ::cxx::ExternType for OnlyOneHasNestedItems_ { - type Id = ::cxx::type_id!("OnlyOneHasNestedItems_"); + type Id = ::cxx::type_id!(":: OnlyOneHasNestedItems_"); type Kind = ::cxx::kind::Trivial; } @@ -328,14 +328,14 @@ impl Default for OnlyOneHasNestedItems_ { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SameNameAsNamespace +///CRUBIT_ANNOTATE: cpp_type=:: SameNameAsNamespace pub struct SameNameAsNamespace { pub i: crate::same_name_as_namespace_items::Inner, } impl !Send for SameNameAsNamespace {} impl !Sync for SameNameAsNamespace {} unsafe impl ::cxx::ExternType for SameNameAsNamespace { - type Id = ::cxx::type_id!("SameNameAsNamespace"); + type Id = ::cxx::type_id!(":: SameNameAsNamespace"); type Kind = ::cxx::kind::Trivial; } @@ -353,14 +353,14 @@ impl Default for SameNameAsNamespace { pub mod same_name_as_namespace_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=SameNameAsNamespace :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: SameNameAsNamespace :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("SameNameAsNamespace :: Inner"); + type Id = ::cxx::type_id!(":: SameNameAsNamespace :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -383,14 +383,14 @@ pub mod same_name_as_namespace_items { pub mod same_name_as_namespace { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=same_name_as_namespace :: Foo + ///CRUBIT_ANNOTATE: cpp_type=:: same_name_as_namespace :: Foo pub struct Foo { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Foo {} impl !Sync for Foo {} unsafe impl ::cxx::ExternType for Foo { - type Id = ::cxx::type_id!("same_name_as_namespace :: Foo"); + type Id = ::cxx::type_id!(":: same_name_as_namespace :: Foo"); type Kind = ::cxx::kind::Trivial; } @@ -409,14 +409,14 @@ pub mod same_name_as_namespace { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=same_name_as_namespace :: Bar + ///CRUBIT_ANNOTATE: cpp_type=:: same_name_as_namespace :: Bar pub struct Bar { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Bar {} impl !Sync for Bar {} unsafe impl ::cxx::ExternType for Bar { - type Id = ::cxx::type_id!("same_name_as_namespace :: Bar"); + type Id = ::cxx::type_id!(":: same_name_as_namespace :: Bar"); type Kind = ::cxx::kind::Trivial; } @@ -439,14 +439,14 @@ pub mod same_name_as_namespace { pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: already_snake_case + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: already_snake_case pub struct already_snake_case { pub i: crate::no_longer_top_level::already_snake_case_items::Inner, } impl !Send for already_snake_case {} impl !Sync for already_snake_case {} unsafe impl ::cxx::ExternType for already_snake_case { - type Id = ::cxx::type_id!("no_longer_top_level :: already_snake_case"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: already_snake_case"); type Kind = ::cxx::kind::Trivial; } @@ -466,14 +466,14 @@ pub mod no_longer_top_level { pub mod already_snake_case_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: already_snake_case :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: already_snake_case :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("no_longer_top_level :: already_snake_case :: Inner"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: already_snake_case :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -491,14 +491,14 @@ pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: ConflictingSnakeCaseNames + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: ConflictingSnakeCaseNames pub struct ConflictingSnakeCaseNames { pub i: crate::no_longer_top_level::conflicting_snake_case_names::Inner, } impl !Send for ConflictingSnakeCaseNames {} impl !Sync for ConflictingSnakeCaseNames {} unsafe impl ::cxx::ExternType for ConflictingSnakeCaseNames { - type Id = ::cxx::type_id!("no_longer_top_level :: ConflictingSnakeCaseNames"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: ConflictingSnakeCaseNames"); type Kind = ::cxx::kind::Trivial; } @@ -516,14 +516,15 @@ pub mod no_longer_top_level { pub mod conflicting_snake_case_names { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: ConflictingSnakeCaseNames :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: ConflictingSnakeCaseNames :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("no_longer_top_level :: ConflictingSnakeCaseNames :: Inner"); + type Id = + ::cxx::type_id!(":: no_longer_top_level :: ConflictingSnakeCaseNames :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -541,14 +542,14 @@ pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: ConflictingSnakeCaseNames_ + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: ConflictingSnakeCaseNames_ pub struct ConflictingSnakeCaseNames_ { pub i: crate::no_longer_top_level::conflicting_snake_case_names_items::Inner, } impl !Send for ConflictingSnakeCaseNames_ {} impl !Sync for ConflictingSnakeCaseNames_ {} unsafe impl ::cxx::ExternType for ConflictingSnakeCaseNames_ { - type Id = ::cxx::type_id!("no_longer_top_level :: ConflictingSnakeCaseNames_"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: ConflictingSnakeCaseNames_"); type Kind = ::cxx::kind::Trivial; } @@ -566,14 +567,15 @@ pub mod no_longer_top_level { pub mod conflicting_snake_case_names_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: ConflictingSnakeCaseNames_ :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: ConflictingSnakeCaseNames_ :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("no_longer_top_level :: ConflictingSnakeCaseNames_ :: Inner"); + type Id = + ::cxx::type_id!(":: no_longer_top_level :: ConflictingSnakeCaseNames_ :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -591,14 +593,14 @@ pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: OnlyOneHasNestedItems + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: OnlyOneHasNestedItems pub struct OnlyOneHasNestedItems { pub i: crate::no_longer_top_level::only_one_has_nested_items::Inner, } impl !Send for OnlyOneHasNestedItems {} impl !Sync for OnlyOneHasNestedItems {} unsafe impl ::cxx::ExternType for OnlyOneHasNestedItems { - type Id = ::cxx::type_id!("no_longer_top_level :: OnlyOneHasNestedItems"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: OnlyOneHasNestedItems"); type Kind = ::cxx::kind::Trivial; } @@ -618,14 +620,14 @@ pub mod no_longer_top_level { pub mod only_one_has_nested_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: OnlyOneHasNestedItems :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: OnlyOneHasNestedItems :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("no_longer_top_level :: OnlyOneHasNestedItems :: Inner"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: OnlyOneHasNestedItems :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -643,14 +645,14 @@ pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: OnlyOneHasNestedItems_ + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: OnlyOneHasNestedItems_ pub struct OnlyOneHasNestedItems_ { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for OnlyOneHasNestedItems_ {} impl !Sync for OnlyOneHasNestedItems_ {} unsafe impl ::cxx::ExternType for OnlyOneHasNestedItems_ { - type Id = ::cxx::type_id!("no_longer_top_level :: OnlyOneHasNestedItems_"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: OnlyOneHasNestedItems_"); type Kind = ::cxx::kind::Trivial; } @@ -671,14 +673,14 @@ pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: SameNameAsNamespace + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: SameNameAsNamespace pub struct SameNameAsNamespace { pub i: crate::no_longer_top_level::same_name_as_namespace_items::Inner, } impl !Send for SameNameAsNamespace {} impl !Sync for SameNameAsNamespace {} unsafe impl ::cxx::ExternType for SameNameAsNamespace { - type Id = ::cxx::type_id!("no_longer_top_level :: SameNameAsNamespace"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: SameNameAsNamespace"); type Kind = ::cxx::kind::Trivial; } @@ -698,14 +700,14 @@ pub mod no_longer_top_level { pub mod same_name_as_namespace_items { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: SameNameAsNamespace :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: SameNameAsNamespace :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("no_longer_top_level :: SameNameAsNamespace :: Inner"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: SameNameAsNamespace :: Inner"); type Kind = ::cxx::kind::Trivial; } @@ -726,14 +728,14 @@ pub mod no_longer_top_level { pub mod same_name_as_namespace { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: same_name_as_namespace :: Foo + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: same_name_as_namespace :: Foo pub struct Foo { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Foo {} impl !Sync for Foo {} unsafe impl ::cxx::ExternType for Foo { - type Id = ::cxx::type_id!("no_longer_top_level :: same_name_as_namespace :: Foo"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: same_name_as_namespace :: Foo"); type Kind = ::cxx::kind::Trivial; } @@ -750,14 +752,14 @@ pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=no_longer_top_level :: same_name_as_namespace :: Bar + ///CRUBIT_ANNOTATE: cpp_type=:: no_longer_top_level :: same_name_as_namespace :: Bar pub struct Bar { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Bar {} impl !Sync for Bar {} unsafe impl ::cxx::ExternType for Bar { - type Id = ::cxx::type_id!("no_longer_top_level :: same_name_as_namespace :: Bar"); + type Id = ::cxx::type_id!(":: no_longer_top_level :: same_name_as_namespace :: Bar"); type Kind = ::cxx::kind::Trivial; } @@ -780,14 +782,14 @@ pub mod no_longer_top_level { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ContainsForwardDeclared +///CRUBIT_ANNOTATE: cpp_type=:: ContainsForwardDeclared pub struct ContainsForwardDeclared { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for ContainsForwardDeclared {} impl !Sync for ContainsForwardDeclared {} unsafe impl ::cxx::ExternType for ContainsForwardDeclared { - type Id = ::cxx::type_id!("ContainsForwardDeclared"); + type Id = ::cxx::type_id!(":: ContainsForwardDeclared"); type Kind = ::cxx::kind::Trivial; } @@ -805,14 +807,14 @@ impl Default for ContainsForwardDeclared { pub mod contains_forward_declared { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=ContainsForwardDeclared :: Nested + ///CRUBIT_ANNOTATE: cpp_type=:: ContainsForwardDeclared :: Nested pub struct Nested { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Nested {} impl !Sync for Nested {} unsafe impl ::cxx::ExternType for Nested { - type Id = ::cxx::type_id!("ContainsForwardDeclared :: Nested"); + type Id = ::cxx::type_id!(":: ContainsForwardDeclared :: Nested"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/nested_types_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/nested_types_rs_api_impl.cc index e584fb3c1..6a98dc8e9 100644 --- a/rs_bindings_from_cc/test/golden/nested_types_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/nested_types_rs_api_impl.cc @@ -18,299 +18,306 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct Foo) == 4); -static_assert(alignof(struct Foo) == 4); -static_assert(CRUBIT_OFFSET_OF(foo, struct Foo) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Foo) == 4); +static_assert(alignof(struct ::Foo) == 4); +static_assert(CRUBIT_OFFSET_OF(foo, struct ::Foo) == 0); -extern "C" void __rust_thunk___ZN3FooC1Ev(struct Foo* __this) { +extern "C" void __rust_thunk___ZN3FooC1Ev(struct ::Foo* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct Foo::Bar) == 4); -static_assert(alignof(struct Foo::Bar) == 4); -static_assert(CRUBIT_OFFSET_OF(bar, struct Foo::Bar) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Foo::Bar) == 4); +static_assert(alignof(struct ::Foo::Bar) == 4); +static_assert(CRUBIT_OFFSET_OF(bar, struct ::Foo::Bar) == 0); -extern "C" void __rust_thunk___ZN3Foo3BarC1Ev(struct Foo::Bar* __this) { +extern "C" void __rust_thunk___ZN3Foo3BarC1Ev(struct ::Foo::Bar* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct Foo::Bar::Baz) == 4); -static_assert(alignof(struct Foo::Bar::Baz) == 4); -static_assert(CRUBIT_OFFSET_OF(baz, struct Foo::Bar::Baz) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Foo::Bar::Baz) == 4); +static_assert(alignof(struct ::Foo::Bar::Baz) == 4); +static_assert(CRUBIT_OFFSET_OF(baz, struct ::Foo::Bar::Baz) == 0); extern "C" void __rust_thunk___ZN3Foo3Bar3BazC1Ev( - struct Foo::Bar::Baz* __this) { + struct ::Foo::Bar::Baz* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct already_snake_case) == 1); -static_assert(alignof(struct already_snake_case) == 1); -static_assert(CRUBIT_OFFSET_OF(i, struct already_snake_case) == 0); +static_assert(sizeof(struct ::already_snake_case) == 1); +static_assert(alignof(struct ::already_snake_case) == 1); +static_assert(CRUBIT_OFFSET_OF(i, struct ::already_snake_case) == 0); extern "C" void __rust_thunk___ZN18already_snake_caseC1Ev( - struct already_snake_case* __this) { + struct ::already_snake_case* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct already_snake_case::Inner) == 1); -static_assert(alignof(struct already_snake_case::Inner) == 1); +static_assert(sizeof(struct ::already_snake_case::Inner) == 1); +static_assert(alignof(struct ::already_snake_case::Inner) == 1); extern "C" void __rust_thunk___ZN18already_snake_case5InnerC1Ev( - struct already_snake_case::Inner* __this) { + struct ::already_snake_case::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct ConflictingSnakeCaseNames) == 1); -static_assert(alignof(struct ConflictingSnakeCaseNames) == 1); -static_assert(CRUBIT_OFFSET_OF(i, struct ConflictingSnakeCaseNames) == 0); +static_assert(sizeof(struct ::ConflictingSnakeCaseNames) == 1); +static_assert(alignof(struct ::ConflictingSnakeCaseNames) == 1); +static_assert(CRUBIT_OFFSET_OF(i, struct ::ConflictingSnakeCaseNames) == 0); extern "C" void __rust_thunk___ZN25ConflictingSnakeCaseNamesC1Ev( - struct ConflictingSnakeCaseNames* __this) { + struct ::ConflictingSnakeCaseNames* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct ConflictingSnakeCaseNames::Inner) == 1); -static_assert(alignof(struct ConflictingSnakeCaseNames::Inner) == 1); +static_assert(sizeof(struct ::ConflictingSnakeCaseNames::Inner) == 1); +static_assert(alignof(struct ::ConflictingSnakeCaseNames::Inner) == 1); extern "C" void __rust_thunk___ZN25ConflictingSnakeCaseNames5InnerC1Ev( - struct ConflictingSnakeCaseNames::Inner* __this) { + struct ::ConflictingSnakeCaseNames::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct ConflictingSnakeCaseNames_) == 1); -static_assert(alignof(struct ConflictingSnakeCaseNames_) == 1); -static_assert(CRUBIT_OFFSET_OF(i, struct ConflictingSnakeCaseNames_) == 0); +static_assert(sizeof(struct ::ConflictingSnakeCaseNames_) == 1); +static_assert(alignof(struct ::ConflictingSnakeCaseNames_) == 1); +static_assert(CRUBIT_OFFSET_OF(i, struct ::ConflictingSnakeCaseNames_) == 0); extern "C" void __rust_thunk___ZN26ConflictingSnakeCaseNames_C1Ev( - struct ConflictingSnakeCaseNames_* __this) { + struct ::ConflictingSnakeCaseNames_* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct ConflictingSnakeCaseNames_::Inner) == 1); -static_assert(alignof(struct ConflictingSnakeCaseNames_::Inner) == 1); +static_assert(sizeof(struct ::ConflictingSnakeCaseNames_::Inner) == 1); +static_assert(alignof(struct ::ConflictingSnakeCaseNames_::Inner) == 1); extern "C" void __rust_thunk___ZN26ConflictingSnakeCaseNames_5InnerC1Ev( - struct ConflictingSnakeCaseNames_::Inner* __this) { + struct ::ConflictingSnakeCaseNames_::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct OnlyOneHasNestedItems) == 1); -static_assert(alignof(struct OnlyOneHasNestedItems) == 1); -static_assert(CRUBIT_OFFSET_OF(i, struct OnlyOneHasNestedItems) == 0); +static_assert(sizeof(struct ::OnlyOneHasNestedItems) == 1); +static_assert(alignof(struct ::OnlyOneHasNestedItems) == 1); +static_assert(CRUBIT_OFFSET_OF(i, struct ::OnlyOneHasNestedItems) == 0); extern "C" void __rust_thunk___ZN21OnlyOneHasNestedItemsC1Ev( - struct OnlyOneHasNestedItems* __this) { + struct ::OnlyOneHasNestedItems* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct OnlyOneHasNestedItems::Inner) == 1); -static_assert(alignof(struct OnlyOneHasNestedItems::Inner) == 1); +static_assert(sizeof(struct ::OnlyOneHasNestedItems::Inner) == 1); +static_assert(alignof(struct ::OnlyOneHasNestedItems::Inner) == 1); extern "C" void __rust_thunk___ZN21OnlyOneHasNestedItems5InnerC1Ev( - struct OnlyOneHasNestedItems::Inner* __this) { + struct ::OnlyOneHasNestedItems::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct OnlyOneHasNestedItems_) == 1); -static_assert(alignof(struct OnlyOneHasNestedItems_) == 1); +static_assert(sizeof(struct ::OnlyOneHasNestedItems_) == 1); +static_assert(alignof(struct ::OnlyOneHasNestedItems_) == 1); extern "C" void __rust_thunk___ZN22OnlyOneHasNestedItems_C1Ev( - struct OnlyOneHasNestedItems_* __this) { + struct ::OnlyOneHasNestedItems_* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct SameNameAsNamespace) == 1); -static_assert(alignof(struct SameNameAsNamespace) == 1); -static_assert(CRUBIT_OFFSET_OF(i, struct SameNameAsNamespace) == 0); +static_assert(sizeof(struct ::SameNameAsNamespace) == 1); +static_assert(alignof(struct ::SameNameAsNamespace) == 1); +static_assert(CRUBIT_OFFSET_OF(i, struct ::SameNameAsNamespace) == 0); extern "C" void __rust_thunk___ZN19SameNameAsNamespaceC1Ev( - struct SameNameAsNamespace* __this) { + struct ::SameNameAsNamespace* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct SameNameAsNamespace::Inner) == 1); -static_assert(alignof(struct SameNameAsNamespace::Inner) == 1); +static_assert(sizeof(struct ::SameNameAsNamespace::Inner) == 1); +static_assert(alignof(struct ::SameNameAsNamespace::Inner) == 1); extern "C" void __rust_thunk___ZN19SameNameAsNamespace5InnerC1Ev( - struct SameNameAsNamespace::Inner* __this) { + struct ::SameNameAsNamespace::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct same_name_as_namespace::Foo) == 1); -static_assert(alignof(struct same_name_as_namespace::Foo) == 1); +static_assert(sizeof(struct ::same_name_as_namespace::Foo) == 1); +static_assert(alignof(struct ::same_name_as_namespace::Foo) == 1); extern "C" void __rust_thunk___ZN22same_name_as_namespace3FooC1Ev( - struct same_name_as_namespace::Foo* __this) { + struct ::same_name_as_namespace::Foo* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct same_name_as_namespace::Bar) == 1); -static_assert(alignof(struct same_name_as_namespace::Bar) == 1); +static_assert(sizeof(struct ::same_name_as_namespace::Bar) == 1); +static_assert(alignof(struct ::same_name_as_namespace::Bar) == 1); extern "C" void __rust_thunk___ZN22same_name_as_namespace3BarC1Ev( - struct same_name_as_namespace::Bar* __this) { + struct ::same_name_as_namespace::Bar* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::already_snake_case) == 1); -static_assert(alignof(struct no_longer_top_level::already_snake_case) == 1); +static_assert(sizeof(struct ::no_longer_top_level::already_snake_case) == 1); +static_assert(alignof(struct ::no_longer_top_level::already_snake_case) == 1); static_assert( - CRUBIT_OFFSET_OF(i, struct no_longer_top_level::already_snake_case) == 0); + CRUBIT_OFFSET_OF(i, struct ::no_longer_top_level::already_snake_case) == 0); extern "C" void __rust_thunk___ZN19no_longer_top_level18already_snake_caseC1Ev( - struct no_longer_top_level::already_snake_case* __this) { + struct ::no_longer_top_level::already_snake_case* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::already_snake_case::Inner) == - 1); -static_assert(alignof(struct no_longer_top_level::already_snake_case::Inner) == +static_assert(sizeof(struct ::no_longer_top_level::already_snake_case::Inner) == 1); +static_assert( + alignof(struct ::no_longer_top_level::already_snake_case::Inner) == 1); extern "C" void __rust_thunk___ZN19no_longer_top_level18already_snake_case5InnerC1Ev( - struct no_longer_top_level::already_snake_case::Inner* __this) { + struct ::no_longer_top_level::already_snake_case::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::ConflictingSnakeCaseNames) == - 1); -static_assert(alignof(struct no_longer_top_level::ConflictingSnakeCaseNames) == +static_assert(sizeof(struct ::no_longer_top_level::ConflictingSnakeCaseNames) == 1); +static_assert( + alignof(struct ::no_longer_top_level::ConflictingSnakeCaseNames) == 1); static_assert(CRUBIT_OFFSET_OF( - i, struct no_longer_top_level::ConflictingSnakeCaseNames) == + i, struct ::no_longer_top_level::ConflictingSnakeCaseNames) == 0); extern "C" void __rust_thunk___ZN19no_longer_top_level25ConflictingSnakeCaseNamesC1Ev( - struct no_longer_top_level::ConflictingSnakeCaseNames* __this) { + struct ::no_longer_top_level::ConflictingSnakeCaseNames* __this) { crubit::construct_at(__this); } static_assert( - sizeof(struct no_longer_top_level::ConflictingSnakeCaseNames::Inner) == 1); + sizeof(struct ::no_longer_top_level::ConflictingSnakeCaseNames::Inner) == + 1); static_assert( - alignof(struct no_longer_top_level::ConflictingSnakeCaseNames::Inner) == 1); + alignof(struct ::no_longer_top_level::ConflictingSnakeCaseNames::Inner) == + 1); extern "C" void __rust_thunk___ZN19no_longer_top_level25ConflictingSnakeCaseNames5InnerC1Ev( - struct no_longer_top_level::ConflictingSnakeCaseNames::Inner* __this) { + struct ::no_longer_top_level::ConflictingSnakeCaseNames::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::ConflictingSnakeCaseNames_) == - 1); -static_assert(alignof(struct no_longer_top_level::ConflictingSnakeCaseNames_) == - 1); +static_assert( + sizeof(struct ::no_longer_top_level::ConflictingSnakeCaseNames_) == 1); +static_assert( + alignof(struct ::no_longer_top_level::ConflictingSnakeCaseNames_) == 1); static_assert(CRUBIT_OFFSET_OF( - i, struct no_longer_top_level::ConflictingSnakeCaseNames_) == + i, + struct ::no_longer_top_level::ConflictingSnakeCaseNames_) == 0); extern "C" void __rust_thunk___ZN19no_longer_top_level26ConflictingSnakeCaseNames_C1Ev( - struct no_longer_top_level::ConflictingSnakeCaseNames_* __this) { + struct ::no_longer_top_level::ConflictingSnakeCaseNames_* __this) { crubit::construct_at(__this); } static_assert( - sizeof(struct no_longer_top_level::ConflictingSnakeCaseNames_::Inner) == 1); + sizeof(struct ::no_longer_top_level::ConflictingSnakeCaseNames_::Inner) == + 1); static_assert( - alignof(struct no_longer_top_level::ConflictingSnakeCaseNames_::Inner) == + alignof(struct ::no_longer_top_level::ConflictingSnakeCaseNames_::Inner) == 1); extern "C" void __rust_thunk___ZN19no_longer_top_level26ConflictingSnakeCaseNames_5InnerC1Ev( - struct no_longer_top_level::ConflictingSnakeCaseNames_::Inner* __this) { + struct ::no_longer_top_level::ConflictingSnakeCaseNames_::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::OnlyOneHasNestedItems) == 1); -static_assert(alignof(struct no_longer_top_level::OnlyOneHasNestedItems) == 1); +static_assert(sizeof(struct ::no_longer_top_level::OnlyOneHasNestedItems) == 1); +static_assert(alignof(struct ::no_longer_top_level::OnlyOneHasNestedItems) == + 1); static_assert(CRUBIT_OFFSET_OF( - i, struct no_longer_top_level::OnlyOneHasNestedItems) == 0); + i, struct ::no_longer_top_level::OnlyOneHasNestedItems) == 0); extern "C" void __rust_thunk___ZN19no_longer_top_level21OnlyOneHasNestedItemsC1Ev( - struct no_longer_top_level::OnlyOneHasNestedItems* __this) { + struct ::no_longer_top_level::OnlyOneHasNestedItems* __this) { crubit::construct_at(__this); } static_assert( - sizeof(struct no_longer_top_level::OnlyOneHasNestedItems::Inner) == 1); + sizeof(struct ::no_longer_top_level::OnlyOneHasNestedItems::Inner) == 1); static_assert( - alignof(struct no_longer_top_level::OnlyOneHasNestedItems::Inner) == 1); + alignof(struct ::no_longer_top_level::OnlyOneHasNestedItems::Inner) == 1); extern "C" void __rust_thunk___ZN19no_longer_top_level21OnlyOneHasNestedItems5InnerC1Ev( - struct no_longer_top_level::OnlyOneHasNestedItems::Inner* __this) { + struct ::no_longer_top_level::OnlyOneHasNestedItems::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::OnlyOneHasNestedItems_) == 1); -static_assert(alignof(struct no_longer_top_level::OnlyOneHasNestedItems_) == 1); +static_assert(sizeof(struct ::no_longer_top_level::OnlyOneHasNestedItems_) == + 1); +static_assert(alignof(struct ::no_longer_top_level::OnlyOneHasNestedItems_) == + 1); extern "C" void __rust_thunk___ZN19no_longer_top_level22OnlyOneHasNestedItems_C1Ev( - struct no_longer_top_level::OnlyOneHasNestedItems_* __this) { + struct ::no_longer_top_level::OnlyOneHasNestedItems_* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::SameNameAsNamespace) == 1); -static_assert(alignof(struct no_longer_top_level::SameNameAsNamespace) == 1); -static_assert( - CRUBIT_OFFSET_OF(i, struct no_longer_top_level::SameNameAsNamespace) == 0); +static_assert(sizeof(struct ::no_longer_top_level::SameNameAsNamespace) == 1); +static_assert(alignof(struct ::no_longer_top_level::SameNameAsNamespace) == 1); +static_assert(CRUBIT_OFFSET_OF( + i, struct ::no_longer_top_level::SameNameAsNamespace) == 0); extern "C" void __rust_thunk___ZN19no_longer_top_level19SameNameAsNamespaceC1Ev( - struct no_longer_top_level::SameNameAsNamespace* __this) { + struct ::no_longer_top_level::SameNameAsNamespace* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::SameNameAsNamespace::Inner) == - 1); -static_assert(alignof(struct no_longer_top_level::SameNameAsNamespace::Inner) == - 1); +static_assert( + sizeof(struct ::no_longer_top_level::SameNameAsNamespace::Inner) == 1); +static_assert( + alignof(struct ::no_longer_top_level::SameNameAsNamespace::Inner) == 1); extern "C" void __rust_thunk___ZN19no_longer_top_level19SameNameAsNamespace5InnerC1Ev( - struct no_longer_top_level::SameNameAsNamespace::Inner* __this) { + struct ::no_longer_top_level::SameNameAsNamespace::Inner* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::same_name_as_namespace::Foo) == - 1); static_assert( - alignof(struct no_longer_top_level::same_name_as_namespace::Foo) == 1); + sizeof(struct ::no_longer_top_level::same_name_as_namespace::Foo) == 1); +static_assert( + alignof(struct ::no_longer_top_level::same_name_as_namespace::Foo) == 1); extern "C" void __rust_thunk___ZN19no_longer_top_level22same_name_as_namespace3FooC1Ev( - struct no_longer_top_level::same_name_as_namespace::Foo* __this) { + struct ::no_longer_top_level::same_name_as_namespace::Foo* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct no_longer_top_level::same_name_as_namespace::Bar) == - 1); static_assert( - alignof(struct no_longer_top_level::same_name_as_namespace::Bar) == 1); + sizeof(struct ::no_longer_top_level::same_name_as_namespace::Bar) == 1); +static_assert( + alignof(struct ::no_longer_top_level::same_name_as_namespace::Bar) == 1); extern "C" void __rust_thunk___ZN19no_longer_top_level22same_name_as_namespace3BarC1Ev( - struct no_longer_top_level::same_name_as_namespace::Bar* __this) { + struct ::no_longer_top_level::same_name_as_namespace::Bar* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct ContainsForwardDeclared) == 1); -static_assert(alignof(struct ContainsForwardDeclared) == 1); +static_assert(sizeof(struct ::ContainsForwardDeclared) == 1); +static_assert(alignof(struct ::ContainsForwardDeclared) == 1); extern "C" void __rust_thunk___ZN23ContainsForwardDeclaredC1Ev( - struct ContainsForwardDeclared* __this) { + struct ::ContainsForwardDeclared* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct ContainsForwardDeclared::Nested) == 1); -static_assert(alignof(struct ContainsForwardDeclared::Nested) == 1); +static_assert(sizeof(struct ::ContainsForwardDeclared::Nested) == 1); +static_assert(alignof(struct ::ContainsForwardDeclared::Nested) == 1); extern "C" void __rust_thunk___ZN23ContainsForwardDeclared6NestedC1Ev( - struct ContainsForwardDeclared::Nested* __this) { + struct ::ContainsForwardDeclared::Nested* __this) { crubit::construct_at(__this); } 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 1768aac5d..2cc37d424 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 @@ -25,14 +25,14 @@ pub unsafe fn free_function(p1: *mut ::ffi_11::c_int) -> *mut ::ffi_11::c_int { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=S +///CRUBIT_ANNOTATE: cpp_type=:: S pub struct S { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for S {} impl !Sync for S {} unsafe impl ::cxx::ExternType for S { - type Id = ::cxx::type_id!("S"); + type Id = ::cxx::type_id!(":: S"); type Kind = ::cxx::kind::Trivial; } impl S { @@ -110,14 +110,14 @@ pub mod s { #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TriviallyCopyableButNontriviallyDestructible +///CRUBIT_ANNOTATE: cpp_type=:: TriviallyCopyableButNontriviallyDestructible pub struct TriviallyCopyableButNontriviallyDestructible { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for TriviallyCopyableButNontriviallyDestructible {} impl !Sync for TriviallyCopyableButNontriviallyDestructible {} unsafe impl ::cxx::ExternType for TriviallyCopyableButNontriviallyDestructible { - type Id = ::cxx::type_id!("TriviallyCopyableButNontriviallyDestructible"); + type Id = ::cxx::type_id!(":: TriviallyCopyableButNontriviallyDestructible"); type Kind = ::cxx::kind::Opaque; } @@ -179,7 +179,7 @@ pub unsafe fn take_pointer(p: *mut ::ffi_11::c_int) { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=WrappedValue +///CRUBIT_ANNOTATE: cpp_type=:: WrappedValue pub struct WrappedValue { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -189,7 +189,7 @@ pub struct WrappedValue { impl !Send for WrappedValue {} impl !Sync for WrappedValue {} unsafe impl ::cxx::ExternType for WrappedValue { - type Id = ::cxx::type_id!("WrappedValue"); + type Id = ::cxx::type_id!(":: WrappedValue"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc index ca6248ea3..09526720a 100644 --- a/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/no_elided_lifetimes_rs_api_impl.cc @@ -20,10 +20,10 @@ static_assert((int& (*)(int&)) & ::free_function); -static_assert(sizeof(struct S) == 1); -static_assert(alignof(struct S) == 1); +static_assert(sizeof(struct ::S) == 1); +static_assert(alignof(struct ::S) == 1); -extern "C" void __rust_thunk___ZN1SC1Ev(struct S* __this) { +extern "C" void __rust_thunk___ZN1SC1Ev(struct ::S* __this) { crubit::construct_at(__this); } @@ -31,37 +31,38 @@ static_assert((int& (::S::*)(int&, int&) const) & ::S::const_method); static_assert((int& (::S::*)(int&, int&)) & ::S::method); -static_assert(sizeof(struct TriviallyCopyableButNontriviallyDestructible) == 1); -static_assert(alignof(struct TriviallyCopyableButNontriviallyDestructible) == +static_assert(sizeof(struct ::TriviallyCopyableButNontriviallyDestructible) == + 1); +static_assert(alignof(struct ::TriviallyCopyableButNontriviallyDestructible) == 1); -extern "C" struct TriviallyCopyableButNontriviallyDestructible* +extern "C" struct ::TriviallyCopyableButNontriviallyDestructible* __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleaSERKS_( - struct TriviallyCopyableButNontriviallyDestructible* __this, - struct TriviallyCopyableButNontriviallyDestructible const* __param_0) { + struct ::TriviallyCopyableButNontriviallyDestructible* __this, + struct ::TriviallyCopyableButNontriviallyDestructible const* __param_0) { return std::addressof(__this->operator=(*__param_0)); } extern "C" void __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleC1ERKS_( - struct TriviallyCopyableButNontriviallyDestructible* __this, - struct TriviallyCopyableButNontriviallyDestructible const* __param_0) { + struct ::TriviallyCopyableButNontriviallyDestructible* __this, + struct ::TriviallyCopyableButNontriviallyDestructible const* __param_0) { crubit::construct_at(__this, *__param_0); } static_assert((void (*)(int*)) & ::take_pointer); -static_assert(CRUBIT_SIZEOF(class WrappedValue) == 4); -static_assert(alignof(class WrappedValue) == 4); +static_assert(CRUBIT_SIZEOF(class ::WrappedValue) == 4); +static_assert(alignof(class ::WrappedValue) == 4); -extern "C" void __rust_thunk___ZN12WrappedValueC1Ei(class WrappedValue* __this, - int value) { +extern "C" void __rust_thunk___ZN12WrappedValueC1Ei( + class ::WrappedValue* __this, int value) { crubit::construct_at(__this, value); } extern "C" void __rust_thunk___ZNK12WrappedValueplERKS_( - class WrappedValue* __return, class WrappedValue const* __this, - class WrappedValue const* rhs) { + class ::WrappedValue* __return, class ::WrappedValue const* __this, + class ::WrappedValue const* rhs) { new (__return) auto(__this->operator+(*rhs)); } 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 5ee49ed23..de013f760 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 @@ -21,7 +21,7 @@ /// inspect and verify the expected layout of the generated Rust struct. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=Struct +///CRUBIT_ANNOTATE: cpp_type=:: Struct pub struct Struct { /// Nobody would ever use a no_unique_address int/char field, this is just /// enough to test that the transmute is correct. @@ -36,7 +36,7 @@ pub struct Struct { impl !Send for Struct {} impl !Sync for Struct {} unsafe impl ::cxx::ExternType for Struct { - type Id = ::cxx::type_id!("Struct"); + type Id = ::cxx::type_id!(":: Struct"); type Kind = ::cxx::kind::Trivial; } impl Struct { @@ -99,7 +99,7 @@ pub mod r#struct { /// cl/448287893 `field2` would be incorrectly placed at offset 1. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=PaddingBetweenFields +///CRUBIT_ANNOTATE: cpp_type=:: PaddingBetweenFields pub struct PaddingBetweenFields { /// size: 1, alignment: 1 => offset: 0 pub field1: ::ffi_11::c_char, @@ -113,7 +113,7 @@ pub struct PaddingBetweenFields { impl !Send for PaddingBetweenFields {} impl !Sync for PaddingBetweenFields {} unsafe impl ::cxx::ExternType for PaddingBetweenFields { - type Id = ::cxx::type_id!("PaddingBetweenFields"); + type Id = ::cxx::type_id!(":: PaddingBetweenFields"); type Kind = ::cxx::kind::Trivial; } impl PaddingBetweenFields { @@ -176,7 +176,7 @@ pub mod padding_between_fields { /// - size: 8 (dsize adjusted up to account for alignment) #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=FieldInTailPadding_InnerStruct +///CRUBIT_ANNOTATE: cpp_type=:: FieldInTailPadding_InnerStruct pub struct FieldInTailPadding_InnerStruct { /// size: 4, alignment: 4 => offset: 0 pub inner_int_field: ::ffi_11::c_int, @@ -186,7 +186,7 @@ pub struct FieldInTailPadding_InnerStruct { impl !Send for FieldInTailPadding_InnerStruct {} impl !Sync for FieldInTailPadding_InnerStruct {} unsafe impl ::cxx::ExternType for FieldInTailPadding_InnerStruct { - type Id = ::cxx::type_id!("FieldInTailPadding_InnerStruct"); + type Id = ::cxx::type_id!(":: FieldInTailPadding_InnerStruct"); type Kind = ::cxx::kind::Opaque; } @@ -235,7 +235,7 @@ impl ::ctor::PinnedDrop for FieldInTailPadding_InnerStruct { /// put `char_in_tail_padding_of_prev_field` at offset 8. #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=FieldInTailPadding +///CRUBIT_ANNOTATE: cpp_type=:: FieldInTailPadding pub struct FieldInTailPadding { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: @@ -247,7 +247,7 @@ pub struct FieldInTailPadding { impl !Send for FieldInTailPadding {} impl !Sync for FieldInTailPadding {} unsafe impl ::cxx::ExternType for FieldInTailPadding { - type Id = ::cxx::type_id!("FieldInTailPadding"); + type Id = ::cxx::type_id!(":: FieldInTailPadding"); type Kind = ::cxx::kind::Opaque; } diff --git a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc index 94ca14626..6cd77f7d6 100644 --- a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api_impl.cc @@ -18,70 +18,70 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct Struct) == 8); -static_assert(alignof(struct Struct) == 4); -static_assert(CRUBIT_OFFSET_OF(field1, struct Struct) == 0); -static_assert(CRUBIT_OFFSET_OF(field2, struct Struct) == 4); +static_assert(CRUBIT_SIZEOF(struct ::Struct) == 8); +static_assert(alignof(struct ::Struct) == 4); +static_assert(CRUBIT_OFFSET_OF(field1, struct ::Struct) == 0); +static_assert(CRUBIT_OFFSET_OF(field2, struct ::Struct) == 4); -extern "C" void __rust_thunk___ZN6StructC1Ev(struct Struct* __this) { +extern "C" void __rust_thunk___ZN6StructC1Ev(struct ::Struct* __this) { crubit::construct_at(__this); } -extern "C" void __rust_thunk___ZN6Struct4MakeEic(struct Struct* __return, +extern "C" void __rust_thunk___ZN6Struct4MakeEic(struct ::Struct* __return, int f1, char f2) { - new (__return) auto(Struct::Make(f1, f2)); + new (__return) auto(::Struct::Make(f1, f2)); } -static_assert((struct Struct (*)(int, char)) & ::Struct::Make); +static_assert((struct ::Struct (*)(int, char)) & ::Struct::Make); -static_assert(CRUBIT_SIZEOF(struct PaddingBetweenFields) == 8); -static_assert(alignof(struct PaddingBetweenFields) == 4); -static_assert(CRUBIT_OFFSET_OF(field1, struct PaddingBetweenFields) == 0); -static_assert(CRUBIT_OFFSET_OF(field2, struct PaddingBetweenFields) == 4); +static_assert(CRUBIT_SIZEOF(struct ::PaddingBetweenFields) == 8); +static_assert(alignof(struct ::PaddingBetweenFields) == 4); +static_assert(CRUBIT_OFFSET_OF(field1, struct ::PaddingBetweenFields) == 0); +static_assert(CRUBIT_OFFSET_OF(field2, struct ::PaddingBetweenFields) == 4); extern "C" void __rust_thunk___ZN20PaddingBetweenFieldsC1Ev( - struct PaddingBetweenFields* __this) { + struct ::PaddingBetweenFields* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN20PaddingBetweenFields4MakeEci( - struct PaddingBetweenFields* __return, char f1, int f2) { - new (__return) auto(PaddingBetweenFields::Make(f1, f2)); + struct ::PaddingBetweenFields* __return, char f1, int f2) { + new (__return) auto(::PaddingBetweenFields::Make(f1, f2)); } -static_assert((struct PaddingBetweenFields (*)(char, int)) & +static_assert((struct ::PaddingBetweenFields (*)(char, int)) & ::PaddingBetweenFields::Make); -static_assert(CRUBIT_SIZEOF(struct FieldInTailPadding_InnerStruct) == 8); -static_assert(alignof(struct FieldInTailPadding_InnerStruct) == 4); +static_assert(CRUBIT_SIZEOF(struct ::FieldInTailPadding_InnerStruct) == 8); +static_assert(alignof(struct ::FieldInTailPadding_InnerStruct) == 4); static_assert(CRUBIT_OFFSET_OF(inner_int_field, - struct FieldInTailPadding_InnerStruct) == 0); + struct ::FieldInTailPadding_InnerStruct) == 0); static_assert(CRUBIT_OFFSET_OF(inner_char_field, - struct FieldInTailPadding_InnerStruct) == 4); + struct ::FieldInTailPadding_InnerStruct) == 4); extern "C" void __rust_thunk___ZN30FieldInTailPadding_InnerStructC1Ev( - struct FieldInTailPadding_InnerStruct* __this) { + struct ::FieldInTailPadding_InnerStruct* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN30FieldInTailPadding_InnerStructD1Ev( - struct FieldInTailPadding_InnerStruct* __this) { + struct ::FieldInTailPadding_InnerStruct* __this) { std::destroy_at(__this); } -static_assert(CRUBIT_SIZEOF(struct FieldInTailPadding) == 8); -static_assert(alignof(struct FieldInTailPadding) == 4); -static_assert(CRUBIT_OFFSET_OF(inner_struct, struct FieldInTailPadding) == 0); +static_assert(CRUBIT_SIZEOF(struct ::FieldInTailPadding) == 8); +static_assert(alignof(struct ::FieldInTailPadding) == 4); +static_assert(CRUBIT_OFFSET_OF(inner_struct, struct ::FieldInTailPadding) == 0); static_assert(CRUBIT_OFFSET_OF(char_in_tail_padding_of_prev_field, - struct FieldInTailPadding) == 5); + struct ::FieldInTailPadding) == 5); extern "C" void __rust_thunk___ZN18FieldInTailPaddingD1Ev( - struct FieldInTailPadding* __this) { + struct ::FieldInTailPadding* __this) { std::destroy_at(__this); } extern "C" void __rust_thunk___ZN18FieldInTailPaddingC1Eicc( - struct FieldInTailPadding* __this, int inner_int, char inner_char, + struct ::FieldInTailPadding* __this, int inner_int, char inner_char, char outer_char) { crubit::construct_at(__this, inner_int, inner_char, outer_char); } 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 b3753aaa6..b175fe096 100644 --- a/rs_bindings_from_cc/test/golden/nodiscard_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/nodiscard_rs_api.rs @@ -17,14 +17,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[must_use] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NoDiscard +///CRUBIT_ANNOTATE: cpp_type=:: NoDiscard pub struct NoDiscard { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for NoDiscard {} impl !Sync for NoDiscard {} unsafe impl ::cxx::ExternType for NoDiscard { - type Id = ::cxx::type_id!("NoDiscard"); + type Id = ::cxx::type_id!(":: NoDiscard"); type Kind = ::cxx::kind::Trivial; } @@ -42,14 +42,14 @@ impl Default for NoDiscard { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[must_use = "You really should use this"] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NoDiscardWithMessage +///CRUBIT_ANNOTATE: cpp_type=:: NoDiscardWithMessage pub struct NoDiscardWithMessage { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for NoDiscardWithMessage {} impl !Sync for NoDiscardWithMessage {} unsafe impl ::cxx::ExternType for NoDiscardWithMessage { - type Id = ::cxx::type_id!("NoDiscardWithMessage"); + type Id = ::cxx::type_id!(":: NoDiscardWithMessage"); type Kind = ::cxx::kind::Trivial; } @@ -67,7 +67,7 @@ impl Default for NoDiscardWithMessage { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] #[must_use] -///CRUBIT_ANNOTATE: cpp_type=NoDiscardEnum +///CRUBIT_ANNOTATE: cpp_type=:: NoDiscardEnum pub struct NoDiscardEnum(::ffi_11::c_uint); impl NoDiscardEnum { pub const kConstant: NoDiscardEnum = NoDiscardEnum(::ffi_11::new_c_uint(0)); @@ -86,7 +86,7 @@ impl From for ::ffi_11::c_uint { #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] #[must_use = "You really should use this"] -///CRUBIT_ANNOTATE: cpp_type=NoDiscardEnumWithMessage +///CRUBIT_ANNOTATE: cpp_type=:: NoDiscardEnumWithMessage pub struct NoDiscardEnumWithMessage(::ffi_11::c_uint); impl NoDiscardEnumWithMessage { pub const kConstantWithMessage: NoDiscardEnumWithMessage = @@ -117,14 +117,14 @@ pub fn crubit_nodiscard_message() -> *mut ::ffi_11::c_void { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NodiscardCtor +///CRUBIT_ANNOTATE: cpp_type=:: NodiscardCtor pub struct NodiscardCtor { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for NodiscardCtor {} impl !Sync for NodiscardCtor {} unsafe impl ::cxx::ExternType for NodiscardCtor { - type Id = ::cxx::type_id!("NodiscardCtor"); + type Id = ::cxx::type_id!(":: NodiscardCtor"); type Kind = ::cxx::kind::Trivial; } @@ -150,14 +150,14 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for NodiscardCtor { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NodiscardCtorWithMessage +///CRUBIT_ANNOTATE: cpp_type=:: NodiscardCtorWithMessage pub struct NodiscardCtorWithMessage { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for NodiscardCtorWithMessage {} impl !Sync for NodiscardCtorWithMessage {} unsafe impl ::cxx::ExternType for NodiscardCtorWithMessage { - type Id = ::cxx::type_id!("NodiscardCtorWithMessage"); + type Id = ::cxx::type_id!(":: NodiscardCtorWithMessage"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/nodiscard_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/nodiscard_rs_api_impl.cc index 90a4c4b1b..d28232c8f 100644 --- a/rs_bindings_from_cc/test/golden/nodiscard_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/nodiscard_rs_api_impl.cc @@ -18,46 +18,46 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct NoDiscard) == 1); -static_assert(alignof(struct NoDiscard) == 1); +static_assert(sizeof(struct ::NoDiscard) == 1); +static_assert(alignof(struct ::NoDiscard) == 1); -extern "C" void __rust_thunk___ZN9NoDiscardC1Ev(struct NoDiscard* __this) { +extern "C" void __rust_thunk___ZN9NoDiscardC1Ev(struct ::NoDiscard* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct NoDiscardWithMessage) == 1); -static_assert(alignof(struct NoDiscardWithMessage) == 1); +static_assert(sizeof(struct ::NoDiscardWithMessage) == 1); +static_assert(alignof(struct ::NoDiscardWithMessage) == 1); extern "C" void __rust_thunk___ZN20NoDiscardWithMessageC1Ev( - struct NoDiscardWithMessage* __this) { + struct ::NoDiscardWithMessage* __this) { crubit::construct_at(__this); } extern "C" void* __rust_thunk___Z16crubit_nodiscardv() { - return crubit_nodiscard(); + return ::crubit_nodiscard(); } static_assert((void* (*)()) & ::crubit_nodiscard); extern "C" void* __rust_thunk___Z24crubit_nodiscard_messagev() { - return crubit_nodiscard_message(); + return ::crubit_nodiscard_message(); } static_assert((void* (*)()) & ::crubit_nodiscard_message); -static_assert(sizeof(struct NodiscardCtor) == 1); -static_assert(alignof(struct NodiscardCtor) == 1); +static_assert(sizeof(struct ::NodiscardCtor) == 1); +static_assert(alignof(struct ::NodiscardCtor) == 1); extern "C" void __rust_thunk___ZN13NodiscardCtorC1Eii( - struct NodiscardCtor* __this, int x, int y) { + struct ::NodiscardCtor* __this, int x, int y) { crubit::construct_at(__this, x, y); } -static_assert(sizeof(struct NodiscardCtorWithMessage) == 1); -static_assert(alignof(struct NodiscardCtorWithMessage) == 1); +static_assert(sizeof(struct ::NodiscardCtorWithMessage) == 1); +static_assert(alignof(struct ::NodiscardCtorWithMessage) == 1); extern "C" void __rust_thunk___ZN24NodiscardCtorWithMessageC1Eii( - struct NodiscardCtorWithMessage* __this, int x, int y) { + struct ::NodiscardCtorWithMessage* __this, int x, int y) { crubit::construct_at(__this, x, y); } 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 8f68d13d9..189b02a11 100644 --- a/rs_bindings_from_cc/test/golden/noexcept_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/noexcept_rs_api.rs @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeClass +///CRUBIT_ANNOTATE: cpp_type=:: SomeClass pub struct SomeClass { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeClass {} impl !Sync for SomeClass {} unsafe impl ::cxx::ExternType for SomeClass { - type Id = ::cxx::type_id!("SomeClass"); + type Id = ::cxx::type_id!(":: SomeClass"); type Kind = ::cxx::kind::Trivial; } impl SomeClass { diff --git a/rs_bindings_from_cc/test/golden/noexcept_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/noexcept_rs_api_impl.cc index 8cffcd1ac..67bb9c005 100644 --- a/rs_bindings_from_cc/test/golden/noexcept_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/noexcept_rs_api_impl.cc @@ -18,10 +18,10 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class SomeClass) == 1); -static_assert(alignof(class SomeClass) == 1); +static_assert(sizeof(class ::SomeClass) == 1); +static_assert(alignof(class ::SomeClass) == 1); -extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class SomeClass* __this) { +extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class ::SomeClass* __this) { crubit::construct_at(__this); } 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 b76d7d69a..589ad36af 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 @@ -17,14 +17,14 @@ pub mod ns { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=ns :: X + ///CRUBIT_ANNOTATE: cpp_type=:: ns :: X pub struct X { pub f: ::ffi_11::c_int, } impl !Send for X {} impl !Sync for X {} unsafe impl ::cxx::ExternType for X { - type Id = ::cxx::type_id!("ns :: X"); + type Id = ::cxx::type_id!(":: ns :: X"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/non_member_operator_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/non_member_operator_rs_api_impl.cc index fdcd4dff1..9efb9ee93 100644 --- a/rs_bindings_from_cc/test/golden/non_member_operator_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/non_member_operator_rs_api_impl.cc @@ -18,15 +18,16 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct ns::X) == 4); -static_assert(alignof(struct ns::X) == 4); -static_assert(CRUBIT_OFFSET_OF(f, struct ns::X) == 0); +static_assert(CRUBIT_SIZEOF(struct ::ns::X) == 4); +static_assert(alignof(struct ::ns::X) == 4); +static_assert(CRUBIT_OFFSET_OF(f, struct ::ns::X) == 0); -extern "C" void __rust_thunk___ZN2ns1XC1Ev(struct ns::X* __this) { +extern "C" void __rust_thunk___ZN2ns1XC1Ev(struct ::ns::X* __this) { crubit::construct_at(__this); } -extern "C" bool __rust_thunk___ZeqN2ns1XES0_(struct ns::X* a, struct ns::X* b) { +extern "C" bool __rust_thunk___ZeqN2ns1XES0_(struct ::ns::X* a, + struct ::ns::X* b) { return operator==(std::move(*a), std::move(*b)); } 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 374986fdc..6a6ca18cb 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 @@ -21,7 +21,7 @@ /// as specifically giving it a nontrivial move constructor and destructor. #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Nontrivial +///CRUBIT_ANNOTATE: cpp_type=:: Nontrivial pub struct Nontrivial { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, @@ -29,7 +29,7 @@ pub struct Nontrivial { impl !Send for Nontrivial {} impl !Sync for Nontrivial {} unsafe impl ::cxx::ExternType for Nontrivial { - type Id = ::cxx::type_id!("Nontrivial"); + type Id = ::cxx::type_id!(":: Nontrivial"); type Kind = ::cxx::kind::Opaque; } impl Nontrivial { @@ -207,7 +207,7 @@ pub mod nontrivial { /// as specifically giving it a nontrivial move constructor and destructor. #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NontrivialInline +///CRUBIT_ANNOTATE: cpp_type=:: NontrivialInline pub struct NontrivialInline { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, @@ -215,7 +215,7 @@ pub struct NontrivialInline { impl !Send for NontrivialInline {} impl !Sync for NontrivialInline {} unsafe impl ::cxx::ExternType for NontrivialInline { - type Id = ::cxx::type_id!("NontrivialInline"); + type Id = ::cxx::type_id!(":: NontrivialInline"); type Kind = ::cxx::kind::Opaque; } impl NontrivialInline { @@ -330,7 +330,7 @@ pub mod nontrivial_inline { /// each field. #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=NontrivialMembers +///CRUBIT_ANNOTATE: cpp_type=:: NontrivialMembers pub struct NontrivialMembers { /// Reason for representing this field as a blob of bytes: /// nontrivial fields would be destroyed in the wrong order @@ -339,7 +339,7 @@ pub struct NontrivialMembers { impl !Send for NontrivialMembers {} impl !Sync for NontrivialMembers {} unsafe impl ::cxx::ExternType for NontrivialMembers { - type Id = ::cxx::type_id!("NontrivialMembers"); + type Id = ::cxx::type_id!(":: NontrivialMembers"); type Kind = ::cxx::kind::Opaque; } @@ -388,7 +388,7 @@ impl ::ctor::PinnedDrop for NontrivialMembers { /// Nontrivial, but trivially relocatable and final (and therefore Unpin). #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NontrivialUnpin +///CRUBIT_ANNOTATE: cpp_type=:: NontrivialUnpin pub struct NontrivialUnpin { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, @@ -396,7 +396,7 @@ pub struct NontrivialUnpin { impl !Send for NontrivialUnpin {} impl !Sync for NontrivialUnpin {} unsafe impl ::cxx::ExternType for NontrivialUnpin { - type Id = ::cxx::type_id!("NontrivialUnpin"); + type Id = ::cxx::type_id!(":: NontrivialUnpin"); type Kind = ::cxx::kind::Trivial; } impl NontrivialUnpin { @@ -594,14 +594,14 @@ pub fn TakesByValueUnpin(mut nontrivial: crate::NontrivialUnpin) -> crate::Nontr /// Finally, testing for strange by-value APIs. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NontrivialByValue +///CRUBIT_ANNOTATE: cpp_type=:: NontrivialByValue pub struct NontrivialByValue { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for NontrivialByValue {} impl !Sync for NontrivialByValue {} unsafe impl ::cxx::ExternType for NontrivialByValue { - type Id = ::cxx::type_id!("NontrivialByValue"); + type Id = ::cxx::type_id!(":: NontrivialByValue"); type Kind = ::cxx::kind::Trivial; } @@ -662,14 +662,14 @@ where #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Nonmovable +///CRUBIT_ANNOTATE: cpp_type=:: Nonmovable pub struct Nonmovable { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for Nonmovable {} impl !Sync for Nonmovable {} unsafe impl ::cxx::ExternType for Nonmovable { - type Id = ::cxx::type_id!("Nonmovable"); + type Id = ::cxx::type_id!(":: Nonmovable"); type Kind = ::cxx::kind::Opaque; } impl Nonmovable { diff --git a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc index afedab7f0..6e9b1d758 100644 --- a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc @@ -18,12 +18,12 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct Nontrivial) == 4); -static_assert(alignof(struct Nontrivial) == 4); -static_assert(CRUBIT_OFFSET_OF(field, struct Nontrivial) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Nontrivial) == 4); +static_assert(alignof(struct ::Nontrivial) == 4); +static_assert(CRUBIT_OFFSET_OF(field, struct ::Nontrivial) == 0); -extern "C" void __rust_thunk___ZN10NontrivialaSEf(struct Nontrivial* __return, - struct Nontrivial* __this, +extern "C" void __rust_thunk___ZN10NontrivialaSEf(struct ::Nontrivial* __return, + struct ::Nontrivial* __this, float __param_0) { new (__return) auto(__this->operator=(__param_0)); } @@ -37,102 +37,103 @@ static_assert((void (::Nontrivial::*)() &)&::Nontrivial::LvalueRefQualified); static_assert((void (::Nontrivial::*)() const&)&::Nontrivial::ConstLvalueRefQualified); -static_assert(CRUBIT_SIZEOF(struct NontrivialInline) == 4); -static_assert(alignof(struct NontrivialInline) == 4); -static_assert(CRUBIT_OFFSET_OF(field, struct NontrivialInline) == 0); +static_assert(CRUBIT_SIZEOF(struct ::NontrivialInline) == 4); +static_assert(alignof(struct ::NontrivialInline) == 4); +static_assert(CRUBIT_OFFSET_OF(field, struct ::NontrivialInline) == 0); extern "C" void __rust_thunk___ZN16NontrivialInlineC1Ev( - struct NontrivialInline* __this) { + struct ::NontrivialInline* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN16NontrivialInlineC1Ei( - struct NontrivialInline* __this, int field) { + struct ::NontrivialInline* __this, int field) { crubit::construct_at(__this, field); } extern "C" void __rust_thunk___ZN16NontrivialInlineC1Eii( - struct NontrivialInline* __this, int field, int unused) { + struct ::NontrivialInline* __this, int field, int unused) { crubit::construct_at(__this, field, unused); } extern "C" void __rust_thunk___ZN16NontrivialInlineD1Ev( - struct NontrivialInline* __this) { + struct ::NontrivialInline* __this) { std::destroy_at(__this); } extern "C" void __rust_thunk___ZN16NontrivialInline14MemberFunctionEv( - struct NontrivialInline* __this) { + struct ::NontrivialInline* __this) { __this->MemberFunction(); } static_assert((void (::NontrivialInline::*)()) & ::NontrivialInline::MemberFunction); -static_assert(CRUBIT_SIZEOF(struct NontrivialMembers) == 4); -static_assert(alignof(struct NontrivialMembers) == 4); -static_assert(CRUBIT_OFFSET_OF(nontrivial_member, struct NontrivialMembers) == +static_assert(CRUBIT_SIZEOF(struct ::NontrivialMembers) == 4); +static_assert(alignof(struct ::NontrivialMembers) == 4); +static_assert(CRUBIT_OFFSET_OF(nontrivial_member, struct ::NontrivialMembers) == 0); extern "C" void __rust_thunk___ZN17NontrivialMembersC1Ev( - struct NontrivialMembers* __this) { + struct ::NontrivialMembers* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN17NontrivialMembersD1Ev( - struct NontrivialMembers* __this) { + struct ::NontrivialMembers* __this) { std::destroy_at(__this); } -static_assert(CRUBIT_SIZEOF(struct NontrivialUnpin) == 4); -static_assert(alignof(struct NontrivialUnpin) == 4); -static_assert(CRUBIT_OFFSET_OF(field, struct NontrivialUnpin) == 0); +static_assert(CRUBIT_SIZEOF(struct ::NontrivialUnpin) == 4); +static_assert(alignof(struct ::NontrivialUnpin) == 4); +static_assert(CRUBIT_OFFSET_OF(field, struct ::NontrivialUnpin) == 0); static_assert((void (::NontrivialUnpin::*)()) & ::NontrivialUnpin::MemberFunction); extern "C" void __rust_thunk___Z12TakesByValue10Nontrivial( - struct Nontrivial* __return, struct Nontrivial* nontrivial) { - new (__return) auto(TakesByValue(std::move(*nontrivial))); + struct ::Nontrivial* __return, struct ::Nontrivial* nontrivial) { + new (__return) auto(::TakesByValue(std::move(*nontrivial))); } -static_assert((struct Nontrivial (*)(struct Nontrivial)) & ::TakesByValue); +static_assert((struct ::Nontrivial (*)(struct ::Nontrivial)) & ::TakesByValue); extern "C" void __rust_thunk___Z18TakesByValueInline16NontrivialInline( - struct NontrivialInline* __return, struct NontrivialInline* nontrivial) { - new (__return) auto(TakesByValueInline(std::move(*nontrivial))); + struct ::NontrivialInline* __return, + struct ::NontrivialInline* nontrivial) { + new (__return) auto(::TakesByValueInline(std::move(*nontrivial))); } -static_assert((struct NontrivialInline (*)(struct NontrivialInline)) & +static_assert((struct ::NontrivialInline (*)(struct ::NontrivialInline)) & ::TakesByValueInline); extern "C" void __rust_thunk___Z17TakesByValueUnpin15NontrivialUnpin( - struct NontrivialUnpin* __return, struct NontrivialUnpin* nontrivial) { - new (__return) auto(TakesByValueUnpin(std::move(*nontrivial))); + struct ::NontrivialUnpin* __return, struct ::NontrivialUnpin* nontrivial) { + new (__return) auto(::TakesByValueUnpin(std::move(*nontrivial))); } -static_assert((struct NontrivialUnpin (*)(struct NontrivialUnpin)) & +static_assert((struct ::NontrivialUnpin (*)(struct ::NontrivialUnpin)) & ::TakesByValueUnpin); -static_assert(sizeof(struct NontrivialByValue) == 1); -static_assert(alignof(struct NontrivialByValue) == 1); +static_assert(sizeof(struct ::NontrivialByValue) == 1); +static_assert(alignof(struct ::NontrivialByValue) == 1); extern "C" void __rust_thunk___ZN17NontrivialByValueaSE10Nontrivial( - struct NontrivialByValue* __return, struct NontrivialByValue* __this, - struct Nontrivial* other) { + struct ::NontrivialByValue* __return, struct ::NontrivialByValue* __this, + struct ::Nontrivial* other) { new (__return) auto(__this->operator=(std::move(*other))); } -static_assert(sizeof(struct Nonmovable) == 1); -static_assert(alignof(struct Nonmovable) == 1); +static_assert(sizeof(struct ::Nonmovable) == 1); +static_assert(alignof(struct ::Nonmovable) == 1); static_assert((void (::Nonmovable::*)()) & ::Nonmovable::MemberFunction); extern "C" void __rust_thunk___Z24ReturnsNonmovableByValuev( - struct Nonmovable* __return) { - new (__return) auto(ReturnsNonmovableByValue()); + struct ::Nonmovable* __return) { + new (__return) auto(::ReturnsNonmovableByValue()); } -static_assert((struct Nonmovable (*)()) & ::ReturnsNonmovableByValue); +static_assert((struct ::Nonmovable (*)()) & ::ReturnsNonmovableByValue); #pragma clang diagnostic pop 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 8c6edf96d..d38c679ac 100644 --- a/rs_bindings_from_cc/test/golden/operators_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/operators_rs_api.rs @@ -16,7 +16,7 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=AddableConstMember +///CRUBIT_ANNOTATE: cpp_type=:: AddableConstMember pub struct AddableConstMember { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -26,7 +26,7 @@ pub struct AddableConstMember { impl !Send for AddableConstMember {} impl !Sync for AddableConstMember {} unsafe impl ::cxx::ExternType for AddableConstMember { - type Id = ::cxx::type_id!("AddableConstMember"); + type Id = ::cxx::type_id!(":: AddableConstMember"); type Kind = ::cxx::kind::Trivial; } @@ -67,7 +67,7 @@ impl Default for AddableConstMember { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=AddableNonConstMember +///CRUBIT_ANNOTATE: cpp_type=:: AddableNonConstMember pub struct AddableNonConstMember { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -77,7 +77,7 @@ pub struct AddableNonConstMember { impl !Send for AddableNonConstMember {} impl !Sync for AddableNonConstMember {} unsafe impl ::cxx::ExternType for AddableNonConstMember { - type Id = ::cxx::type_id!("AddableNonConstMember"); + type Id = ::cxx::type_id!(":: AddableNonConstMember"); type Kind = ::cxx::kind::Trivial; } @@ -118,7 +118,7 @@ impl Default for AddableNonConstMember { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=AddableFriend +///CRUBIT_ANNOTATE: cpp_type=:: AddableFriend pub struct AddableFriend { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -128,7 +128,7 @@ pub struct AddableFriend { impl !Send for AddableFriend {} impl !Sync for AddableFriend {} unsafe impl ::cxx::ExternType for AddableFriend { - type Id = ::cxx::type_id!("AddableFriend"); + type Id = ::cxx::type_id!(":: AddableFriend"); type Kind = ::cxx::kind::Trivial; } @@ -171,14 +171,14 @@ impl Default for AddableFriend { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddableFreeByConstRef +///CRUBIT_ANNOTATE: cpp_type=:: AddableFreeByConstRef pub struct AddableFreeByConstRef { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByConstRef {} impl !Sync for AddableFreeByConstRef {} unsafe impl ::cxx::ExternType for AddableFreeByConstRef { - type Id = ::cxx::type_id!("AddableFreeByConstRef"); + type Id = ::cxx::type_id!(":: AddableFreeByConstRef"); type Kind = ::cxx::kind::Trivial; } @@ -215,14 +215,14 @@ impl Default for AddableFreeByConstRef { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddableFreeByMutRef +///CRUBIT_ANNOTATE: cpp_type=:: AddableFreeByMutRef pub struct AddableFreeByMutRef { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByMutRef {} impl !Sync for AddableFreeByMutRef {} unsafe impl ::cxx::ExternType for AddableFreeByMutRef { - type Id = ::cxx::type_id!("AddableFreeByMutRef"); + type Id = ::cxx::type_id!(":: AddableFreeByMutRef"); type Kind = ::cxx::kind::Trivial; } @@ -259,14 +259,14 @@ impl Default for AddableFreeByMutRef { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddableFreeByValue +///CRUBIT_ANNOTATE: cpp_type=:: AddableFreeByValue pub struct AddableFreeByValue { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByValue {} impl !Sync for AddableFreeByValue {} unsafe impl ::cxx::ExternType for AddableFreeByValue { - type Id = ::cxx::type_id!("AddableFreeByValue"); + type Id = ::cxx::type_id!(":: AddableFreeByValue"); type Kind = ::cxx::kind::Trivial; } @@ -303,14 +303,14 @@ impl Default for AddableFreeByValue { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddableFreeByRValueRef +///CRUBIT_ANNOTATE: cpp_type=:: AddableFreeByRValueRef pub struct AddableFreeByRValueRef { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddableFreeByRValueRef {} impl !Sync for AddableFreeByRValueRef {} unsafe impl ::cxx::ExternType for AddableFreeByRValueRef { - type Id = ::cxx::type_id!("AddableFreeByRValueRef"); + type Id = ::cxx::type_id!(":: AddableFreeByRValueRef"); type Kind = ::cxx::kind::Trivial; } @@ -378,14 +378,14 @@ impl ::core::ops::Add for crate::AddableFreeByValue { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Overloaded +///CRUBIT_ANNOTATE: cpp_type=:: Overloaded pub struct Overloaded { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Overloaded {} impl !Sync for Overloaded {} unsafe impl ::cxx::ExternType for Overloaded { - type Id = ::cxx::type_id!("Overloaded"); + type Id = ::cxx::type_id!(":: Overloaded"); type Kind = ::cxx::kind::Trivial; } @@ -430,14 +430,14 @@ impl Default for Overloaded { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=IncompatibleLHS +///CRUBIT_ANNOTATE: cpp_type=:: IncompatibleLHS pub struct IncompatibleLHS { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for IncompatibleLHS {} impl !Sync for IncompatibleLHS {} unsafe impl ::cxx::ExternType for IncompatibleLHS { - type Id = ::cxx::type_id!("IncompatibleLHS"); + type Id = ::cxx::type_id!(":: IncompatibleLHS"); type Kind = ::cxx::kind::Trivial; } @@ -480,7 +480,7 @@ impl Default for IncompatibleLHS { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=AddableReturnsVoid +///CRUBIT_ANNOTATE: cpp_type=:: AddableReturnsVoid pub struct AddableReturnsVoid { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -490,7 +490,7 @@ pub struct AddableReturnsVoid { impl !Send for AddableReturnsVoid {} impl !Sync for AddableReturnsVoid {} unsafe impl ::cxx::ExternType for AddableReturnsVoid { - type Id = ::cxx::type_id!("AddableReturnsVoid"); + type Id = ::cxx::type_id!(":: AddableReturnsVoid"); type Kind = ::cxx::kind::Trivial; } @@ -531,7 +531,7 @@ impl Default for AddableReturnsVoid { #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=AddableConstMemberNonunpin +///CRUBIT_ANNOTATE: cpp_type=:: AddableConstMemberNonunpin pub struct AddableConstMemberNonunpin { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: @@ -541,7 +541,7 @@ pub struct AddableConstMemberNonunpin { impl !Send for AddableConstMemberNonunpin {} impl !Sync for AddableConstMemberNonunpin {} unsafe impl ::cxx::ExternType for AddableConstMemberNonunpin { - type Id = ::cxx::type_id!("AddableConstMemberNonunpin"); + type Id = ::cxx::type_id!(":: AddableConstMemberNonunpin"); type Kind = ::cxx::kind::Opaque; } @@ -584,14 +584,14 @@ impl ::ctor::PinnedDrop for AddableConstMemberNonunpin { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignMemberInt +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignMemberInt pub struct AddAssignMemberInt { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignMemberInt {} impl !Sync for AddAssignMemberInt {} unsafe impl ::cxx::ExternType for AddAssignMemberInt { - type Id = ::cxx::type_id!("AddAssignMemberInt"); + type Id = ::cxx::type_id!(":: AddAssignMemberInt"); type Kind = ::cxx::kind::Trivial; } @@ -637,14 +637,14 @@ impl ::core::ops::AddAssign<::ffi_11::c_int> for AddAssignMemberInt { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignMemberByConstRef +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignMemberByConstRef pub struct AddAssignMemberByConstRef { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignMemberByConstRef {} impl !Sync for AddAssignMemberByConstRef {} unsafe impl ::cxx::ExternType for AddAssignMemberByConstRef { - type Id = ::cxx::type_id!("AddAssignMemberByConstRef"); + type Id = ::cxx::type_id!(":: AddAssignMemberByConstRef"); type Kind = ::cxx::kind::Trivial; } @@ -687,14 +687,14 @@ impl Default for AddAssignMemberByConstRef { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignFreeByConstRef +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignFreeByConstRef pub struct AddAssignFreeByConstRef { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignFreeByConstRef {} impl !Sync for AddAssignFreeByConstRef {} unsafe impl ::cxx::ExternType for AddAssignFreeByConstRef { - type Id = ::cxx::type_id!("AddAssignFreeByConstRef"); + type Id = ::cxx::type_id!(":: AddAssignFreeByConstRef"); type Kind = ::cxx::kind::Trivial; } @@ -740,14 +740,14 @@ impl ::core::ops::AddAssign<&Self> for crate::AddAssignFreeByConstRef { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignFreeByValue +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignFreeByValue pub struct AddAssignFreeByValue { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignFreeByValue {} impl !Sync for AddAssignFreeByValue {} unsafe impl ::cxx::ExternType for AddAssignFreeByValue { - type Id = ::cxx::type_id!("AddAssignFreeByValue"); + type Id = ::cxx::type_id!(":: AddAssignFreeByValue"); type Kind = ::cxx::kind::Trivial; } @@ -790,14 +790,14 @@ impl Default for AddAssignFreeByValue { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignFriendByConstRef +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignFriendByConstRef pub struct AddAssignFriendByConstRef { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignFriendByConstRef {} impl !Sync for AddAssignFriendByConstRef {} unsafe impl ::cxx::ExternType for AddAssignFriendByConstRef { - type Id = ::cxx::type_id!("AddAssignFriendByConstRef"); + type Id = ::cxx::type_id!(":: AddAssignFriendByConstRef"); type Kind = ::cxx::kind::Trivial; } @@ -843,14 +843,14 @@ impl ::core::ops::AddAssign<&Self> for crate::AddAssignFriendByConstRef { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignFriendByValue +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignFriendByValue pub struct AddAssignFriendByValue { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignFriendByValue {} impl !Sync for AddAssignFriendByValue {} unsafe impl ::cxx::ExternType for AddAssignFriendByValue { - type Id = ::cxx::type_id!("AddAssignFriendByValue"); + type Id = ::cxx::type_id!(":: AddAssignFriendByValue"); type Kind = ::cxx::kind::Trivial; } @@ -893,14 +893,14 @@ impl Default for AddAssignFriendByValue { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignProhibitedConstMember +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignProhibitedConstMember pub struct AddAssignProhibitedConstMember { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignProhibitedConstMember {} impl !Sync for AddAssignProhibitedConstMember {} unsafe impl ::cxx::ExternType for AddAssignProhibitedConstMember { - type Id = ::cxx::type_id!("AddAssignProhibitedConstMember"); + type Id = ::cxx::type_id!(":: AddAssignProhibitedConstMember"); type Kind = ::cxx::kind::Trivial; } @@ -957,14 +957,14 @@ where #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=AddAssignProhibitedFriendConstLhs +///CRUBIT_ANNOTATE: cpp_type=:: AddAssignProhibitedFriendConstLhs pub struct AddAssignProhibitedFriendConstLhs { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for AddAssignProhibitedFriendConstLhs {} impl !Sync for AddAssignProhibitedFriendConstLhs {} unsafe impl ::cxx::ExternType for AddAssignProhibitedFriendConstLhs { - type Id = ::cxx::type_id!("AddAssignProhibitedFriendConstLhs"); + type Id = ::cxx::type_id!(":: AddAssignProhibitedFriendConstLhs"); type Kind = ::cxx::kind::Trivial; } @@ -1007,14 +1007,14 @@ impl Default for AddAssignProhibitedFriendConstLhs { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=ManyOperators +///CRUBIT_ANNOTATE: cpp_type=:: ManyOperators pub struct ManyOperators { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for ManyOperators {} impl !Sync for ManyOperators {} unsafe impl ::cxx::ExternType for ManyOperators { - type Id = ::cxx::type_id!("ManyOperators"); + type Id = ::cxx::type_id!(":: ManyOperators"); type Kind = ::cxx::kind::Trivial; } impl ManyOperators { diff --git a/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc index 57cd68935..475e24bbe 100644 --- a/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/operators_rs_api_impl.cc @@ -18,188 +18,188 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(class AddableConstMember) == 4); -static_assert(alignof(class AddableConstMember) == 4); +static_assert(CRUBIT_SIZEOF(class ::AddableConstMember) == 4); +static_assert(alignof(class ::AddableConstMember) == 4); extern "C" void __rust_thunk___ZN18AddableConstMemberC1Ev( - class AddableConstMember* __this) { + class ::AddableConstMember* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class AddableNonConstMember) == 4); -static_assert(alignof(class AddableNonConstMember) == 4); +static_assert(CRUBIT_SIZEOF(class ::AddableNonConstMember) == 4); +static_assert(alignof(class ::AddableNonConstMember) == 4); extern "C" void __rust_thunk___ZN21AddableNonConstMemberC1Ev( - class AddableNonConstMember* __this) { + class ::AddableNonConstMember* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class AddableFriend) == 4); -static_assert(alignof(class AddableFriend) == 4); +static_assert(CRUBIT_SIZEOF(class ::AddableFriend) == 4); +static_assert(alignof(class ::AddableFriend) == 4); extern "C" void __rust_thunk___ZN13AddableFriendC1Ev( - class AddableFriend* __this) { + class ::AddableFriend* __this) { crubit::construct_at(__this); } -static_assert(sizeof(class AddableFreeByConstRef) == 1); -static_assert(alignof(class AddableFreeByConstRef) == 1); +static_assert(sizeof(class ::AddableFreeByConstRef) == 1); +static_assert(alignof(class ::AddableFreeByConstRef) == 1); extern "C" void __rust_thunk___ZN21AddableFreeByConstRefC1Ev( - class AddableFreeByConstRef* __this) { + class ::AddableFreeByConstRef* __this) { crubit::construct_at(__this); } -static_assert(sizeof(class AddableFreeByMutRef) == 1); -static_assert(alignof(class AddableFreeByMutRef) == 1); +static_assert(sizeof(class ::AddableFreeByMutRef) == 1); +static_assert(alignof(class ::AddableFreeByMutRef) == 1); extern "C" void __rust_thunk___ZN19AddableFreeByMutRefC1Ev( - class AddableFreeByMutRef* __this) { + class ::AddableFreeByMutRef* __this) { crubit::construct_at(__this); } -static_assert(sizeof(class AddableFreeByValue) == 1); -static_assert(alignof(class AddableFreeByValue) == 1); +static_assert(sizeof(class ::AddableFreeByValue) == 1); +static_assert(alignof(class ::AddableFreeByValue) == 1); extern "C" void __rust_thunk___ZN18AddableFreeByValueC1Ev( - class AddableFreeByValue* __this) { + class ::AddableFreeByValue* __this) { crubit::construct_at(__this); } -static_assert(sizeof(class AddableFreeByRValueRef) == 1); -static_assert(alignof(class AddableFreeByRValueRef) == 1); +static_assert(sizeof(class ::AddableFreeByRValueRef) == 1); +static_assert(alignof(class ::AddableFreeByRValueRef) == 1); extern "C" void __rust_thunk___ZN22AddableFreeByRValueRefC1Ev( - class AddableFreeByRValueRef* __this) { + class ::AddableFreeByRValueRef* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___Zpl18AddableFreeByValueS_( - class AddableFreeByValue* __return, class AddableFreeByValue* lhs, - class AddableFreeByValue* rhs) { + class ::AddableFreeByValue* __return, class ::AddableFreeByValue* lhs, + class ::AddableFreeByValue* rhs) { new (__return) auto(operator+(std::move(*lhs), std::move(*rhs))); } -static_assert(sizeof(class Overloaded) == 1); -static_assert(alignof(class Overloaded) == 1); +static_assert(sizeof(class ::Overloaded) == 1); +static_assert(alignof(class ::Overloaded) == 1); -extern "C" void __rust_thunk___ZN10OverloadedC1Ev(class Overloaded* __this) { +extern "C" void __rust_thunk___ZN10OverloadedC1Ev(class ::Overloaded* __this) { crubit::construct_at(__this); } -static_assert(sizeof(class IncompatibleLHS) == 1); -static_assert(alignof(class IncompatibleLHS) == 1); +static_assert(sizeof(class ::IncompatibleLHS) == 1); +static_assert(alignof(class ::IncompatibleLHS) == 1); extern "C" void __rust_thunk___ZN15IncompatibleLHSC1Ev( - class IncompatibleLHS* __this) { + class ::IncompatibleLHS* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class AddableReturnsVoid) == 4); -static_assert(alignof(class AddableReturnsVoid) == 4); +static_assert(CRUBIT_SIZEOF(class ::AddableReturnsVoid) == 4); +static_assert(alignof(class ::AddableReturnsVoid) == 4); extern "C" void __rust_thunk___ZN18AddableReturnsVoidC1Ev( - class AddableReturnsVoid* __this) { + class ::AddableReturnsVoid* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class AddableConstMemberNonunpin) == 4); -static_assert(alignof(class AddableConstMemberNonunpin) == 4); +static_assert(CRUBIT_SIZEOF(class ::AddableConstMemberNonunpin) == 4); +static_assert(alignof(class ::AddableConstMemberNonunpin) == 4); extern "C" void __rust_thunk___ZN26AddableConstMemberNonunpinC1Ev( - class AddableConstMemberNonunpin* __this) { + class ::AddableConstMemberNonunpin* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN26AddableConstMemberNonunpinD1Ev( - class AddableConstMemberNonunpin* __this) { + class ::AddableConstMemberNonunpin* __this) { std::destroy_at(__this); } -static_assert(sizeof(struct AddAssignMemberInt) == 1); -static_assert(alignof(struct AddAssignMemberInt) == 1); +static_assert(sizeof(struct ::AddAssignMemberInt) == 1); +static_assert(alignof(struct ::AddAssignMemberInt) == 1); extern "C" void __rust_thunk___ZN18AddAssignMemberIntC1Ev( - struct AddAssignMemberInt* __this) { + struct ::AddAssignMemberInt* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct AddAssignMemberByConstRef) == 1); -static_assert(alignof(struct AddAssignMemberByConstRef) == 1); +static_assert(sizeof(struct ::AddAssignMemberByConstRef) == 1); +static_assert(alignof(struct ::AddAssignMemberByConstRef) == 1); extern "C" void __rust_thunk___ZN25AddAssignMemberByConstRefC1Ev( - struct AddAssignMemberByConstRef* __this) { + struct ::AddAssignMemberByConstRef* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct AddAssignFreeByConstRef) == 1); -static_assert(alignof(struct AddAssignFreeByConstRef) == 1); +static_assert(sizeof(struct ::AddAssignFreeByConstRef) == 1); +static_assert(alignof(struct ::AddAssignFreeByConstRef) == 1); extern "C" void __rust_thunk___ZN23AddAssignFreeByConstRefC1Ev( - struct AddAssignFreeByConstRef* __this) { + struct ::AddAssignFreeByConstRef* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct AddAssignFreeByValue) == 1); -static_assert(alignof(struct AddAssignFreeByValue) == 1); +static_assert(sizeof(struct ::AddAssignFreeByValue) == 1); +static_assert(alignof(struct ::AddAssignFreeByValue) == 1); extern "C" void __rust_thunk___ZN20AddAssignFreeByValueC1Ev( - struct AddAssignFreeByValue* __this) { + struct ::AddAssignFreeByValue* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct AddAssignFriendByConstRef) == 1); -static_assert(alignof(struct AddAssignFriendByConstRef) == 1); +static_assert(sizeof(struct ::AddAssignFriendByConstRef) == 1); +static_assert(alignof(struct ::AddAssignFriendByConstRef) == 1); extern "C" void __rust_thunk___ZN25AddAssignFriendByConstRefC1Ev( - struct AddAssignFriendByConstRef* __this) { + struct ::AddAssignFriendByConstRef* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct AddAssignFriendByValue) == 1); -static_assert(alignof(struct AddAssignFriendByValue) == 1); +static_assert(sizeof(struct ::AddAssignFriendByValue) == 1); +static_assert(alignof(struct ::AddAssignFriendByValue) == 1); extern "C" void __rust_thunk___ZN22AddAssignFriendByValueC1Ev( - struct AddAssignFriendByValue* __this) { + struct ::AddAssignFriendByValue* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct AddAssignProhibitedConstMember) == 1); -static_assert(alignof(struct AddAssignProhibitedConstMember) == 1); +static_assert(sizeof(struct ::AddAssignProhibitedConstMember) == 1); +static_assert(alignof(struct ::AddAssignProhibitedConstMember) == 1); extern "C" void __rust_thunk___ZN30AddAssignProhibitedConstMemberC1Ev( - struct AddAssignProhibitedConstMember* __this) { + struct ::AddAssignProhibitedConstMember* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct AddAssignProhibitedFriendConstLhs) == 1); -static_assert(alignof(struct AddAssignProhibitedFriendConstLhs) == 1); +static_assert(sizeof(struct ::AddAssignProhibitedFriendConstLhs) == 1); +static_assert(alignof(struct ::AddAssignProhibitedFriendConstLhs) == 1); extern "C" void __rust_thunk___ZN33AddAssignProhibitedFriendConstLhsC1Ev( - struct AddAssignProhibitedFriendConstLhs* __this) { + struct ::AddAssignProhibitedFriendConstLhs* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct ManyOperators) == 1); -static_assert(alignof(struct ManyOperators) == 1); +static_assert(sizeof(struct ::ManyOperators) == 1); +static_assert(alignof(struct ::ManyOperators) == 1); extern "C" void __rust_thunk___ZN13ManyOperatorsC1Ev( - struct ManyOperators* __this) { + struct ::ManyOperators* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZNK13ManyOperatorspsEv( - struct ManyOperators* __return, struct ManyOperators const* __this) { + struct ::ManyOperators* __return, struct ::ManyOperators const* __this) { new (__return) auto(__this->operator+()); } extern "C" void __rust_thunk___ZNK13ManyOperatorsngEv( - struct ManyOperators* __return, struct ManyOperators const* __this) { + struct ::ManyOperators* __return, struct ::ManyOperators const* __this) { new (__return) auto(__this->operator-()); } extern "C" void __rust_thunk___ZNK13ManyOperatorsntEv( - struct ManyOperators* __return, struct ManyOperators const* __this) { + struct ::ManyOperators* __return, struct ::ManyOperators const* __this) { new (__return) auto(__this->operator!()); } 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 69e21c28b..a69f2d172 100644 --- a/rs_bindings_from_cc/test/golden/overloads_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/overloads_rs_api.rs @@ -54,14 +54,14 @@ pub fn AlsoTemplateOverload() { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Foo +///CRUBIT_ANNOTATE: cpp_type=:: Foo pub struct Foo { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Foo {} impl !Sync for Foo {} unsafe impl ::cxx::ExternType for Foo { - type Id = ::cxx::type_id!("Foo"); + type Id = ::cxx::type_id!(":: Foo"); type Kind = ::cxx::kind::Trivial; } impl Foo { diff --git a/rs_bindings_from_cc/test/golden/overloads_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/overloads_rs_api_impl.cc index 56e9757a2..b78e71ecd 100644 --- a/rs_bindings_from_cc/test/golden/overloads_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/overloads_rs_api_impl.cc @@ -23,15 +23,15 @@ static_assert((void (*)()) & ::Overload2); static_assert((void (*)(int)) & ::Overlaod2); extern "C" void __rust_thunk___Z20AlsoTemplateOverloadv() { - AlsoTemplateOverload(); + ::AlsoTemplateOverload(); } static_assert((void (*)()) & ::AlsoTemplateOverload); -static_assert(sizeof(class Foo) == 1); -static_assert(alignof(class Foo) == 1); +static_assert(sizeof(class ::Foo) == 1); +static_assert(alignof(class ::Foo) == 1); -extern "C" void __rust_thunk___ZN3FooC1Ev(class Foo* __this) { +extern "C" void __rust_thunk___ZN3FooC1Ev(class ::Foo* __this) { crubit::construct_at(__this); } diff --git a/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api_impl.cc index f38b65efd..429b1723b 100644 --- a/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/overloads_unsupported_template_rs_api_impl.cc @@ -16,7 +16,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -extern "C" void __rust_thunk___Z8Overloadv() { Overload(); } +extern "C" void __rust_thunk___Z8Overloadv() { ::Overload(); } static_assert((void (*)()) & ::Overload); 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 5f4ff6fea..2f0a8f968 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 @@ -20,14 +20,14 @@ /// See http://b/251045039 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeClass +///CRUBIT_ANNOTATE: cpp_type=:: SomeClass pub struct SomeClass { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeClass {} impl !Sync for SomeClass {} unsafe impl ::cxx::ExternType for SomeClass { - type Id = ::cxx::type_id!("SomeClass"); + type Id = ::cxx::type_id!(":: SomeClass"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api_impl.cc index cac6a349e..5e8586623 100644 --- a/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/overloads_unsupported_type_rs_api_impl.cc @@ -18,10 +18,10 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class SomeClass) == 1); -static_assert(alignof(class SomeClass) == 1); +static_assert(sizeof(class ::SomeClass) == 1); +static_assert(alignof(class ::SomeClass) == 1); -extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class SomeClass* __this) { +extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class ::SomeClass* __this) { crubit::construct_at(__this); } 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 dc487e6a9..11331cc62 100644 --- a/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs @@ -16,14 +16,14 @@ #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=PolymorphicBase +///CRUBIT_ANNOTATE: cpp_type=:: PolymorphicBase pub struct PolymorphicBase { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], } impl !Send for PolymorphicBase {} impl !Sync for PolymorphicBase {} unsafe impl ::cxx::ExternType for PolymorphicBase { - type Id = ::cxx::type_id!("PolymorphicBase"); + type Id = ::cxx::type_id!(":: PolymorphicBase"); type Kind = ::cxx::kind::Opaque; } @@ -71,14 +71,14 @@ unsafe impl ::operator::Delete for crate::PolymorphicBase { #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=PolymorphicBase2 +///CRUBIT_ANNOTATE: cpp_type=:: PolymorphicBase2 pub struct PolymorphicBase2 { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 8], } impl !Send for PolymorphicBase2 {} impl !Sync for PolymorphicBase2 {} unsafe impl ::cxx::ExternType for PolymorphicBase2 { - type Id = ::cxx::type_id!("PolymorphicBase2"); + type Id = ::cxx::type_id!(":: PolymorphicBase2"); type Kind = ::cxx::kind::Opaque; } impl PolymorphicBase2 { @@ -139,14 +139,14 @@ pub mod polymorphic_base2 { #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=PolymorphicDerived +///CRUBIT_ANNOTATE: cpp_type=:: PolymorphicDerived pub struct PolymorphicDerived { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 16], } impl !Send for PolymorphicDerived {} impl !Sync for PolymorphicDerived {} unsafe impl ::cxx::ExternType for PolymorphicDerived { - type Id = ::cxx::type_id!("PolymorphicDerived"); + type Id = ::cxx::type_id!(":: PolymorphicDerived"); type Kind = ::cxx::kind::Opaque; } diff --git a/rs_bindings_from_cc/test/golden/polymorphic_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/polymorphic_rs_api_impl.cc index 0521a8ab5..a38875904 100644 --- a/rs_bindings_from_cc/test/golden/polymorphic_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/polymorphic_rs_api_impl.cc @@ -18,67 +18,67 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(class PolymorphicBase) == 8); -static_assert(alignof(class PolymorphicBase) == 8); +static_assert(CRUBIT_SIZEOF(class ::PolymorphicBase) == 8); +static_assert(alignof(class ::PolymorphicBase) == 8); extern "C" void __rust_thunk___ZN15PolymorphicBaseC1Ev( - class PolymorphicBase* __this) { + class ::PolymorphicBase* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN15PolymorphicBaseD1Ev( - class PolymorphicBase* __this) { + class ::PolymorphicBase* __this) { std::destroy_at(__this); } extern "C" void __crubit_operator_delete__15PolymorphicBase___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3apolymorphic_5fcc( - class PolymorphicBase* ptr) { + class ::PolymorphicBase* ptr) { delete ptr; } -static_assert(CRUBIT_SIZEOF(class PolymorphicBase2) == 8); -static_assert(alignof(class PolymorphicBase2) == 8); +static_assert(CRUBIT_SIZEOF(class ::PolymorphicBase2) == 8); +static_assert(alignof(class ::PolymorphicBase2) == 8); extern "C" void __rust_thunk___ZN16PolymorphicBase2C1Ev( - class PolymorphicBase2* __this) { + class ::PolymorphicBase2* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN16PolymorphicBase23FooEv( - class PolymorphicBase2* __this) { + class ::PolymorphicBase2* __this) { __this->Foo(); } static_assert((void (::PolymorphicBase2::*)()) & ::PolymorphicBase2::Foo); extern "C" void __rust_thunk___ZN16PolymorphicBase2D1Ev( - class PolymorphicBase2* __this) { + class ::PolymorphicBase2* __this) { std::destroy_at(__this); } extern "C" void __crubit_operator_delete__16PolymorphicBase2___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3apolymorphic_5fcc( - class PolymorphicBase2* ptr) { + class ::PolymorphicBase2* ptr) { delete ptr; } -static_assert(CRUBIT_SIZEOF(class PolymorphicDerived) == 16); -static_assert(alignof(class PolymorphicDerived) == 8); +static_assert(CRUBIT_SIZEOF(class ::PolymorphicDerived) == 16); +static_assert(alignof(class ::PolymorphicDerived) == 8); extern "C" void __rust_thunk___ZN18PolymorphicDerivedC1Ev( - class PolymorphicDerived* __this) { + class ::PolymorphicDerived* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN18PolymorphicDerivedD1Ev( - class PolymorphicDerived* __this) { + class ::PolymorphicDerived* __this) { std::destroy_at(__this); } extern "C" void __crubit_operator_delete__18PolymorphicDerived___2f_2fthird_5fparty_2fcrubit_2frs_5fbindings_5ffrom_5fcc_2ftest_2fgolden_3apolymorphic_5fcc( - class PolymorphicDerived* ptr) { + class ::PolymorphicDerived* ptr) { delete ptr; } 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 6ec927e68..cfc26731e 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 @@ -17,7 +17,7 @@ pub mod test_namespace_bindings { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] - ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings :: SomeClass + ///CRUBIT_ANNOTATE: cpp_type=:: test_namespace_bindings :: SomeClass pub struct SomeClass { __non_field_data: [::core::mem::MaybeUninit; 0], pub public_member_variable_: ::ffi_11::c_int, @@ -28,7 +28,7 @@ pub mod test_namespace_bindings { impl !Send for SomeClass {} impl !Sync for SomeClass {} unsafe impl ::cxx::ExternType for SomeClass { - type Id = ::cxx::type_id!("test_namespace_bindings :: SomeClass"); + type Id = ::cxx::type_id!(":: test_namespace_bindings :: SomeClass"); type Kind = ::cxx::kind::Trivial; } impl SomeClass { diff --git a/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc index eba5f07cb..ce418917b 100644 --- a/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/private_members_rs_api_impl.cc @@ -18,13 +18,14 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(class test_namespace_bindings::SomeClass) == 8); -static_assert(alignof(class test_namespace_bindings::SomeClass) == 4); +static_assert(CRUBIT_SIZEOF(class ::test_namespace_bindings::SomeClass) == 8); +static_assert(alignof(class ::test_namespace_bindings::SomeClass) == 4); static_assert(CRUBIT_OFFSET_OF(public_member_variable_, - class test_namespace_bindings::SomeClass) == 0); + class ::test_namespace_bindings::SomeClass) == + 0); extern "C" void __rust_thunk___ZN23test_namespace_bindings9SomeClassC1Ev( - class test_namespace_bindings::SomeClass* __this) { + class ::test_namespace_bindings::SomeClass* __this) { crubit::construct_at(__this); } 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 b8b2f8983..62d134198 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 @@ -19,14 +19,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Outer +///CRUBIT_ANNOTATE: cpp_type=:: Outer pub struct Outer { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Outer {} impl !Sync for Outer {} unsafe impl ::cxx::ExternType for Outer { - type Id = ::cxx::type_id!("Outer"); + type Id = ::cxx::type_id!(":: Outer"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/private_method_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/private_method_rs_api_impl.cc index 2f1327fb4..59189c73c 100644 --- a/rs_bindings_from_cc/test/golden/private_method_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/private_method_rs_api_impl.cc @@ -18,10 +18,10 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class Outer) == 1); -static_assert(alignof(class Outer) == 1); +static_assert(sizeof(class ::Outer) == 1); +static_assert(alignof(class ::Outer) == 1); -extern "C" void __rust_thunk___ZN5OuterC1Ev(class Outer* __this) { +extern "C" void __rust_thunk___ZN5OuterC1Ev(class ::Outer* __this) { crubit::construct_at(__this); } 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 b5914ab4c..61bedff5d 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 @@ -16,7 +16,7 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=SomeClass +///CRUBIT_ANNOTATE: cpp_type=:: SomeClass pub struct SomeClass { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -26,7 +26,7 @@ pub struct SomeClass { impl !Send for SomeClass {} impl !Sync for SomeClass {} unsafe impl ::cxx::ExternType for SomeClass { - type Id = ::cxx::type_id!("SomeClass"); + type Id = ::cxx::type_id!(":: SomeClass"); type Kind = ::cxx::kind::Trivial; } impl SomeClass { diff --git a/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc index d0644ab78..501d3c10d 100644 --- a/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/static_methods_rs_api_impl.cc @@ -18,19 +18,21 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(class SomeClass) == 4); -static_assert(alignof(class SomeClass) == 4); +static_assert(CRUBIT_SIZEOF(class ::SomeClass) == 4); +static_assert(alignof(class ::SomeClass) == 4); -extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class SomeClass* __this) { +extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class ::SomeClass* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN9SomeClass21static_factory_methodEi( - class SomeClass* __return, int initial_value_of_field) { - new (__return) auto(SomeClass::static_factory_method(initial_value_of_field)); + class ::SomeClass* __return, int initial_value_of_field) { + new (__return) auto( + ::SomeClass::static_factory_method(initial_value_of_field)); } -static_assert((class SomeClass (*)(int)) & ::SomeClass::static_factory_method); +static_assert((class ::SomeClass (*)(int)) & + ::SomeClass::static_factory_method); static_assert((int (*)(int, int)) & ::SomeClass::static_method_that_multiplies_its_args); 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 c21c6a9dd..c7e836723 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 @@ -29,14 +29,14 @@ pub(crate) fn GetMyTemplate() -> crate::__CcTemplateInst10MyTemplateIiE { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=MyTemplate < int > +///CRUBIT_ANNOTATE: cpp_type=:: MyTemplate < int > pub(crate) struct __CcTemplateInst10MyTemplateIiE { pub field: ::ffi_11::c_int, } impl !Send for __CcTemplateInst10MyTemplateIiE {} impl !Sync for __CcTemplateInst10MyTemplateIiE {} forward_declare::unsafe_define!( - forward_declare::symbol!("MyTemplate < int >"), + forward_declare::symbol!(":: MyTemplate < int >"), crate::__CcTemplateInst10MyTemplateIiE ); diff --git a/rs_bindings_from_cc/test/golden/template_inst_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/template_inst_rs_api_impl.cc index 6a5badf4c..8b7072505 100644 --- a/rs_bindings_from_cc/test/golden/template_inst_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/template_inst_rs_api_impl.cc @@ -19,14 +19,14 @@ #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" void __rust_thunk___Z13GetMyTemplatev( - struct MyTemplate* __return) { - new (__return) auto(GetMyTemplate()); + struct ::MyTemplate* __return) { + new (__return) auto(::GetMyTemplate()); } -static_assert((struct MyTemplate (*)()) & ::GetMyTemplate); +static_assert((struct ::MyTemplate (*)()) & ::GetMyTemplate); -static_assert(CRUBIT_SIZEOF(struct MyTemplate) == 4); -static_assert(alignof(struct MyTemplate) == 4); -static_assert(CRUBIT_OFFSET_OF(field, struct MyTemplate) == 0); +static_assert(CRUBIT_SIZEOF(struct ::MyTemplate) == 4); +static_assert(alignof(struct ::MyTemplate) == 4); +static_assert(CRUBIT_OFFSET_OF(field, struct ::MyTemplate) == 0); #pragma clang diagnostic pop 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 b4623f119..9f42ae10b 100644 --- a/rs_bindings_from_cc/test/golden/templates_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/templates_rs_api.rs @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=DifferentScope +///CRUBIT_ANNOTATE: cpp_type=:: DifferentScope pub struct DifferentScope { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for DifferentScope {} impl !Sync for DifferentScope {} unsafe impl ::cxx::ExternType for DifferentScope { - type Id = ::cxx::type_id!("DifferentScope"); + type Id = ::cxx::type_id!(":: DifferentScope"); type Kind = ::cxx::kind::Trivial; } @@ -50,14 +50,14 @@ pub mod test_namespace_bindings { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings :: TemplateParam + ///CRUBIT_ANNOTATE: cpp_type=:: test_namespace_bindings :: TemplateParam pub struct TemplateParam { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for TemplateParam {} impl !Sync for TemplateParam {} unsafe impl ::cxx::ExternType for TemplateParam { - type Id = ::cxx::type_id!("test_namespace_bindings :: TemplateParam"); + type Id = ::cxx::type_id!(":: test_namespace_bindings :: TemplateParam"); type Kind = ::cxx::kind::Trivial; } @@ -148,14 +148,14 @@ pub mod forward_declared_template { // error: class `forward_declared_template:: pub mod private_classes { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=private_classes :: HasPrivateType + ///CRUBIT_ANNOTATE: cpp_type=:: private_classes :: HasPrivateType pub struct HasPrivateType { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for HasPrivateType {} impl !Sync for HasPrivateType {} unsafe impl ::cxx::ExternType for HasPrivateType { - type Id = ::cxx::type_id!("private_classes :: HasPrivateType"); + type Id = ::cxx::type_id!(":: private_classes :: HasPrivateType"); type Kind = ::cxx::kind::Trivial; } } diff --git a/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc index 9ddc0dc07..5dc8cd299 100644 --- a/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc @@ -18,23 +18,23 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct DifferentScope) == 1); -static_assert(alignof(struct DifferentScope) == 1); +static_assert(sizeof(struct ::DifferentScope) == 1); +static_assert(alignof(struct ::DifferentScope) == 1); extern "C" void __rust_thunk___ZN14DifferentScopeC1Ev( - struct DifferentScope* __this) { + struct ::DifferentScope* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct test_namespace_bindings::TemplateParam) == 1); -static_assert(alignof(struct test_namespace_bindings::TemplateParam) == 1); +static_assert(sizeof(struct ::test_namespace_bindings::TemplateParam) == 1); +static_assert(alignof(struct ::test_namespace_bindings::TemplateParam) == 1); extern "C" void __rust_thunk___ZN23test_namespace_bindings13TemplateParamC1Ev( - struct test_namespace_bindings::TemplateParam* __this) { + struct ::test_namespace_bindings::TemplateParam* __this) { crubit::construct_at(__this); } -static_assert(sizeof(class private_classes::HasPrivateType) == 1); -static_assert(alignof(class private_classes::HasPrivateType) == 1); +static_assert(sizeof(class ::private_classes::HasPrivateType) == 1); +static_assert(alignof(class ::private_classes::HasPrivateType) == 1); #pragma clang diagnostic pop 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 fa477c027..94d356862 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 @@ -19,14 +19,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TopLevel +///CRUBIT_ANNOTATE: cpp_type=:: TopLevel pub struct TopLevel { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for TopLevel {} impl !Sync for TopLevel {} unsafe impl ::cxx::ExternType for TopLevel { - type Id = ::cxx::type_id!("TopLevel"); + type Id = ::cxx::type_id!(":: TopLevel"); type Kind = ::cxx::kind::Trivial; } @@ -62,14 +62,14 @@ impl Default for TopLevel { pub mod test_namespace_bindings { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=test_namespace_bindings :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: test_namespace_bindings :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("test_namespace_bindings :: Inner"); + type Id = ::cxx::type_id!(":: test_namespace_bindings :: Inner"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc index a2dcc3a03..fe50093ab 100644 --- a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api_impl.cc @@ -18,18 +18,18 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct TopLevel) == 1); -static_assert(alignof(struct TopLevel) == 1); +static_assert(sizeof(struct ::TopLevel) == 1); +static_assert(alignof(struct ::TopLevel) == 1); -extern "C" void __rust_thunk___ZN8TopLevelC1Ev(struct TopLevel* __this) { +extern "C" void __rust_thunk___ZN8TopLevelC1Ev(struct ::TopLevel* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct test_namespace_bindings::Inner) == 1); -static_assert(alignof(struct test_namespace_bindings::Inner) == 1); +static_assert(sizeof(struct ::test_namespace_bindings::Inner) == 1); +static_assert(alignof(struct ::test_namespace_bindings::Inner) == 1); extern "C" void __rust_thunk___ZN23test_namespace_bindings5InnerC1Ev( - struct test_namespace_bindings::Inner* __this) { + struct ::test_namespace_bindings::Inner* __this) { crubit::construct_at(__this); } 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 3e2ddac0f..6fc469de0 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 @@ -19,14 +19,14 @@ pub mod ns { /// only trivial members. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=ns :: Trivial + ///CRUBIT_ANNOTATE: cpp_type=:: ns :: Trivial pub struct Trivial { pub trivial_field: ::ffi_11::c_int, } impl !Send for Trivial {} impl !Sync for Trivial {} unsafe impl ::cxx::ExternType for Trivial { - type Id = ::cxx::type_id!("ns :: Trivial"); + type Id = ::cxx::type_id!(":: ns :: Trivial"); type Kind = ::cxx::kind::Trivial; } impl Trivial { diff --git a/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc index dea74f2a9..4b0822edf 100644 --- a/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/trivial_type_rs_api_impl.cc @@ -18,11 +18,11 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct ns::Trivial) == 4); -static_assert(alignof(struct ns::Trivial) == 4); -static_assert(CRUBIT_OFFSET_OF(trivial_field, struct ns::Trivial) == 0); +static_assert(CRUBIT_SIZEOF(struct ::ns::Trivial) == 4); +static_assert(alignof(struct ::ns::Trivial) == 4); +static_assert(CRUBIT_OFFSET_OF(trivial_field, struct ::ns::Trivial) == 0); -extern "C" void __rust_thunk___ZN2ns7TrivialC1Ev(struct ns::Trivial* __this) { +extern "C" void __rust_thunk___ZN2ns7TrivialC1Ev(struct ::ns::Trivial* __this) { crubit::construct_at(__this); } @@ -37,11 +37,11 @@ static_assert((void (::ns::Trivial::*)() const&)&::ns::Trivial::ConstLvalueRefQualified); extern "C" void __rust_thunk___ZN2ns12TakesByValueENS_7TrivialE( - struct ns::Trivial* __return, struct ns::Trivial* trivial) { - new (__return) auto(ns::TakesByValue(std::move(*trivial))); + struct ::ns::Trivial* __return, struct ::ns::Trivial* trivial) { + new (__return) auto(::ns::TakesByValue(std::move(*trivial))); } -static_assert((struct ns::Trivial (*)(struct ns::Trivial)) & +static_assert((struct ::ns::Trivial (*)(struct ::ns::Trivial)) & ::ns::TakesByValue); #pragma clang diagnostic pop 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 79014bbb0..14c9cf89b 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 @@ -17,7 +17,7 @@ /// 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)] -///CRUBIT_ANNOTATE: cpp_type=Enum +///CRUBIT_ANNOTATE: cpp_type=:: Enum pub struct Enum(::ffi_11::c_uint); impl Enum { pub const kValue: Enum = Enum(::ffi_11::new_c_uint(0)); @@ -36,7 +36,7 @@ impl From for ::ffi_11::c_uint { /// Generated from: rs_bindings_from_cc/test/golden/type_annotations.h;l=9[376,385] #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] -///CRUBIT_ANNOTATE: cpp_type=EnumClass +///CRUBIT_ANNOTATE: cpp_type=:: EnumClass pub struct EnumClass(::ffi_11::c_int); impl EnumClass { pub const kValue: EnumClass = EnumClass(::ffi_11::new_c_int(0)); @@ -52,4 +52,4 @@ impl From for ::ffi_11::c_int { } } -// This file contains Kythe metadata. eyJ0eXBlIjoia3l0aGUwIiwibWV0YSI6W3sidHlwZSI6ImFuY2hvcl9hbmNob3IiLCJzb3VyY2VfYmVnaW4iOjM0OCwic291cmNlX2VuZCI6MzUyLCJ0YXJnZXRfYmVnaW4iOjU5MiwidGFyZ2V0X2VuZCI6NTk2LCJlZGdlIjoiL2t5dGhlL2VkZ2UvaW1wdXRlcyIsInNvdXJjZV92bmFtZSI6eyJjb3JwdXMiOiJjb3JwdXMiLCJwYXRoIjoidGhpcmRfcGFydHkvY3J1Yml0L3JzX2JpbmRpbmdzX2Zyb21fY2MvdGVzdC9nb2xkZW4vdHlwZV9hbm5vdGF0aW9ucy5oIiwibGFuZ3VhZ2UiOiJjKysifX0seyJ0eXBlIjoiYW5jaG9yX2FuY2hvciIsInNvdXJjZV9iZWdpbiI6Mzc2LCJzb3VyY2VfZW5kIjozODUsInRhcmdldF9iZWdpbiI6MTE2NSwidGFyZ2V0X2VuZCI6MTE3NCwiZWRnZSI6Ii9reXRoZS9lZGdlL2ltcHV0ZXMiLCJzb3VyY2Vfdm5hbWUiOnsiY29ycHVzIjoiY29ycHVzIiwicGF0aCI6InRoaXJkX3BhcnR5L2NydWJpdC9yc19iaW5kaW5nc19mcm9tX2NjL3Rlc3QvZ29sZGVuL3R5cGVfYW5ub3RhdGlvbnMuaCIsImxhbmd1YWdlIjoiYysrIn19XX0= +// This file contains Kythe metadata. eyJ0eXBlIjoia3l0aGUwIiwibWV0YSI6W3sidHlwZSI6ImFuY2hvcl9hbmNob3IiLCJzb3VyY2VfYmVnaW4iOjM0OCwic291cmNlX2VuZCI6MzUyLCJ0YXJnZXRfYmVnaW4iOjU5NSwidGFyZ2V0X2VuZCI6NTk5LCJlZGdlIjoiL2t5dGhlL2VkZ2UvaW1wdXRlcyIsInNvdXJjZV92bmFtZSI6eyJjb3JwdXMiOiJjb3JwdXMiLCJwYXRoIjoidGhpcmRfcGFydHkvY3J1Yml0L3JzX2JpbmRpbmdzX2Zyb21fY2MvdGVzdC9nb2xkZW4vdHlwZV9hbm5vdGF0aW9ucy5oIiwibGFuZ3VhZ2UiOiJjKysifX0seyJ0eXBlIjoiYW5jaG9yX2FuY2hvciIsInNvdXJjZV9iZWdpbiI6Mzc2LCJzb3VyY2VfZW5kIjozODUsInRhcmdldF9iZWdpbiI6MTE3MSwidGFyZ2V0X2VuZCI6MTE4MCwiZWRnZSI6Ii9reXRoZS9lZGdlL2ltcHV0ZXMiLCJzb3VyY2Vfdm5hbWUiOnsiY29ycHVzIjoiY29ycHVzIiwicGF0aCI6InRoaXJkX3BhcnR5L2NydWJpdC9yc19iaW5kaW5nc19mcm9tX2NjL3Rlc3QvZ29sZGVuL3R5cGVfYW5ub3RhdGlvbnMuaCIsImxhbmd1YWdlIjoiYysrIn19XX0= 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 fa4e6c608..0f46c7de5 100644 --- a/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeStruct +///CRUBIT_ANNOTATE: cpp_type=:: SomeStruct pub struct SomeStruct { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeStruct {} impl !Sync for SomeStruct {} unsafe impl ::cxx::ExternType for SomeStruct { - type Id = ::cxx::type_id!("SomeStruct"); + type Id = ::cxx::type_id!(":: SomeStruct"); type Kind = ::cxx::kind::Trivial; } @@ -47,14 +47,14 @@ pub mod some_struct { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeOtherStruct +///CRUBIT_ANNOTATE: cpp_type=:: SomeOtherStruct pub struct SomeOtherStruct { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeOtherStruct {} impl !Sync for SomeOtherStruct {} unsafe impl ::cxx::ExternType for SomeOtherStruct { - type Id = ::cxx::type_id!("SomeOtherStruct"); + type Id = ::cxx::type_id!(":: SomeOtherStruct"); type Kind = ::cxx::kind::Trivial; } @@ -75,14 +75,14 @@ impl Default for SomeOtherStruct { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeUnion +///CRUBIT_ANNOTATE: cpp_type=:: SomeUnion pub union SomeUnion { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeUnion {} impl !Sync for SomeUnion {} unsafe impl ::cxx::ExternType for SomeUnion { - type Id = ::cxx::type_id!("SomeUnion"); + type Id = ::cxx::type_id!(":: SomeUnion"); type Kind = ::cxx::kind::Trivial; } @@ -106,14 +106,14 @@ impl Default for SomeUnion { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeOtherUnion +///CRUBIT_ANNOTATE: cpp_type=:: SomeOtherUnion pub union SomeOtherUnion { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeOtherUnion {} impl !Sync for SomeOtherUnion {} unsafe impl ::cxx::ExternType for SomeOtherUnion { - type Id = ::cxx::type_id!("SomeOtherUnion"); + type Id = ::cxx::type_id!(":: SomeOtherUnion"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc index 48e2edc80..4663c3d78 100644 --- a/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/typedefs_rs_api_impl.cc @@ -18,35 +18,36 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct SomeStruct) == 1); -static_assert(alignof(struct SomeStruct) == 1); +static_assert(sizeof(struct ::SomeStruct) == 1); +static_assert(alignof(struct ::SomeStruct) == 1); -extern "C" void __rust_thunk___ZN10SomeStructC1Ev(struct SomeStruct* __this) { +extern "C" void __rust_thunk___ZN10SomeStructC1Ev(struct ::SomeStruct* __this) { crubit::construct_at(__this); } -static_assert(sizeof(SomeOtherStruct) == 1); -static_assert(alignof(SomeOtherStruct) == 1); +static_assert(sizeof(::SomeOtherStruct) == 1); +static_assert(alignof(::SomeOtherStruct) == 1); extern "C" void __rust_thunk___ZN15SomeOtherStructC1Ev( - SomeOtherStruct* __this) { + ::SomeOtherStruct* __this) { crubit::construct_at(__this); } -static_assert(sizeof(union SomeUnion) == 1); -static_assert(alignof(union SomeUnion) == 1); +static_assert(sizeof(union ::SomeUnion) == 1); +static_assert(alignof(union ::SomeUnion) == 1); -extern "C" void __rust_thunk___ZN9SomeUnionC1Ev(union SomeUnion* __this) { +extern "C" void __rust_thunk___ZN9SomeUnionC1Ev(union ::SomeUnion* __this) { crubit::construct_at(__this); } -static_assert(sizeof(SomeOtherUnion) == 1); -static_assert(alignof(SomeOtherUnion) == 1); +static_assert(sizeof(::SomeOtherUnion) == 1); +static_assert(alignof(::SomeOtherUnion) == 1); -extern "C" void __rust_thunk___ZN14SomeOtherUnionC1Ev(SomeOtherUnion* __this) { +extern "C" void __rust_thunk___ZN14SomeOtherUnionC1Ev( + ::SomeOtherUnion* __this) { crubit::construct_at(__this); } -static_assert((SomeStruct::nested_type (*)()) & ::FunctionUsingNestedType); +static_assert((::SomeStruct::nested_type (*)()) & ::FunctionUsingNestedType); #pragma clang diagnostic pop 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 998f37d88..d50b0b899 100644 --- a/rs_bindings_from_cc/test/golden/types_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/types_rs_api.rs @@ -22,14 +22,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeStruct +///CRUBIT_ANNOTATE: cpp_type=:: SomeStruct pub struct SomeStruct { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for SomeStruct {} impl !Sync for SomeStruct {} unsafe impl ::cxx::ExternType for SomeStruct { - type Id = ::cxx::type_id!("SomeStruct"); + type Id = ::cxx::type_id!(":: SomeStruct"); type Kind = ::cxx::kind::Trivial; } @@ -86,7 +86,7 @@ impl Default for SomeStruct { /// * `cyclic_ptr_field`: raw pointer #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=FieldTypeTestStruct +///CRUBIT_ANNOTATE: cpp_type=:: FieldTypeTestStruct pub struct FieldTypeTestStruct { pub bool_field: bool, pub char_field: ::ffi_11::c_char, @@ -138,7 +138,7 @@ pub struct FieldTypeTestStruct { impl !Send for FieldTypeTestStruct {} impl !Sync for FieldTypeTestStruct {} unsafe impl ::cxx::ExternType for FieldTypeTestStruct { - type Id = ::cxx::type_id!("FieldTypeTestStruct"); + type Id = ::cxx::type_id!(":: FieldTypeTestStruct"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc index 972d96d9f..fa608cf9b 100644 --- a/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/types_rs_api_impl.cc @@ -18,85 +18,88 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct SomeStruct) == 1); -static_assert(alignof(struct SomeStruct) == 1); +static_assert(sizeof(struct ::SomeStruct) == 1); +static_assert(alignof(struct ::SomeStruct) == 1); -extern "C" void __rust_thunk___ZN10SomeStructC1Ev(struct SomeStruct* __this) { +extern "C" void __rust_thunk___ZN10SomeStructC1Ev(struct ::SomeStruct* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct FieldTypeTestStruct) == 208); -static_assert(alignof(struct FieldTypeTestStruct) == 8); -static_assert(CRUBIT_OFFSET_OF(bool_field, struct FieldTypeTestStruct) == 0); -static_assert(CRUBIT_OFFSET_OF(char_field, struct FieldTypeTestStruct) == 1); +static_assert(CRUBIT_SIZEOF(struct ::FieldTypeTestStruct) == 208); +static_assert(alignof(struct ::FieldTypeTestStruct) == 8); +static_assert(CRUBIT_OFFSET_OF(bool_field, struct ::FieldTypeTestStruct) == 0); +static_assert(CRUBIT_OFFSET_OF(char_field, struct ::FieldTypeTestStruct) == 1); static_assert(CRUBIT_OFFSET_OF(unsigned_char_field, - struct FieldTypeTestStruct) == 2); -static_assert(CRUBIT_OFFSET_OF(signed_char_field, struct FieldTypeTestStruct) == - 3); -static_assert(CRUBIT_OFFSET_OF(char16_t_field, struct FieldTypeTestStruct) == + struct ::FieldTypeTestStruct) == 2); +static_assert(CRUBIT_OFFSET_OF(signed_char_field, + struct ::FieldTypeTestStruct) == 3); +static_assert(CRUBIT_OFFSET_OF(char16_t_field, struct ::FieldTypeTestStruct) == 4); -static_assert(CRUBIT_OFFSET_OF(char32_t_field, struct FieldTypeTestStruct) == +static_assert(CRUBIT_OFFSET_OF(char32_t_field, struct ::FieldTypeTestStruct) == 8); -static_assert(CRUBIT_OFFSET_OF(wchar_t_field, struct FieldTypeTestStruct) == +static_assert(CRUBIT_OFFSET_OF(wchar_t_field, struct ::FieldTypeTestStruct) == 12); -static_assert(CRUBIT_OFFSET_OF(short_field, struct FieldTypeTestStruct) == 16); -static_assert(CRUBIT_OFFSET_OF(int_field, struct FieldTypeTestStruct) == 20); -static_assert(CRUBIT_OFFSET_OF(long_field, struct FieldTypeTestStruct) == 24); -static_assert(CRUBIT_OFFSET_OF(long_long_field, struct FieldTypeTestStruct) == +static_assert(CRUBIT_OFFSET_OF(short_field, struct ::FieldTypeTestStruct) == + 16); +static_assert(CRUBIT_OFFSET_OF(int_field, struct ::FieldTypeTestStruct) == 20); +static_assert(CRUBIT_OFFSET_OF(long_field, struct ::FieldTypeTestStruct) == 24); +static_assert(CRUBIT_OFFSET_OF(long_long_field, struct ::FieldTypeTestStruct) == 32); static_assert(CRUBIT_OFFSET_OF(unsigned_short_field, - struct FieldTypeTestStruct) == 40); + struct ::FieldTypeTestStruct) == 40); static_assert(CRUBIT_OFFSET_OF(unsigned_int_field, - struct FieldTypeTestStruct) == 44); + struct ::FieldTypeTestStruct) == 44); static_assert(CRUBIT_OFFSET_OF(unsigned_long_field, - struct FieldTypeTestStruct) == 48); + struct ::FieldTypeTestStruct) == 48); static_assert(CRUBIT_OFFSET_OF(unsigned_long_long_field, - struct FieldTypeTestStruct) == 56); + struct ::FieldTypeTestStruct) == 56); static_assert(CRUBIT_OFFSET_OF(signed_short_field, - struct FieldTypeTestStruct) == 64); -static_assert(CRUBIT_OFFSET_OF(signed_int_field, struct FieldTypeTestStruct) == - 68); -static_assert(CRUBIT_OFFSET_OF(signed_long_field, struct FieldTypeTestStruct) == - 72); + struct ::FieldTypeTestStruct) == 64); +static_assert(CRUBIT_OFFSET_OF(signed_int_field, + struct ::FieldTypeTestStruct) == 68); +static_assert(CRUBIT_OFFSET_OF(signed_long_field, + struct ::FieldTypeTestStruct) == 72); static_assert(CRUBIT_OFFSET_OF(signed_long_long_field, - struct FieldTypeTestStruct) == 80); -static_assert(CRUBIT_OFFSET_OF(ptrdiff_t_field, struct FieldTypeTestStruct) == + struct ::FieldTypeTestStruct) == 80); +static_assert(CRUBIT_OFFSET_OF(ptrdiff_t_field, struct ::FieldTypeTestStruct) == 88); -static_assert(CRUBIT_OFFSET_OF(size_t_field, struct FieldTypeTestStruct) == 96); -static_assert(CRUBIT_OFFSET_OF(float_field, struct FieldTypeTestStruct) == 104); -static_assert(CRUBIT_OFFSET_OF(double_field, struct FieldTypeTestStruct) == +static_assert(CRUBIT_OFFSET_OF(size_t_field, struct ::FieldTypeTestStruct) == + 96); +static_assert(CRUBIT_OFFSET_OF(float_field, struct ::FieldTypeTestStruct) == + 104); +static_assert(CRUBIT_OFFSET_OF(double_field, struct ::FieldTypeTestStruct) == 112); -static_assert(CRUBIT_OFFSET_OF(ptr_field, struct FieldTypeTestStruct) == 120); -static_assert(CRUBIT_OFFSET_OF(void_ptr_field, struct FieldTypeTestStruct) == +static_assert(CRUBIT_OFFSET_OF(ptr_field, struct ::FieldTypeTestStruct) == 120); +static_assert(CRUBIT_OFFSET_OF(void_ptr_field, struct ::FieldTypeTestStruct) == 128); static_assert(CRUBIT_OFFSET_OF(const_void_ptr_field, - struct FieldTypeTestStruct) == 136); + struct ::FieldTypeTestStruct) == 136); static_assert(CRUBIT_OFFSET_OF(void_double_ptr_field, - struct FieldTypeTestStruct) == 144); -static_assert(CRUBIT_OFFSET_OF(struct_field, struct FieldTypeTestStruct) == + struct ::FieldTypeTestStruct) == 144); +static_assert(CRUBIT_OFFSET_OF(struct_field, struct ::FieldTypeTestStruct) == 152); -static_assert(CRUBIT_OFFSET_OF(struct_ptr_field, struct FieldTypeTestStruct) == - 160); +static_assert(CRUBIT_OFFSET_OF(struct_ptr_field, + struct ::FieldTypeTestStruct) == 160); static_assert(CRUBIT_OFFSET_OF(const_struct_ptr_field, - struct FieldTypeTestStruct) == 168); -static_assert(CRUBIT_OFFSET_OF(struct_ref_field, struct FieldTypeTestStruct) == - 176); + struct ::FieldTypeTestStruct) == 168); +static_assert(CRUBIT_OFFSET_OF(struct_ref_field, + struct ::FieldTypeTestStruct) == 176); static_assert(CRUBIT_OFFSET_OF(const_struct_ref_field, - struct FieldTypeTestStruct) == 184); + struct ::FieldTypeTestStruct) == 184); static_assert(CRUBIT_OFFSET_OF(forward_declared_ptr_field, - struct FieldTypeTestStruct) == 192); -static_assert(CRUBIT_OFFSET_OF(cyclic_ptr_field, struct FieldTypeTestStruct) == - 200); + struct ::FieldTypeTestStruct) == 192); +static_assert(CRUBIT_OFFSET_OF(cyclic_ptr_field, + struct ::FieldTypeTestStruct) == 200); extern "C" void __rust_thunk___Z21VoidReturningFunctionv() { - VoidReturningFunction(); + ::VoidReturningFunction(); } static_assert((void (*)()) & ::VoidReturningFunction); extern "C" crubit::type_identity_t* __rust_thunk___Z32FunctionPointerReturningFunctionv() { - return FunctionPointerReturningFunction(); + return ::FunctionPointerReturningFunction(); } static_assert((crubit::type_identity_t * (*)()) & @@ -104,7 +107,7 @@ static_assert((crubit::type_identity_t * (*)()) & extern "C" void* __rust_thunk___Z24FunctionWithVoidPointersPvPKv( void* __param_0, void const* __param_1) { - return FunctionWithVoidPointers(__param_0, __param_1); + return ::FunctionWithVoidPointers(__param_0, __param_1); } static_assert((void* (*)(void*, void const*)) & ::FunctionWithVoidPointers); 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 8ffc88bb7..62a12ddae 100644 --- a/rs_bindings_from_cc/test/golden/unions_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unions_rs_api.rs @@ -20,14 +20,14 @@ /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=EmptyUnion +///CRUBIT_ANNOTATE: cpp_type=:: EmptyUnion pub union EmptyUnion { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for EmptyUnion {} impl !Sync for EmptyUnion {} unsafe impl ::cxx::ExternType for EmptyUnion { - type Id = ::cxx::type_id!("EmptyUnion"); + type Id = ::cxx::type_id!(":: EmptyUnion"); type Kind = ::cxx::kind::Trivial; } @@ -64,7 +64,7 @@ impl Default for EmptyUnion { #[::ctor::recursively_pinned] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Nontrivial +///CRUBIT_ANNOTATE: cpp_type=:: Nontrivial pub struct Nontrivial { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], pub field: ::ffi_11::c_int, @@ -72,7 +72,7 @@ pub struct Nontrivial { impl !Send for Nontrivial {} impl !Sync for Nontrivial {} unsafe impl ::cxx::ExternType for Nontrivial { - type Id = ::cxx::type_id!("Nontrivial"); + type Id = ::cxx::type_id!(":: Nontrivial"); type Kind = ::cxx::kind::Opaque; } @@ -100,14 +100,14 @@ impl ::ctor::CtorNew<()> for Nontrivial { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=UnionToRename +///CRUBIT_ANNOTATE: cpp_type=:: UnionToRename pub union RenamedUnion { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for RenamedUnion {} impl !Sync for RenamedUnion {} unsafe impl ::cxx::ExternType for RenamedUnion { - type Id = ::cxx::type_id!("UnionToRename"); + type Id = ::cxx::type_id!(":: UnionToRename"); type Kind = ::cxx::kind::Trivial; } @@ -144,14 +144,14 @@ impl Default for RenamedUnion { #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TriviallyCopyableButNontriviallyDestructible +///CRUBIT_ANNOTATE: cpp_type=:: TriviallyCopyableButNontriviallyDestructible pub struct TriviallyCopyableButNontriviallyDestructible { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for TriviallyCopyableButNontriviallyDestructible {} impl !Sync for TriviallyCopyableButNontriviallyDestructible {} unsafe impl ::cxx::ExternType for TriviallyCopyableButNontriviallyDestructible { - type Id = ::cxx::type_id!("TriviallyCopyableButNontriviallyDestructible"); + type Id = ::cxx::type_id!(":: TriviallyCopyableButNontriviallyDestructible"); type Kind = ::cxx::kind::Opaque; } @@ -180,7 +180,7 @@ impl ::ctor::PinnedDrop for TriviallyCopyableButNontriviallyDestructible { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NonEmptyUnion +///CRUBIT_ANNOTATE: cpp_type=:: NonEmptyUnion pub union NonEmptyUnion { pub bool_field: bool, pub char_field: ::ffi_11::c_char, @@ -190,7 +190,7 @@ pub union NonEmptyUnion { impl !Send for NonEmptyUnion {} impl !Sync for NonEmptyUnion {} unsafe impl ::cxx::ExternType for NonEmptyUnion { - type Id = ::cxx::type_id!("NonEmptyUnion"); + type Id = ::cxx::type_id!(":: NonEmptyUnion"); type Kind = ::cxx::kind::Trivial; } @@ -231,7 +231,7 @@ impl Default for NonEmptyUnion { /// * The callee does not read an incorrect field out of the union. #[::ctor::recursively_pinned] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NonCopyUnion +///CRUBIT_ANNOTATE: cpp_type=:: NonCopyUnion pub union NonCopyUnion { pub trivial_member: bool, pub nontrivial_member: ::core::mem::ManuallyDrop, @@ -239,7 +239,7 @@ pub union NonCopyUnion { impl !Send for NonCopyUnion {} impl !Sync for NonCopyUnion {} unsafe impl ::cxx::ExternType for NonCopyUnion { - type Id = ::cxx::type_id!("NonCopyUnion"); + type Id = ::cxx::type_id!(":: NonCopyUnion"); type Kind = ::cxx::kind::Opaque; } @@ -248,7 +248,7 @@ unsafe impl ::cxx::ExternType for NonCopyUnion { /// To call a function that accepts this type, you must uphold these requirements: /// * The callee does not read an incorrect field out of the union. #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NonCopyUnion2 +///CRUBIT_ANNOTATE: cpp_type=:: NonCopyUnion2 pub union NonCopyUnion2 { pub trivial_member: bool, pub nontrivial_member: @@ -257,7 +257,7 @@ pub union NonCopyUnion2 { impl !Send for NonCopyUnion2 {} impl !Sync for NonCopyUnion2 {} unsafe impl ::cxx::ExternType for NonCopyUnion2 { - type Id = ::cxx::type_id!("NonCopyUnion2"); + type Id = ::cxx::type_id!(":: NonCopyUnion2"); type Kind = ::cxx::kind::Trivial; } @@ -289,7 +289,7 @@ unsafe impl ::cxx::ExternType for NonCopyUnion2 { /// * `constant_array_field_not_yet_supported`: Rust type is unknown; safety requirements cannot be automatically generated: Unsupported type 'char[42]': Unsupported clang::Type class 'ConstantArray' #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=UnionWithOpaqueField +///CRUBIT_ANNOTATE: cpp_type=:: UnionWithOpaqueField pub union UnionWithOpaqueField { /// Reason for representing this field as a blob of bytes: /// Unsupported type 'char[42]': Unsupported clang::Type class 'ConstantArray' @@ -298,7 +298,7 @@ pub union UnionWithOpaqueField { impl !Send for UnionWithOpaqueField {} impl !Sync for UnionWithOpaqueField {} unsafe impl ::cxx::ExternType for UnionWithOpaqueField { - type Id = ::cxx::type_id!("UnionWithOpaqueField"); + type Id = ::cxx::type_id!(":: UnionWithOpaqueField"); type Kind = ::cxx::kind::Trivial; } @@ -335,14 +335,14 @@ impl Default for UnionWithOpaqueField { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TrivialButInheritable +///CRUBIT_ANNOTATE: cpp_type=:: TrivialButInheritable pub struct TrivialButInheritable { pub x: ::ffi_11::c_int, } impl !Send for TrivialButInheritable {} impl !Sync for TrivialButInheritable {} unsafe impl ::cxx::ExternType for TrivialButInheritable { - type Id = ::cxx::type_id!("TrivialButInheritable"); + type Id = ::cxx::type_id!(":: TrivialButInheritable"); type Kind = ::cxx::kind::Trivial; } @@ -383,14 +383,14 @@ impl Default for TrivialButInheritable { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=UnionWithInheritable +///CRUBIT_ANNOTATE: cpp_type=:: UnionWithInheritable pub union UnionWithInheritable { pub t: crate::TrivialButInheritable, } impl !Send for UnionWithInheritable {} impl !Sync for UnionWithInheritable {} unsafe impl ::cxx::ExternType for UnionWithInheritable { - type Id = ::cxx::type_id!("UnionWithInheritable"); + type Id = ::cxx::type_id!(":: UnionWithInheritable"); type Kind = ::cxx::kind::Trivial; } @@ -431,14 +431,14 @@ impl Default for UnionWithInheritable { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TypedefUnion +///CRUBIT_ANNOTATE: cpp_type=:: TypedefUnion pub union TypedefUnion { pub trivial_member: bool, } impl !Send for TypedefUnion {} impl !Sync for TypedefUnion {} unsafe impl ::cxx::ExternType for TypedefUnion { - type Id = ::cxx::type_id!("TypedefUnion"); + type Id = ::cxx::type_id!(":: TypedefUnion"); type Kind = ::cxx::kind::Trivial; } @@ -479,14 +479,14 @@ impl Default for TypedefUnion { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TypedefUnionWithInheritable +///CRUBIT_ANNOTATE: cpp_type=:: TypedefUnionWithInheritable pub union TypedefUnionWithInheritable { pub t: crate::TrivialButInheritable, } impl !Send for TypedefUnionWithInheritable {} impl !Sync for TypedefUnionWithInheritable {} unsafe impl ::cxx::ExternType for TypedefUnionWithInheritable { - type Id = ::cxx::type_id!("TypedefUnionWithInheritable"); + type Id = ::cxx::type_id!(":: TypedefUnionWithInheritable"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc index 211399d93..02be459f5 100644 --- a/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/unions_rs_api_impl.cc @@ -18,99 +18,100 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(union EmptyUnion) == 1); -static_assert(alignof(union EmptyUnion) == 1); +static_assert(sizeof(union ::EmptyUnion) == 1); +static_assert(alignof(union ::EmptyUnion) == 1); -extern "C" void __rust_thunk___ZN10EmptyUnionC1Ev(union EmptyUnion* __this) { +extern "C" void __rust_thunk___ZN10EmptyUnionC1Ev(union ::EmptyUnion* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct Nontrivial) == 4); -static_assert(alignof(struct Nontrivial) == 4); -static_assert(CRUBIT_OFFSET_OF(field, struct Nontrivial) == 0); +static_assert(CRUBIT_SIZEOF(struct ::Nontrivial) == 4); +static_assert(alignof(struct ::Nontrivial) == 4); +static_assert(CRUBIT_OFFSET_OF(field, struct ::Nontrivial) == 0); -static_assert(sizeof(union UnionToRename) == 1); -static_assert(alignof(union UnionToRename) == 1); +static_assert(sizeof(union ::UnionToRename) == 1); +static_assert(alignof(union ::UnionToRename) == 1); extern "C" void __rust_thunk___ZN13UnionToRenameC1Ev( - union UnionToRename* __this) { + union ::UnionToRename* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct TriviallyCopyableButNontriviallyDestructible) == 1); -static_assert(alignof(struct TriviallyCopyableButNontriviallyDestructible) == +static_assert(sizeof(struct ::TriviallyCopyableButNontriviallyDestructible) == + 1); +static_assert(alignof(struct ::TriviallyCopyableButNontriviallyDestructible) == 1); extern "C" void __rust_thunk___ZN44TriviallyCopyableButNontriviallyDestructibleD1Ev( - struct TriviallyCopyableButNontriviallyDestructible* __this) { + struct ::TriviallyCopyableButNontriviallyDestructible* __this) { std::destroy_at(__this); } -static_assert(CRUBIT_SIZEOF(union NonEmptyUnion) == 8); -static_assert(alignof(union NonEmptyUnion) == 8); -static_assert(CRUBIT_OFFSET_OF(bool_field, union NonEmptyUnion) == 0); -static_assert(CRUBIT_OFFSET_OF(char_field, union NonEmptyUnion) == 0); -static_assert(CRUBIT_OFFSET_OF(int_field, union NonEmptyUnion) == 0); -static_assert(CRUBIT_OFFSET_OF(long_long_field, union NonEmptyUnion) == 0); +static_assert(CRUBIT_SIZEOF(union ::NonEmptyUnion) == 8); +static_assert(alignof(union ::NonEmptyUnion) == 8); +static_assert(CRUBIT_OFFSET_OF(bool_field, union ::NonEmptyUnion) == 0); +static_assert(CRUBIT_OFFSET_OF(char_field, union ::NonEmptyUnion) == 0); +static_assert(CRUBIT_OFFSET_OF(int_field, union ::NonEmptyUnion) == 0); +static_assert(CRUBIT_OFFSET_OF(long_long_field, union ::NonEmptyUnion) == 0); extern "C" void __rust_thunk___ZN13NonEmptyUnionC1Ev( - union NonEmptyUnion* __this) { + union ::NonEmptyUnion* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(union NonCopyUnion) == 4); -static_assert(alignof(union NonCopyUnion) == 4); -static_assert(CRUBIT_OFFSET_OF(trivial_member, union NonCopyUnion) == 0); -static_assert(CRUBIT_OFFSET_OF(nontrivial_member, union NonCopyUnion) == 0); +static_assert(CRUBIT_SIZEOF(union ::NonCopyUnion) == 4); +static_assert(alignof(union ::NonCopyUnion) == 4); +static_assert(CRUBIT_OFFSET_OF(trivial_member, union ::NonCopyUnion) == 0); +static_assert(CRUBIT_OFFSET_OF(nontrivial_member, union ::NonCopyUnion) == 0); -static_assert(sizeof(union NonCopyUnion2) == 1); -static_assert(alignof(union NonCopyUnion2) == 1); -static_assert(CRUBIT_OFFSET_OF(trivial_member, union NonCopyUnion2) == 0); -static_assert(CRUBIT_OFFSET_OF(nontrivial_member, union NonCopyUnion2) == 0); +static_assert(sizeof(union ::NonCopyUnion2) == 1); +static_assert(alignof(union ::NonCopyUnion2) == 1); +static_assert(CRUBIT_OFFSET_OF(trivial_member, union ::NonCopyUnion2) == 0); +static_assert(CRUBIT_OFFSET_OF(nontrivial_member, union ::NonCopyUnion2) == 0); -static_assert(sizeof(union UnionWithOpaqueField) == 42); -static_assert(alignof(union UnionWithOpaqueField) == 1); +static_assert(sizeof(union ::UnionWithOpaqueField) == 42); +static_assert(alignof(union ::UnionWithOpaqueField) == 1); static_assert(CRUBIT_OFFSET_OF(constant_array_field_not_yet_supported, - union UnionWithOpaqueField) == 0); + union ::UnionWithOpaqueField) == 0); extern "C" void __rust_thunk___ZN20UnionWithOpaqueFieldC1Ev( - union UnionWithOpaqueField* __this) { + union ::UnionWithOpaqueField* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct TrivialButInheritable) == 4); -static_assert(alignof(struct TrivialButInheritable) == 4); -static_assert(CRUBIT_OFFSET_OF(x, struct TrivialButInheritable) == 0); +static_assert(CRUBIT_SIZEOF(struct ::TrivialButInheritable) == 4); +static_assert(alignof(struct ::TrivialButInheritable) == 4); +static_assert(CRUBIT_OFFSET_OF(x, struct ::TrivialButInheritable) == 0); extern "C" void __rust_thunk___ZN21TrivialButInheritableC1Ev( - struct TrivialButInheritable* __this) { + struct ::TrivialButInheritable* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(union UnionWithInheritable) == 4); -static_assert(alignof(union UnionWithInheritable) == 4); -static_assert(CRUBIT_OFFSET_OF(t, union UnionWithInheritable) == 0); +static_assert(CRUBIT_SIZEOF(union ::UnionWithInheritable) == 4); +static_assert(alignof(union ::UnionWithInheritable) == 4); +static_assert(CRUBIT_OFFSET_OF(t, union ::UnionWithInheritable) == 0); extern "C" void __rust_thunk___ZN20UnionWithInheritableC1Ev( - union UnionWithInheritable* __this) { + union ::UnionWithInheritable* __this) { crubit::construct_at(__this); } -static_assert(sizeof(TypedefUnion) == 1); -static_assert(alignof(TypedefUnion) == 1); -static_assert(CRUBIT_OFFSET_OF(trivial_member, TypedefUnion) == 0); +static_assert(sizeof(::TypedefUnion) == 1); +static_assert(alignof(::TypedefUnion) == 1); +static_assert(CRUBIT_OFFSET_OF(trivial_member, ::TypedefUnion) == 0); -extern "C" void __rust_thunk___ZN12TypedefUnionC1Ev(TypedefUnion* __this) { +extern "C" void __rust_thunk___ZN12TypedefUnionC1Ev(::TypedefUnion* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(TypedefUnionWithInheritable) == 4); -static_assert(alignof(TypedefUnionWithInheritable) == 4); -static_assert(CRUBIT_OFFSET_OF(t, TypedefUnionWithInheritable) == 0); +static_assert(CRUBIT_SIZEOF(::TypedefUnionWithInheritable) == 4); +static_assert(alignof(::TypedefUnionWithInheritable) == 4); +static_assert(CRUBIT_OFFSET_OF(t, ::TypedefUnionWithInheritable) == 0); extern "C" void __rust_thunk___ZN27TypedefUnionWithInheritableC1Ev( - TypedefUnionWithInheritable* __this) { + ::TypedefUnionWithInheritable* __this) { crubit::construct_at(__this); } diff --git a/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api_impl.cc index fdcf8c1d7..f816b2c9e 100644 --- a/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/unsafe_attrs_rs_api_impl.cc @@ -16,11 +16,11 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -extern "C" bool __rust_thunk___ZL11ReturnsTruev() { return ReturnsTrue(); } +extern "C" bool __rust_thunk___ZL11ReturnsTruev() { return ::ReturnsTrue(); } static_assert((bool (*)()) & ::ReturnsTrue); -extern "C" bool __rust_thunk___ZL12ReturnsFalsev() { return ReturnsFalse(); } +extern "C" bool __rust_thunk___ZL12ReturnsFalsev() { return ::ReturnsFalse(); } static_assert((bool (*)()) & ::ReturnsFalse); 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 533842291..90bc4f39f 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 @@ -21,14 +21,14 @@ /// * `p`: raw pointer #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=PublicPointer +///CRUBIT_ANNOTATE: cpp_type=:: PublicPointer pub struct PublicPointer { pub p: *mut ::ffi_11::c_int, } impl !Send for PublicPointer {} impl !Sync for PublicPointer {} unsafe impl ::cxx::ExternType for PublicPointer { - type Id = ::cxx::type_id!("PublicPointer"); + type Id = ::cxx::type_id!(":: PublicPointer"); type Kind = ::cxx::kind::Trivial; } @@ -45,7 +45,7 @@ impl Default for PublicPointer { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=PrivatePointer +///CRUBIT_ANNOTATE: cpp_type=:: PrivatePointer pub struct PrivatePointer { __non_field_data: [::core::mem::MaybeUninit; 0], /// Reason for representing this field as a blob of bytes: @@ -55,7 +55,7 @@ pub struct PrivatePointer { impl !Send for PrivatePointer {} impl !Sync for PrivatePointer {} unsafe impl ::cxx::ExternType for PrivatePointer { - type Id = ::cxx::type_id!("PrivatePointer"); + type Id = ::cxx::type_id!(":: PrivatePointer"); type Kind = ::cxx::kind::Trivial; } @@ -82,7 +82,7 @@ pub fn DerefPrivatePointer(mut p: crate::PrivatePointer) -> ::ffi_11::c_int { /// * `pub`: unsafe struct or union #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TransitivePublicPointer +///CRUBIT_ANNOTATE: cpp_type=:: TransitivePublicPointer pub struct TransitivePublicPointer { pub r#pub: crate::PublicPointer, pub r#priv: crate::PrivatePointer, @@ -90,7 +90,7 @@ pub struct TransitivePublicPointer { impl !Send for TransitivePublicPointer {} impl !Sync for TransitivePublicPointer {} unsafe impl ::cxx::ExternType for TransitivePublicPointer { - type Id = ::cxx::type_id!("TransitivePublicPointer"); + type Id = ::cxx::type_id!(":: TransitivePublicPointer"); type Kind = ::cxx::kind::Trivial; } @@ -111,7 +111,7 @@ impl Default for TransitivePublicPointer { /// * The callee does not read an incorrect field out of the union. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Union +///CRUBIT_ANNOTATE: cpp_type=:: Union pub union Union { pub i: ::ffi_11::c_int, pub f: f32, @@ -119,7 +119,7 @@ pub union Union { impl !Send for Union {} impl !Sync for Union {} unsafe impl ::cxx::ExternType for Union { - type Id = ::cxx::type_id!("Union"); + type Id = ::cxx::type_id!(":: Union"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api_impl.cc index b56faac0f..d02d06b9e 100644 --- a/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/unsafe_types_transitive_rs_api_impl.cc @@ -18,69 +18,69 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct PublicPointer) == 8); -static_assert(alignof(struct PublicPointer) == 8); -static_assert(CRUBIT_OFFSET_OF(p, struct PublicPointer) == 0); +static_assert(CRUBIT_SIZEOF(struct ::PublicPointer) == 8); +static_assert(alignof(struct ::PublicPointer) == 8); +static_assert(CRUBIT_OFFSET_OF(p, struct ::PublicPointer) == 0); extern "C" void __rust_thunk___ZN13PublicPointerC1Ev( - struct PublicPointer* __this) { + struct ::PublicPointer* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class PrivatePointer) == 8); -static_assert(alignof(class PrivatePointer) == 8); +static_assert(CRUBIT_SIZEOF(class ::PrivatePointer) == 8); +static_assert(alignof(class ::PrivatePointer) == 8); extern "C" void __rust_thunk___ZN14PrivatePointerC1Ev( - class PrivatePointer* __this) { + class ::PrivatePointer* __this) { crubit::construct_at(__this); } extern "C" int __rust_thunk___Z19DerefPrivatePointer14PrivatePointer( - class PrivatePointer* p) { - return DerefPrivatePointer(std::move(*p)); + class ::PrivatePointer* p) { + return ::DerefPrivatePointer(std::move(*p)); } -static_assert(CRUBIT_SIZEOF(struct TransitivePublicPointer) == 16); -static_assert(alignof(struct TransitivePublicPointer) == 8); -static_assert(CRUBIT_OFFSET_OF(pub, struct TransitivePublicPointer) == 0); -static_assert(CRUBIT_OFFSET_OF(priv, struct TransitivePublicPointer) == 8); +static_assert(CRUBIT_SIZEOF(struct ::TransitivePublicPointer) == 16); +static_assert(alignof(struct ::TransitivePublicPointer) == 8); +static_assert(CRUBIT_OFFSET_OF(pub, struct ::TransitivePublicPointer) == 0); +static_assert(CRUBIT_OFFSET_OF(priv, struct ::TransitivePublicPointer) == 8); extern "C" void __rust_thunk___ZN23TransitivePublicPointerC1Ev( - struct TransitivePublicPointer* __this) { + struct ::TransitivePublicPointer* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(union Union) == 4); -static_assert(alignof(union Union) == 4); -static_assert(CRUBIT_OFFSET_OF(i, union Union) == 0); -static_assert(CRUBIT_OFFSET_OF(f, union Union) == 0); +static_assert(CRUBIT_SIZEOF(union ::Union) == 4); +static_assert(alignof(union ::Union) == 4); +static_assert(CRUBIT_OFFSET_OF(i, union ::Union) == 0); +static_assert(CRUBIT_OFFSET_OF(f, union ::Union) == 0); -extern "C" void __rust_thunk___ZN5UnionC1Ev(union Union* __this) { +extern "C" void __rust_thunk___ZN5UnionC1Ev(union ::Union* __this) { crubit::construct_at(__this); } static_assert((int (*)(int*)) & ::DerefPointer); extern "C" int __rust_thunk___Z18DerefPublicPointer13PublicPointer( - struct PublicPointer* p) { - return DerefPublicPointer(std::move(*p)); + struct ::PublicPointer* p) { + return ::DerefPublicPointer(std::move(*p)); } -static_assert((int (*)(struct PublicPointer)) & ::DerefPublicPointer); +static_assert((int (*)(struct ::PublicPointer)) & ::DerefPublicPointer); extern "C" int __rust_thunk___Z28DerefTransitivePublicPointer23TransitivePublicPointer( - struct TransitivePublicPointer* p) { - return DerefTransitivePublicPointer(std::move(*p)); + struct ::TransitivePublicPointer* p) { + return ::DerefTransitivePublicPointer(std::move(*p)); } -static_assert((int (*)(struct TransitivePublicPointer)) & +static_assert((int (*)(struct ::TransitivePublicPointer)) & ::DerefTransitivePublicPointer); -extern "C" int __rust_thunk___Z9ReadUnion5Union(union Union* u) { - return ReadUnion(std::move(*u)); +extern "C" int __rust_thunk___Z9ReadUnion5Union(union ::Union* u) { + return ::ReadUnion(std::move(*u)); } -static_assert((int (*)(union Union)) & ::ReadUnion); +static_assert((int (*)(union ::Union)) & ::ReadUnion); #pragma clang diagnostic pop 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 bcc2dae0b..301151004 100644 --- a/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs @@ -16,14 +16,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TrivialCustomType +///CRUBIT_ANNOTATE: cpp_type=:: TrivialCustomType pub struct TrivialCustomType { pub i: ::ffi_11::c_int, } impl !Send for TrivialCustomType {} impl !Sync for TrivialCustomType {} unsafe impl ::cxx::ExternType for TrivialCustomType { - type Id = ::cxx::type_id!("TrivialCustomType"); + type Id = ::cxx::type_id!(":: TrivialCustomType"); type Kind = ::cxx::kind::Trivial; } @@ -66,7 +66,7 @@ impl Default for TrivialCustomType { #[::ctor::recursively_pinned] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=NontrivialCustomType +///CRUBIT_ANNOTATE: cpp_type=:: NontrivialCustomType pub struct NontrivialCustomType { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], pub i: ::ffi_11::c_int, @@ -74,7 +74,7 @@ pub struct NontrivialCustomType { impl !Send for NontrivialCustomType {} impl !Sync for NontrivialCustomType {} unsafe impl ::cxx::ExternType for NontrivialCustomType { - type Id = ::cxx::type_id!("NontrivialCustomType"); + type Id = ::cxx::type_id!(":: NontrivialCustomType"); type Kind = ::cxx::kind::Opaque; } diff --git a/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc index d3be4a7d5..56285266a 100644 --- a/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/unsupported_rs_api_impl.cc @@ -18,17 +18,17 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct TrivialCustomType) == 4); -static_assert(alignof(struct TrivialCustomType) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct TrivialCustomType) == 0); +static_assert(CRUBIT_SIZEOF(struct ::TrivialCustomType) == 4); +static_assert(alignof(struct ::TrivialCustomType) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::TrivialCustomType) == 0); extern "C" void __rust_thunk___ZN17TrivialCustomTypeC1Ev( - struct TrivialCustomType* __this) { + struct ::TrivialCustomType* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(struct NontrivialCustomType) == 4); -static_assert(alignof(struct NontrivialCustomType) == 4); -static_assert(CRUBIT_OFFSET_OF(i, struct NontrivialCustomType) == 0); +static_assert(CRUBIT_SIZEOF(struct ::NontrivialCustomType) == 4); +static_assert(alignof(struct ::NontrivialCustomType) == 4); +static_assert(CRUBIT_OFFSET_OF(i, struct ::NontrivialCustomType) == 0); #pragma clang diagnostic pop 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 de618eac0..41ddbb0ca 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 @@ -21,7 +21,7 @@ /// TODO(b/216195042): Correctly namespace base classes in generated Rust code. #[::ctor::recursively_pinned] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=Derived2 +///CRUBIT_ANNOTATE: cpp_type=:: Derived2 pub struct Derived2 { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 20], pub derived_1: ::ffi_11::c_char, @@ -29,7 +29,7 @@ pub struct Derived2 { impl !Send for Derived2 {} impl !Sync for Derived2 {} unsafe impl ::cxx::ExternType for Derived2 { - type Id = ::cxx::type_id!("Derived2"); + type Id = ::cxx::type_id!(":: Derived2"); type Kind = ::cxx::kind::Opaque; } @@ -69,14 +69,14 @@ impl ::ctor::CtorNew<()> for Derived2 { #[::ctor::recursively_pinned] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=VirtualDerived2 +///CRUBIT_ANNOTATE: cpp_type=:: VirtualDerived2 pub struct VirtualDerived2 { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 32], } impl !Send for VirtualDerived2 {} impl !Sync for VirtualDerived2 {} unsafe impl ::cxx::ExternType for VirtualDerived2 { - type Id = ::cxx::type_id!("VirtualDerived2"); + type Id = ::cxx::type_id!(":: VirtualDerived2"); type Kind = ::cxx::kind::Opaque; } diff --git a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc index 7b7d307b3..662def058 100644 --- a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api_impl.cc @@ -18,19 +18,19 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct Derived2) == 24); -static_assert(alignof(struct Derived2) == 8); -static_assert(CRUBIT_OFFSET_OF(derived_1, struct Derived2) == 20); +static_assert(CRUBIT_SIZEOF(struct ::Derived2) == 24); +static_assert(alignof(struct ::Derived2) == 8); +static_assert(CRUBIT_OFFSET_OF(derived_1, struct ::Derived2) == 20); -extern "C" void __rust_thunk___ZN8Derived2C1Ev(struct Derived2* __this) { +extern "C" void __rust_thunk___ZN8Derived2C1Ev(struct ::Derived2* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class VirtualDerived2) == 32); -static_assert(alignof(class VirtualDerived2) == 8); +static_assert(CRUBIT_SIZEOF(class ::VirtualDerived2) == 32); +static_assert(alignof(class ::VirtualDerived2) == 8); extern "C" void __rust_thunk___ZN15VirtualDerived2C1Ev( - class VirtualDerived2* __this) { + class ::VirtualDerived2* __this) { crubit::construct_at(__this); } 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 ef7fedd0a..eea73c2fd 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 @@ -33,14 +33,14 @@ pub fn UsesImportedType(mut t: ::trivial_type_cc::ns::Trivial) -> ::trivial_type /// * `trivial`: raw pointer #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=UserOfImportedType +///CRUBIT_ANNOTATE: cpp_type=:: UserOfImportedType pub struct UserOfImportedType { pub trivial: *mut ::trivial_type_cc::ns::Trivial, } impl !Send for UserOfImportedType {} impl !Sync for UserOfImportedType {} unsafe impl ::cxx::ExternType for UserOfImportedType { - type Id = ::cxx::type_id!("UserOfImportedType"); + type Id = ::cxx::type_id!(":: UserOfImportedType"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc index a718d4bbe..fee8057a2 100644 --- a/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/user_of_imported_type_rs_api_impl.cc @@ -19,19 +19,19 @@ #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" void __rust_thunk___Z16UsesImportedTypeN2ns7TrivialE( - struct ns::Trivial* __return, struct ns::Trivial* t) { - new (__return) auto(UsesImportedType(std::move(*t))); + struct ::ns::Trivial* __return, struct ::ns::Trivial* t) { + new (__return) auto(::UsesImportedType(std::move(*t))); } -static_assert((struct ns::Trivial (*)(struct ns::Trivial)) & +static_assert((struct ::ns::Trivial (*)(struct ::ns::Trivial)) & ::UsesImportedType); -static_assert(CRUBIT_SIZEOF(struct UserOfImportedType) == 8); -static_assert(alignof(struct UserOfImportedType) == 8); -static_assert(CRUBIT_OFFSET_OF(trivial, struct UserOfImportedType) == 0); +static_assert(CRUBIT_SIZEOF(struct ::UserOfImportedType) == 8); +static_assert(alignof(struct ::UserOfImportedType) == 8); +static_assert(CRUBIT_OFFSET_OF(trivial, struct ::UserOfImportedType) == 0); extern "C" void __rust_thunk___ZN18UserOfImportedTypeC1Ev( - struct UserOfImportedType* __this) { + struct ::UserOfImportedType* __this) { crubit::construct_at(__this); } diff --git a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api_impl.cc index 8c66ba38d..1d1411fb9 100644 --- a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api_impl.cc @@ -19,11 +19,11 @@ #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" void __rust_thunk___Z23UseNontrivialCustomType20NontrivialCustomType( - struct NontrivialCustomType* non_trivial_custom_type) { - UseNontrivialCustomType(std::move(*non_trivial_custom_type)); + struct ::NontrivialCustomType* non_trivial_custom_type) { + ::UseNontrivialCustomType(std::move(*non_trivial_custom_type)); } -static_assert((void (*)(struct NontrivialCustomType)) & +static_assert((void (*)(struct ::NontrivialCustomType)) & ::UseNontrivialCustomType); #pragma clang diagnostic pop 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 58ce2d8a2..4ed3f98a8 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 @@ -21,14 +21,14 @@ #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=CannotUpcastInCrubit +///CRUBIT_ANNOTATE: cpp_type=:: CannotUpcastInCrubit pub struct CannotUpcastInCrubit { __non_field_data: [::core::mem::MaybeUninit; 4], } impl !Send for CannotUpcastInCrubit {} impl !Sync for CannotUpcastInCrubit {} unsafe impl ::cxx::ExternType for CannotUpcastInCrubit { - type Id = ::cxx::type_id!("CannotUpcastInCrubit"); + type Id = ::cxx::type_id!(":: CannotUpcastInCrubit"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api_impl.cc b/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api_impl.cc index 2f24a9e3e..4a1cad3d7 100644 --- a/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api_impl.cc @@ -18,11 +18,11 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct CannotUpcastInCrubit) == 4); -static_assert(alignof(struct CannotUpcastInCrubit) == 4); +static_assert(CRUBIT_SIZEOF(struct ::CannotUpcastInCrubit) == 4); +static_assert(alignof(struct ::CannotUpcastInCrubit) == 4); extern "C" void __rust_thunk___ZN20CannotUpcastInCrubitC1Ev( - struct CannotUpcastInCrubit* __this) { + struct ::CannotUpcastInCrubit* __this) { crubit::construct_at(__this); } diff --git a/rs_bindings_from_cc/test/namespace/inline/inline_api_impl.cc b/rs_bindings_from_cc/test/namespace/inline/inline_api_impl.cc index e00d539f7..754cfac8e 100644 --- a/rs_bindings_from_cc/test/namespace/inline/inline_api_impl.cc +++ b/rs_bindings_from_cc/test/namespace/inline/inline_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/namespace/inline:inline -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,45 +19,45 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(struct foo::inline1::MyStruct) == 4); -static_assert(alignof(struct foo::inline1::MyStruct) == 4); -static_assert(CRUBIT_OFFSET_OF(value, struct foo::inline1::MyStruct) == 0); +static_assert(CRUBIT_SIZEOF(struct ::foo::inline1::MyStruct) == 4); +static_assert(alignof(struct ::foo::inline1::MyStruct) == 4); +static_assert(CRUBIT_OFFSET_OF(value, struct ::foo::inline1::MyStruct) == 0); extern "C" void __rust_thunk___ZN3foo7inline18MyStructC1Ev( - struct foo::inline1::MyStruct* __this) { + struct ::foo::inline1::MyStruct* __this) { crubit::construct_at(__this); } extern "C" int __rust_thunk___ZN3foo7inline115GetStructValue1EPKNS0_8MyStructE( - struct foo::inline1::MyStruct const* s) { - return foo::inline1::GetStructValue1(s); + struct ::foo::inline1::MyStruct const* s) { + return ::foo::inline1::GetStructValue1(s); } -static_assert((int (*)(struct foo::inline1::MyStruct const*)) & +static_assert((int (*)(struct ::foo::inline1::MyStruct const*)) & ::foo::inline1::GetStructValue1); extern "C" int __rust_thunk___ZN3foo7inline115GetStructValue2EPKNS0_8MyStructE( - struct foo::inline1::MyStruct const* s) { - return foo::inline1::GetStructValue2(s); + struct ::foo::inline1::MyStruct const* s) { + return ::foo::inline1::GetStructValue2(s); } -static_assert((int (*)(struct foo::inline1::MyStruct const*)) & +static_assert((int (*)(struct ::foo::inline1::MyStruct const*)) & ::foo::inline1::GetStructValue2); extern "C" int __rust_thunk___ZN3foo7inline115GetStructValue3EPKNS0_8MyStructE( - struct foo::inline1::MyStruct const* s) { - return foo::inline1::GetStructValue3(s); + struct ::foo::inline1::MyStruct const* s) { + return ::foo::inline1::GetStructValue3(s); } -static_assert((int (*)(struct foo::inline1::MyStruct const*)) & +static_assert((int (*)(struct ::foo::inline1::MyStruct const*)) & ::foo::inline1::GetStructValue3); extern "C" int __rust_thunk___ZN3foo7inline115GetStructValue4EPKNS0_8MyStructE( - struct foo::inline1::MyStruct const* s) { - return foo::inline1::GetStructValue4(s); + struct ::foo::inline1::MyStruct const* s) { + return ::foo::inline1::GetStructValue4(s); } -static_assert((int (*)(struct foo::inline1::MyStruct const*)) & +static_assert((int (*)(struct ::foo::inline1::MyStruct const*)) & ::foo::inline1::GetStructValue4); #pragma clang diagnostic pop 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 7c83895d8..dc405ec9c 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/namespace/inline:inline -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -25,14 +25,14 @@ pub mod foo { /// Generated from: rs_bindings_from_cc/test/namespace/inline/inline.h;l=11 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=foo :: inline1 :: MyStruct + ///CRUBIT_ANNOTATE: cpp_type=:: foo :: inline1 :: MyStruct pub struct MyStruct { pub value: ::ffi_11::c_int, } impl !Send for MyStruct {} impl !Sync for MyStruct {} unsafe impl ::cxx::ExternType for MyStruct { - type Id = ::cxx::type_id!("foo :: inline1 :: MyStruct"); + type Id = ::cxx::type_id!(":: foo :: inline1 :: MyStruct"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/namespace/nested_items/nested_items_api_impl.cc b/rs_bindings_from_cc/test/namespace/nested_items/nested_items_api_impl.cc index fde739443..08e40e665 100644 --- a/rs_bindings_from_cc/test/namespace/nested_items/nested_items_api_impl.cc +++ b/rs_bindings_from_cc/test/namespace/nested_items/nested_items_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/namespace/nested_items:nested_items -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -20,81 +20,81 @@ #pragma clang diagnostic ignored "-Wthread-safety-analysis" extern "C" int __rust_thunk___ZN4same9AFunctionEv() { - return same::AFunction(); + return ::same::AFunction(); } static_assert((int (*)()) & ::same::AFunction); -static_assert(sizeof(class Same) == 1); -static_assert(alignof(class Same) == 1); +static_assert(sizeof(class ::Same) == 1); +static_assert(alignof(class ::Same) == 1); -extern "C" void __rust_thunk___ZN4SameC1Ev(class Same* __this) { +extern "C" void __rust_thunk___ZN4SameC1Ev(class ::Same* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct Same::NestedItem) == 1); -static_assert(alignof(struct Same::NestedItem) == 1); +static_assert(sizeof(struct ::Same::NestedItem) == 1); +static_assert(alignof(struct ::Same::NestedItem) == 1); extern "C" void __rust_thunk___ZN4Same10NestedItemC1Ev( - struct Same::NestedItem* __this) { + struct ::Same::NestedItem* __this) { crubit::construct_at(__this); } extern "C" int __rust_thunk___ZN4Same10NestedItem18NestedItemFunctionEv( - struct Same::NestedItem* __this) { + struct ::Same::NestedItem* __this) { return __this->NestedItemFunction(); } static_assert((int (::Same::NestedItem::*)()) & ::Same::NestedItem::NestedItemFunction); -extern "C" int __rust_thunk___ZN4Same6MethodEv(class Same* __this) { +extern "C" int __rust_thunk___ZN4Same6MethodEv(class ::Same* __this) { return __this->Method(); } static_assert((int (::Same::*)()) & ::Same::Method); -static_assert(sizeof(struct foo::Foo) == 1); -static_assert(alignof(struct foo::Foo) == 1); +static_assert(sizeof(struct ::foo::Foo) == 1); +static_assert(alignof(struct ::foo::Foo) == 1); -extern "C" void __rust_thunk___ZN3foo3FooC1Ev(struct foo::Foo* __this) { +extern "C" void __rust_thunk___ZN3foo3FooC1Ev(struct ::foo::Foo* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct foo::Foo::foo) == 1); -static_assert(alignof(struct foo::Foo::foo) == 1); +static_assert(sizeof(struct ::foo::Foo::foo) == 1); +static_assert(alignof(struct ::foo::Foo::foo) == 1); extern "C" void __rust_thunk___ZN3foo3Foo3fooC1Ev( - struct foo::Foo::foo* __this) { + struct ::foo::Foo::foo* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct foo::Foo::foo::Item) == 1); -static_assert(alignof(struct foo::Foo::foo::Item) == 1); +static_assert(sizeof(struct ::foo::Foo::foo::Item) == 1); +static_assert(alignof(struct ::foo::Foo::foo::Item) == 1); extern "C" void __rust_thunk___ZN3foo3Foo3foo4ItemC1Ev( - struct foo::Foo::foo::Item* __this) { + struct ::foo::Foo::foo::Item* __this) { crubit::construct_at(__this); } extern "C" int __rust_thunk___ZN3foo3Foo3foo9BFunctionEv() { - return foo::Foo::foo::BFunction(); + return ::foo::Foo::foo::BFunction(); } static_assert((int (*)()) & ::foo::Foo::foo::BFunction); -static_assert(sizeof(struct OuterCpp) == 1); -static_assert(alignof(struct OuterCpp) == 1); +static_assert(sizeof(struct ::OuterCpp) == 1); +static_assert(alignof(struct ::OuterCpp) == 1); -extern "C" void __rust_thunk___ZN8OuterCppC1Ev(struct OuterCpp* __this) { +extern "C" void __rust_thunk___ZN8OuterCppC1Ev(struct ::OuterCpp* __this) { crubit::construct_at(__this); } -static_assert(sizeof(struct OuterCpp::Inner) == 1); -static_assert(alignof(struct OuterCpp::Inner) == 1); +static_assert(sizeof(struct ::OuterCpp::Inner) == 1); +static_assert(alignof(struct ::OuterCpp::Inner) == 1); extern "C" void __rust_thunk___ZN8OuterCpp5InnerC1Ev( - struct OuterCpp::Inner* __this) { + struct ::OuterCpp::Inner* __this) { crubit::construct_at(__this); } diff --git a/rs_bindings_from_cc/test/namespace/nested_items/nested_items_rs_api.rs b/rs_bindings_from_cc/test/namespace/nested_items/nested_items_rs_api.rs index 8eaa9a471..5a6bd26af 100644 --- a/rs_bindings_from_cc/test/namespace/nested_items/nested_items_rs_api.rs +++ b/rs_bindings_from_cc/test/namespace/nested_items/nested_items_rs_api.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/namespace/nested_items:nested_items -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -28,14 +28,14 @@ pub mod same { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=14 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Same +///CRUBIT_ANNOTATE: cpp_type=:: Same pub struct Same { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Same {} impl !Sync for Same {} unsafe impl ::cxx::ExternType for Same { - type Id = ::cxx::type_id!("Same"); + type Id = ::cxx::type_id!(":: Same"); type Kind = ::cxx::kind::Trivial; } impl Same { @@ -77,14 +77,14 @@ pub mod same_items { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=16 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=Same :: NestedItem + ///CRUBIT_ANNOTATE: cpp_type=:: Same :: NestedItem pub struct NestedItem { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for NestedItem {} impl !Sync for NestedItem {} unsafe impl ::cxx::ExternType for NestedItem { - type Id = ::cxx::type_id!("Same :: NestedItem"); + type Id = ::cxx::type_id!(":: Same :: NestedItem"); type Kind = ::cxx::kind::Trivial; } impl NestedItem { @@ -132,7 +132,7 @@ pub mod same_items { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=20 #[repr(transparent)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, PartialOrd, Ord)] - ///CRUBIT_ANNOTATE: cpp_type=Same :: NestedEnum + ///CRUBIT_ANNOTATE: cpp_type=:: Same :: NestedEnum pub struct NestedEnum(::ffi_11::c_int); impl NestedEnum { pub const kOne: NestedEnum = NestedEnum(::ffi_11::new_c_int(0)); @@ -154,14 +154,14 @@ pub mod foo { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=29 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=foo :: Foo + ///CRUBIT_ANNOTATE: cpp_type=:: foo :: Foo pub struct Foo { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Foo {} impl !Sync for Foo {} unsafe impl ::cxx::ExternType for Foo { - type Id = ::cxx::type_id!("foo :: Foo"); + type Id = ::cxx::type_id!(":: foo :: Foo"); type Kind = ::cxx::kind::Trivial; } @@ -181,14 +181,14 @@ pub mod foo { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=30 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=foo :: Foo :: foo + ///CRUBIT_ANNOTATE: cpp_type=:: foo :: Foo :: foo pub struct foo { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for foo {} impl !Sync for foo {} unsafe impl ::cxx::ExternType for foo { - type Id = ::cxx::type_id!("foo :: Foo :: foo"); + type Id = ::cxx::type_id!(":: foo :: Foo :: foo"); type Kind = ::cxx::kind::Trivial; } impl foo { @@ -220,14 +220,14 @@ pub mod foo { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=31 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=foo :: Foo :: foo :: Item + ///CRUBIT_ANNOTATE: cpp_type=:: foo :: Foo :: foo :: Item pub struct Item { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Item {} impl !Sync for Item {} unsafe impl ::cxx::ExternType for Item { - type Id = ::cxx::type_id!("foo :: Foo :: foo :: Item"); + type Id = ::cxx::type_id!(":: foo :: Foo :: foo :: Item"); type Kind = ::cxx::kind::Trivial; } @@ -253,14 +253,14 @@ pub mod foo { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=37 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=OuterCpp +///CRUBIT_ANNOTATE: cpp_type=:: OuterCpp pub struct OuterRustName { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for OuterRustName {} impl !Sync for OuterRustName {} unsafe impl ::cxx::ExternType for OuterRustName { - type Id = ::cxx::type_id!("OuterCpp"); + type Id = ::cxx::type_id!(":: OuterCpp"); type Kind = ::cxx::kind::Trivial; } @@ -280,14 +280,14 @@ pub mod outer_rust_name { /// Generated from: rs_bindings_from_cc/test/namespace/nested_items/nested_items.h;l=38 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=OuterCpp :: Inner + ///CRUBIT_ANNOTATE: cpp_type=:: OuterCpp :: Inner pub struct Inner { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for Inner {} impl !Sync for Inner {} unsafe impl ::cxx::ExternType for Inner { - type Id = ::cxx::type_id!("OuterCpp :: Inner"); + type Id = ::cxx::type_id!(":: OuterCpp :: Inner"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/references/references_api_impl.cc b/rs_bindings_from_cc/test/references/references_api_impl.cc index bad5879b3..55a9dcc62 100644 --- a/rs_bindings_from_cc/test/references/references_api_impl.cc +++ b/rs_bindings_from_cc/test/references/references_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/references:references -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,17 +19,17 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class TypeWithPtrConstructor) == 1); -static_assert(alignof(class TypeWithPtrConstructor) == 1); +static_assert(sizeof(class ::TypeWithPtrConstructor) == 1); +static_assert(alignof(class ::TypeWithPtrConstructor) == 1); -static_assert(sizeof(class TypeWithNonNullPtrConstructor) == 1); -static_assert(alignof(class TypeWithNonNullPtrConstructor) == 1); +static_assert(sizeof(class ::TypeWithNonNullPtrConstructor) == 1); +static_assert(alignof(class ::TypeWithNonNullPtrConstructor) == 1); -static_assert(sizeof(class TypeWithReferenceConstructor) == 1); -static_assert(alignof(class TypeWithReferenceConstructor) == 1); +static_assert(sizeof(class ::TypeWithReferenceConstructor) == 1); +static_assert(alignof(class ::TypeWithReferenceConstructor) == 1); extern "C" void __rust_thunk___ZN28TypeWithReferenceConstructorC1ERi( - class TypeWithReferenceConstructor* __this, int* ref) { + class ::TypeWithReferenceConstructor* __this, int* ref) { crubit::construct_at(__this, *ref); } 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 ac869942b..572b23d3a 100644 --- a/rs_bindings_from_cc/test/references/references_rs_api.rs +++ b/rs_bindings_from_cc/test/references/references_rs_api.rs @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/references:references -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -18,14 +18,14 @@ /// Generated from: rs_bindings_from_cc/test/references/references.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TypeWithPtrConstructor +///CRUBIT_ANNOTATE: cpp_type=:: TypeWithPtrConstructor pub struct TypeWithPtrConstructor { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for TypeWithPtrConstructor {} impl !Sync for TypeWithPtrConstructor {} unsafe impl ::cxx::ExternType for TypeWithPtrConstructor { - type Id = ::cxx::type_id!("TypeWithPtrConstructor"); + type Id = ::cxx::type_id!(":: TypeWithPtrConstructor"); type Kind = ::cxx::kind::Trivial; } @@ -51,14 +51,14 @@ where /// Generated from: rs_bindings_from_cc/test/references/references.h;l=13 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TypeWithNonNullPtrConstructor +///CRUBIT_ANNOTATE: cpp_type=:: TypeWithNonNullPtrConstructor pub struct TypeWithNonNullPtrConstructor { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for TypeWithNonNullPtrConstructor {} impl !Sync for TypeWithNonNullPtrConstructor {} unsafe impl ::cxx::ExternType for TypeWithNonNullPtrConstructor { - type Id = ::cxx::type_id!("TypeWithNonNullPtrConstructor"); + type Id = ::cxx::type_id!(":: TypeWithNonNullPtrConstructor"); type Kind = ::cxx::kind::Trivial; } @@ -84,14 +84,14 @@ where /// Generated from: rs_bindings_from_cc/test/references/references.h;l=18 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=TypeWithReferenceConstructor +///CRUBIT_ANNOTATE: cpp_type=:: TypeWithReferenceConstructor pub struct TypeWithReferenceConstructor { __non_field_data: [::core::mem::MaybeUninit; 1], } impl !Send for TypeWithReferenceConstructor {} impl !Sync for TypeWithReferenceConstructor {} unsafe impl ::cxx::ExternType for TypeWithReferenceConstructor { - type Id = ::cxx::type_id!("TypeWithReferenceConstructor"); + type Id = ::cxx::type_id!(":: TypeWithReferenceConstructor"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_api_impl.cc b/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_api_impl.cc index 1b64fde82..58c02e8a4 100644 --- a/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_api_impl.cc +++ b/rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/struct/default_member_functions:default_member_functions -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,23 +19,23 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class Uncopyable) == 1); -static_assert(alignof(class Uncopyable) == 1); +static_assert(sizeof(class ::Uncopyable) == 1); +static_assert(alignof(class ::Uncopyable) == 1); -extern "C" void __rust_thunk___ZN10UncopyableC1Ev(class Uncopyable* __this) { +extern "C" void __rust_thunk___ZN10UncopyableC1Ev(class ::Uncopyable* __this) { crubit::construct_at(__this); } -static_assert(CRUBIT_SIZEOF(class UncopyableDespiteDecl) == 24); -static_assert(alignof(class UncopyableDespiteDecl) == 8); +static_assert(CRUBIT_SIZEOF(class ::UncopyableDespiteDecl) == 24); +static_assert(alignof(class ::UncopyableDespiteDecl) == 8); extern "C" void __rust_thunk___ZN21UncopyableDespiteDeclD1Ev( - class UncopyableDespiteDecl* __this) { + class ::UncopyableDespiteDecl* __this) { std::destroy_at(__this); } extern "C" void __rust_thunk___ZN21UncopyableDespiteDeclC1Ev( - class UncopyableDespiteDecl* __this) { + class ::UncopyableDespiteDecl* __this) { crubit::construct_at(__this); } 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 ac89ff535..5b35140e6 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/struct/default_member_functions:default_member_functions -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, impl_trait_in_assoc_type, negative_impls)] @@ -18,14 +18,14 @@ /// 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 +///CRUBIT_ANNOTATE: cpp_type=:: Uncopyable pub struct Uncopyable { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 1], } impl !Send for Uncopyable {} impl !Sync for Uncopyable {} unsafe impl ::cxx::ExternType for Uncopyable { - type Id = ::cxx::type_id!("Uncopyable"); + type Id = ::cxx::type_id!(":: Uncopyable"); type Kind = ::cxx::kind::Opaque; } @@ -47,7 +47,7 @@ impl ::ctor::CtorNew<()> for Uncopyable { /// Generated from: rs_bindings_from_cc/test/struct/default_member_functions/default_member_functions.h;l=17 #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(8))] -///CRUBIT_ANNOTATE: cpp_type=UncopyableDespiteDecl +///CRUBIT_ANNOTATE: cpp_type=:: UncopyableDespiteDecl pub struct UncopyableDespiteDecl { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: @@ -57,7 +57,7 @@ pub struct UncopyableDespiteDecl { impl !Send for UncopyableDespiteDecl {} impl !Sync for UncopyableDespiteDecl {} unsafe impl ::cxx::ExternType for UncopyableDespiteDecl { - type Id = ::cxx::type_id!("UncopyableDespiteDecl"); + type Id = ::cxx::type_id!(":: UncopyableDespiteDecl"); type Kind = ::cxx::kind::Opaque; } diff --git a/rs_bindings_from_cc/test/struct/destructors/destructors_api_impl.cc b/rs_bindings_from_cc/test/struct/destructors/destructors_api_impl.cc index 408e58e86..d5a6b626b 100644 --- a/rs_bindings_from_cc/test/struct/destructors/destructors_api_impl.cc +++ b/rs_bindings_from_cc/test/struct/destructors/destructors_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/struct/destructors:destructors -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,29 +19,29 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(class DestructionOrderRecorder) == 4); -static_assert(alignof(class DestructionOrderRecorder) == 4); +static_assert(CRUBIT_SIZEOF(class ::DestructionOrderRecorder) == 4); +static_assert(alignof(class ::DestructionOrderRecorder) == 4); extern "C" void __rust_thunk___ZN24DestructionOrderRecorderC1Ei( - class DestructionOrderRecorder* __this, int int_field) { + class ::DestructionOrderRecorder* __this, int int_field) { crubit::construct_at(__this, int_field); } extern "C" void __rust_thunk___ZN24DestructionOrderRecorderC1EOS_( - class DestructionOrderRecorder* __this, - class DestructionOrderRecorder* other) { + class ::DestructionOrderRecorder* __this, + class ::DestructionOrderRecorder* other) { crubit::construct_at(__this, std::move(*other)); } -extern "C" class DestructionOrderRecorder* +extern "C" class ::DestructionOrderRecorder* __rust_thunk___ZN24DestructionOrderRecorderaSEOS_( - class DestructionOrderRecorder* __this, - class DestructionOrderRecorder* other) { + class ::DestructionOrderRecorder* __this, + class ::DestructionOrderRecorder* other) { return std::addressof(__this->operator=(std::move(*other))); } extern "C" void __rust_thunk___ZN24DestructionOrderRecorderD1Ev( - class DestructionOrderRecorder* __this) { + class ::DestructionOrderRecorder* __this) { std::destroy_at(__this); } @@ -52,33 +52,33 @@ static_assert((int (*)()) & ::DestructionOrderRecorder::GetDestructionRecord); static_assert((void (*)()) & ::DestructionOrderRecorder::ClearDestructionRecord); -static_assert(CRUBIT_SIZEOF(class FieldDestructionOrderTester) == 12); -static_assert(alignof(class FieldDestructionOrderTester) == 4); +static_assert(CRUBIT_SIZEOF(class ::FieldDestructionOrderTester) == 12); +static_assert(alignof(class ::FieldDestructionOrderTester) == 4); extern "C" void __rust_thunk___ZN27FieldDestructionOrderTesterC1EOS_( - class FieldDestructionOrderTester* __this, - class FieldDestructionOrderTester* __param_0) { + class ::FieldDestructionOrderTester* __this, + class ::FieldDestructionOrderTester* __param_0) { crubit::construct_at(__this, std::move(*__param_0)); } extern "C" void __rust_thunk___ZN27FieldDestructionOrderTesterD1Ev( - class FieldDestructionOrderTester* __this) { + class ::FieldDestructionOrderTester* __this) { std::destroy_at(__this); } -extern "C" class FieldDestructionOrderTester* +extern "C" class ::FieldDestructionOrderTester* __rust_thunk___ZN27FieldDestructionOrderTesteraSEOS_( - class FieldDestructionOrderTester* __this, - class FieldDestructionOrderTester* __param_0) { + class ::FieldDestructionOrderTester* __this, + class ::FieldDestructionOrderTester* __param_0) { return std::addressof(__this->operator=(std::move(*__param_0))); } extern "C" void __rust_thunk___ZN27FieldDestructionOrderTesterC1E24DestructionOrderRecorderS0_S0_( - class FieldDestructionOrderTester* __this, - class DestructionOrderRecorder* field1, - class DestructionOrderRecorder* field2, - class DestructionOrderRecorder* field3) { + class ::FieldDestructionOrderTester* __this, + class ::DestructionOrderRecorder* field1, + class ::DestructionOrderRecorder* field2, + class ::DestructionOrderRecorder* field3) { crubit::construct_at(__this, std::move(*field1), std::move(*field2), std::move(*field3)); } @@ -86,7 +86,7 @@ __rust_thunk___ZN27FieldDestructionOrderTesterC1E24DestructionOrderRecorderS0_S0 extern "C" void __rust_thunk___ZN27FieldDestructionOrderTester15DestructFromCppEiii( int field1, int field2, int field3) { - FieldDestructionOrderTester::DestructFromCpp(field1, field2, field3); + ::FieldDestructionOrderTester::DestructFromCpp(field1, field2, field3); } static_assert((void (*)(int, int, int)) & 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 42c2b4feb..39cf4757a 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/struct/destructors:destructors -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -17,7 +17,7 @@ /// Generated from: rs_bindings_from_cc/test/struct/destructors/destructors.h;l=10 #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=DestructionOrderRecorder +///CRUBIT_ANNOTATE: cpp_type=:: DestructionOrderRecorder pub struct DestructionOrderRecorder { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: @@ -27,7 +27,7 @@ pub struct DestructionOrderRecorder { impl !Send for DestructionOrderRecorder {} impl !Sync for DestructionOrderRecorder {} unsafe impl ::cxx::ExternType for DestructionOrderRecorder { - type Id = ::cxx::type_id!("DestructionOrderRecorder"); + type Id = ::cxx::type_id!(":: DestructionOrderRecorder"); type Kind = ::cxx::kind::Trivial; } impl DestructionOrderRecorder { @@ -142,7 +142,7 @@ pub mod destruction_order_recorder { /// Generated from: rs_bindings_from_cc/test/struct/destructors/destructors.h;l=42 #[repr(C, align(4))] -///CRUBIT_ANNOTATE: cpp_type=FieldDestructionOrderTester +///CRUBIT_ANNOTATE: cpp_type=:: FieldDestructionOrderTester pub struct FieldDestructionOrderTester { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], /// Reason for representing this field as a blob of bytes: @@ -158,7 +158,7 @@ pub struct FieldDestructionOrderTester { impl !Send for FieldDestructionOrderTester {} impl !Sync for FieldDestructionOrderTester {} unsafe impl ::cxx::ExternType for FieldDestructionOrderTester { - type Id = ::cxx::type_id!("FieldDestructionOrderTester"); + type Id = ::cxx::type_id!(":: FieldDestructionOrderTester"); type Kind = ::cxx::kind::Trivial; } impl FieldDestructionOrderTester { diff --git a/rs_bindings_from_cc/test/struct/methods/methods_api_impl.cc b/rs_bindings_from_cc/test/struct/methods/methods_api_impl.cc index b0b407ae9..b47ac8d32 100644 --- a/rs_bindings_from_cc/test/struct/methods/methods_api_impl.cc +++ b/rs_bindings_from_cc/test/struct/methods/methods_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/struct/methods:methods -// Features: assume_this_lifetimes, fmt, supported, types +// Features: assume_this_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,36 +19,38 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(CRUBIT_SIZEOF(class SomeClass) == 4); -static_assert(alignof(class SomeClass) == 4); -static_assert(CRUBIT_OFFSET_OF(int_var, class SomeClass) == 0); +static_assert(CRUBIT_SIZEOF(class ::SomeClass) == 4); +static_assert(alignof(class ::SomeClass) == 4); +static_assert(CRUBIT_OFFSET_OF(int_var, class ::SomeClass) == 0); -extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class SomeClass* __this) { +extern "C" void __rust_thunk___ZN9SomeClassC1Ev(class ::SomeClass* __this) { crubit::construct_at(__this); } extern "C" void __rust_thunk___ZN9SomeClass21static_factory_methodEi( - class SomeClass* __return, int int_var_initial_value) { - new (__return) auto(SomeClass::static_factory_method(int_var_initial_value)); + class ::SomeClass* __return, int int_var_initial_value) { + new (__return) auto( + ::SomeClass::static_factory_method(int_var_initial_value)); } -static_assert((class SomeClass (*)(int)) & ::SomeClass::static_factory_method); +static_assert((class ::SomeClass (*)(int)) & + ::SomeClass::static_factory_method); static_assert((int (*)(int, int)) & ::SomeClass::static_method_that_multiplies_its_args); extern "C" int __rust_thunk___ZN9SomeClass20static_inline_methodEi(int arg) { - return SomeClass::static_inline_method(arg); + return ::SomeClass::static_inline_method(arg); } static_assert((int (*)(int)) & ::SomeClass::static_inline_method); -static_assert(CRUBIT_SIZEOF(struct InstanceMethods) == 4); -static_assert(alignof(struct InstanceMethods) == 4); -static_assert(CRUBIT_OFFSET_OF(int_field, struct InstanceMethods) == 0); +static_assert(CRUBIT_SIZEOF(struct ::InstanceMethods) == 4); +static_assert(alignof(struct ::InstanceMethods) == 4); +static_assert(CRUBIT_OFFSET_OF(int_field, struct ::InstanceMethods) == 0); extern "C" void __rust_thunk___ZN15InstanceMethodsC1Ev( - struct InstanceMethods* __this) { + struct ::InstanceMethods* __this) { crubit::construct_at(__this); } @@ -59,7 +61,7 @@ static_assert((void (::InstanceMethods::*)(int)) & ::InstanceMethods::set_int_field); extern "C" int __rust_thunk___ZNK15InstanceMethods20inline_get_int_fieldEv( - struct InstanceMethods const* __this) { + struct ::InstanceMethods const* __this) { return __this->inline_get_int_field(); } @@ -67,7 +69,7 @@ static_assert((int (::InstanceMethods::*)() const) & ::InstanceMethods::inline_get_int_field); extern "C" void __rust_thunk___ZN15InstanceMethods20inline_set_int_fieldEi( - struct InstanceMethods* __this, int new_value) { + struct ::InstanceMethods* __this, int new_value) { __this->inline_set_int_field(new_value); } @@ -75,7 +77,7 @@ static_assert((void (::InstanceMethods::*)(int)) & ::InstanceMethods::inline_set_int_field); extern "C" int* __rust_thunk___ZN15InstanceMethods21takes_and_returns_refERi( - struct InstanceMethods* __this, int* input_ref) { + struct ::InstanceMethods* __this, int* input_ref) { return std::addressof(__this->takes_and_returns_ref(*input_ref)); } @@ -83,7 +85,7 @@ static_assert((int& (::InstanceMethods::*)(int&)) & ::InstanceMethods::takes_and_returns_ref); extern "C" void __rust_thunk___ZNR15InstanceMethods13ref_qualifiedEv( - struct InstanceMethods* __this) { + struct ::InstanceMethods* __this) { __this->ref_qualified(); } @@ -91,7 +93,7 @@ static_assert( (void (::InstanceMethods::*)() &)&::InstanceMethods::ref_qualified); extern "C" void __rust_thunk___ZNKR15InstanceMethods19const_ref_qualifiedEv( - struct InstanceMethods const* __this) { + struct ::InstanceMethods const* __this) { __this->const_ref_qualified(); } @@ -99,7 +101,7 @@ static_assert((void (::InstanceMethods::*)() const&)&::InstanceMethods::const_ref_qualified); extern "C" void __rust_thunk___ZNO15InstanceMethods16rvalue_qualifiedEv( - struct InstanceMethods* __this) { + struct ::InstanceMethods* __this) { std::move(*__this).rvalue_qualified(); } 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 de2e06d85..cf7c5b940 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/struct/methods:methods -// Features: assume_this_lifetimes, fmt, supported, types +// Features: assume_this_lifetimes, fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -18,14 +18,14 @@ /// Generated from: rs_bindings_from_cc/test/struct/methods/methods.h;l=8 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=SomeClass +///CRUBIT_ANNOTATE: cpp_type=:: SomeClass pub struct SomeClass { pub int_var: ::ffi_11::c_int, } impl !Send for SomeClass {} impl !Sync for SomeClass {} unsafe impl ::cxx::ExternType for SomeClass { - type Id = ::cxx::type_id!("SomeClass"); + type Id = ::cxx::type_id!(":: SomeClass"); type Kind = ::cxx::kind::Trivial; } impl SomeClass { @@ -104,14 +104,14 @@ pub mod some_class { /// Generated from: rs_bindings_from_cc/test/struct/methods/methods.h;l=25 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=InstanceMethods +///CRUBIT_ANNOTATE: cpp_type=:: InstanceMethods pub struct InstanceMethods { pub int_field: ::ffi_11::c_int, } impl !Send for InstanceMethods {} impl !Sync for InstanceMethods {} unsafe impl ::cxx::ExternType for InstanceMethods { - type Id = ::cxx::type_id!("InstanceMethods"); + type Id = ::cxx::type_id!(":: InstanceMethods"); type Kind = ::cxx::kind::Trivial; } impl InstanceMethods { diff --git a/rs_bindings_from_cc/test/struct/operator_and/operator_and.golden.cc b/rs_bindings_from_cc/test/struct/operator_and/operator_and.golden.cc index ee7aeac12..46dba654d 100644 --- a/rs_bindings_from_cc/test/struct/operator_and/operator_and.golden.cc +++ b/rs_bindings_from_cc/test/struct/operator_and/operator_and.golden.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/struct/operator_and:operator_and -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,24 +19,24 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(class MyBadClass) == 1); -static_assert(alignof(class MyBadClass) == 1); +static_assert(sizeof(class ::MyBadClass) == 1); +static_assert(alignof(class ::MyBadClass) == 1); -extern "C" void __rust_thunk___ZN10MyBadClassC1Ev(class MyBadClass* __this) { +extern "C" void __rust_thunk___ZN10MyBadClassC1Ev(class ::MyBadClass* __this) { crubit::construct_at(__this); } -extern "C" class MyBadClass* __rust_thunk___ZN10MyBadClass7ReturnsEv() { - return std::addressof(MyBadClass::Returns()); +extern "C" class ::MyBadClass* __rust_thunk___ZN10MyBadClass7ReturnsEv() { + return std::addressof(::MyBadClass::Returns()); } -static_assert((class MyBadClass & (*)()) & ::MyBadClass::Returns); +static_assert((class ::MyBadClass & (*)()) & ::MyBadClass::Returns); extern "C" void __rust_thunk___ZN10MyBadClass7AcceptsERS_( - class MyBadClass* __param_0) { - MyBadClass::Accepts(*__param_0); + class ::MyBadClass* __param_0) { + ::MyBadClass::Accepts(*__param_0); } -static_assert((void (*)(class MyBadClass&)) & ::MyBadClass::Accepts); +static_assert((void (*)(class ::MyBadClass&)) & ::MyBadClass::Accepts); #pragma clang diagnostic pop 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 8de8f6b9a..5e8b23282 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/templates/regression_401857961:repro -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -29,7 +29,7 @@ pub mod repro { /// Generated from: rs_bindings_from_cc/test/templates/regression_401857961/repro.h;l=15 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] - ///CRUBIT_ANNOTATE: cpp_type=repro :: Interval + ///CRUBIT_ANNOTATE: cpp_type=:: repro :: Interval pub struct Interval { /// Reason for representing this field as a blob of bytes: /// Unsupported type 'char[1]': Unsupported clang::Type class 'ConstantArray' @@ -38,7 +38,7 @@ pub mod repro { impl !Send for Interval {} impl !Sync for Interval {} unsafe impl ::cxx::ExternType for Interval { - type Id = ::cxx::type_id!("repro :: Interval"); + type Id = ::cxx::type_id!(":: repro :: Interval"); type Kind = ::cxx::kind::Trivial; } diff --git a/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api_impl.cc b/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api_impl.cc index aa3731498..7410214e9 100644 --- a/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api_impl.cc +++ b/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api_impl.cc @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/templates/regression_401857961:repro -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types #include "support/internal/cxx20_backports.h" #include "support/internal/offsetof.h" @@ -19,12 +19,12 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wthread-safety-analysis" -static_assert(sizeof(struct repro::Interval) == 1); -static_assert(alignof(struct repro::Interval) == 1); -static_assert(CRUBIT_OFFSET_OF(nanos, struct repro::Interval) == 0); +static_assert(sizeof(struct ::repro::Interval) == 1); +static_assert(alignof(struct ::repro::Interval) == 1); +static_assert(CRUBIT_OFFSET_OF(nanos, struct ::repro::Interval) == 0); extern "C" void __rust_thunk___ZN5repro8IntervalC1Ev( - struct repro::Interval* __this) { + struct ::repro::Interval* __this) { crubit::construct_at(__this); } 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 8926f352d..b873f119f 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/wrapper/fallback_types:wrapper_library -// Features: fmt, supported, types, wrapper +// Features: fmt, leading_colons_for_cpp_type, supported, types, wrapper #![rustfmt::skip] #![feature(custom_inner_attributes)] 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 9290dae3e..ee95a97ce 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/wrapper/impl_ctor:impl_ctor -// Features: fmt, supported, types, wrapper +// Features: fmt, leading_colons_for_cpp_type, supported, types, wrapper #![rustfmt::skip] #![feature(custom_inner_attributes, impl_trait_in_assoc_type, negative_impls)] @@ -18,7 +18,7 @@ /// 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 +///CRUBIT_ANNOTATE: cpp_type=:: Nontrivial pub struct Nontrivial { __non_field_data: [::core::cell::Cell<::core::mem::MaybeUninit>; 0], pub value: ::ffi_11::c_int, @@ -26,10 +26,10 @@ pub struct Nontrivial { impl !Send for Nontrivial {} impl !Sync for Nontrivial {} unsafe impl ::cxx::ExternType for Nontrivial { - type Id = ::cxx::type_id!("Nontrivial"); + type Id = ::cxx::type_id!(":: Nontrivial"); type Kind = ::cxx::kind::Opaque; } -forward_declare::unsafe_define!(forward_declare::symbol!("Nontrivial"), crate::Nontrivial); +forward_declare::unsafe_define!(forward_declare::symbol!(":: Nontrivial"), crate::Nontrivial); /// Generated from: rs_bindings_from_cc/test/wrapper/impl_ctor/impl_ctor.h;l=10 impl ::ctor::CtorNew<::ffi_11::c_int> for Nontrivial { 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 463ba9898..50e7b0f0b 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 @@ -4,7 +4,7 @@ // Automatically @generated Rust bindings for the following C++ target: // //rs_bindings_from_cc/test/wrapper/pub_crate_types:pub_crate_types -// Features: fmt, supported, types, wrapper +// Features: fmt, leading_colons_for_cpp_type, supported, types, wrapper #![rustfmt::skip] #![feature(custom_inner_attributes, negative_impls)] @@ -25,18 +25,18 @@ pub(crate) type TemplateIntAlias = crate::__CcTemplateInst8TemplateIiE; /// Generated from: rs_bindings_from_cc/test/wrapper/pub_crate_types/pub_crate_types.h;l=23 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=CompoundDataType +///CRUBIT_ANNOTATE: cpp_type=:: CompoundDataType pub struct CompoundDataType { pub(crate) template_int: crate::__CcTemplateInst8TemplateIiE, } impl !Send for CompoundDataType {} impl !Sync for CompoundDataType {} unsafe impl ::cxx::ExternType for CompoundDataType { - type Id = ::cxx::type_id!("CompoundDataType"); + type Id = ::cxx::type_id!(":: CompoundDataType"); type Kind = ::cxx::kind::Trivial; } forward_declare::unsafe_define!( - forward_declare::symbol!("CompoundDataType"), + forward_declare::symbol!(":: CompoundDataType"), crate::CompoundDataType ); @@ -77,7 +77,7 @@ pub fn ConsumeCompoundDataType(mut container: crate::CompoundDataType) -> ::ffi_ } } -forward_declare::forward_declare!(pub ForwardDeclared = forward_declare::symbol!("ForwardDeclared")); +forward_declare::forward_declare!(pub ForwardDeclared = forward_declare::symbol!(":: ForwardDeclared")); /// Forward declared types are not pub(crate) so that they can work across /// module boundaries like this. @@ -119,14 +119,14 @@ pub(crate) fn GetOtherPubCrateTemplate2Int() -> crate::__CcTemplateInst9Template /// Generated from: rs_bindings_from_cc/test/wrapper/pub_crate_types/other_pub_crate_types.h;l=11 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Template2 < int > +///CRUBIT_ANNOTATE: cpp_type=:: Template2 < int > pub(crate) struct __CcTemplateInst9Template2IiE { pub value: ::ffi_11::c_int, } impl !Send for __CcTemplateInst9Template2IiE {} impl !Sync for __CcTemplateInst9Template2IiE {} forward_declare::unsafe_define!( - forward_declare::symbol!("Template2 < int >"), + forward_declare::symbol!(":: Template2 < int >"), crate::__CcTemplateInst9Template2IiE ); @@ -153,14 +153,14 @@ forward_declare::unsafe_define!( /// Generated from: rs_bindings_from_cc/test/wrapper/pub_crate_types/pub_crate_types.h;l=11 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] -///CRUBIT_ANNOTATE: cpp_type=Template < int > +///CRUBIT_ANNOTATE: cpp_type=:: Template < int > pub(crate) struct __CcTemplateInst8TemplateIiE { pub value: ::ffi_11::c_int, } impl !Send for __CcTemplateInst8TemplateIiE {} impl !Sync for __CcTemplateInst8TemplateIiE {} forward_declare::unsafe_define!( - forward_declare::symbol!("Template < int >"), + forward_declare::symbol!(":: Template < int >"), crate::__CcTemplateInst8TemplateIiE ); diff --git a/support/cc_std_impl/string.rs b/support/cc_std_impl/string.rs index 4b661db0d..91db4dffd 100644 --- a/support/cc_std_impl/string.rs +++ b/support/cc_std_impl/string.rs @@ -231,7 +231,7 @@ impl core::fmt::Debug for string_wrapper { // Allow converting a cc_std::std::string_wrapper reference to a "real" C++ string pointer. type StringSymbol = forward_declare::symbol!( - "std :: basic_string < char , std :: char_traits < char >, std :: allocator < char >>" + ":: std :: basic_string < char , std :: char_traits < char >, std :: allocator < char >>" ); impl<'a, Crate> forward_declare::CppCast<*const forward_declare::Incomplete> diff --git a/support/ffi_11/tests/type_identity/rust_api_cc_api.h b/support/ffi_11/tests/type_identity/rust_api_cc_api.h index cdd60db35..4407ad0c3 100644 --- a/support/ffi_11/tests/type_identity/rust_api_cc_api.h +++ b/support/ffi_11/tests/type_identity/rust_api_cc_api.h @@ -4,7 +4,7 @@ // Automatically @generated C++ bindings for the following Rust crate: // rust_api_golden -// Features: fmt, supported, types +// Features: fmt, leading_colons_for_cpp_type, supported, types // clang-format off #ifndef THIRD_PARTY_CRUBIT_SUPPORT_FFI_11_TESTS_TYPE_IDENTITY_RUST_API_GOLDEN