Enable `arbitrary_self_types` feature flag for generated Rust API
Since we plan to allow `some_method(self: RvalueReference<...>...)`, which means the type of `self` isn't one of the more standard `self` types such as `&Self`, `&mut Self`, etc.). `arbitrary_self_types` allows `self` to be of a type that `Deref`'s to more standard types.
PiperOrigin-RevId: 518952698
diff --git a/rs_bindings_from_cc/src_code_gen.rs b/rs_bindings_from_cc/src_code_gen.rs
index 924d818..dc63438 100644
--- a/rs_bindings_from_cc/src_code_gen.rs
+++ b/rs_bindings_from_cc/src_code_gen.rs
@@ -225,6 +225,7 @@
let rs_api = format!(
"{top_level_comment}\n\
#![rustfmt::skip]\n\
+ #![feature(arbitrary_self_types)]\n\
{rs_api}"
);
let rs_api_impl = format!(
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 3ca6560..cd47535 100644
--- a/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/bitfields_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 2fc001f..5d1ac11 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 b302caa..7296bc2 100644
--- a/rs_bindings_from_cc/test/golden/comment_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/comment_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 4d51a64..057e293 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 c751227..8dc1dbe 100644
--- a/rs_bindings_from_cc/test/golden/enums_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/enums_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 90bcc1d..391dd48 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 9e7abb5..f06e1b5 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
diff --git a/rs_bindings_from_cc/test/golden/includes_rs_api.rs b/rs_bindings_from_cc/test/golden/includes_rs_api.rs
index bd52acb..59fc78b 100644
--- a/rs_bindings_from_cc/test/golden/includes_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/includes_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 4c25053..869f63f 100644
--- a/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 68d03e9..d4b976a 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
diff --git a/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs b/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs
index 9fec5f2..c62c4d6 100644
--- a/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 d6d730a..582b22f 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls)]
#![allow(stable_features)]
#![no_std]
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 79551ce..d945ccb 100644
--- a/rs_bindings_from_cc/test/golden/namespace_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/namespace_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 9529df4..e2011ba 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls)]
#![allow(stable_features)]
#![no_std]
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 6fc92fa..d33848f 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 98af20c..344a450 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 d9f1424..df7b26d 100644
--- a/rs_bindings_from_cc/test/golden/operators_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/operators_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 f923aa5..c70eb6c 100644
--- a/rs_bindings_from_cc/test/golden/overloads_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/overloads_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 b64a946..589d542 100644
--- a/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 f65644c..5971cbe 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 a188e76..0d8fce7 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls)]
#![allow(stable_features)]
#![no_std]
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 dfb92ab..b4ae77b 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 acded0a..9ab7466 100644
--- a/rs_bindings_from_cc/test/golden/templates_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/templates_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 4fe73b0..fcc139b 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 f91cca8..e8cb9ac 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 23ec005..9773072 100644
--- a/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/typedefs_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 0ce41e1..c3486fb 100644
--- a/rs_bindings_from_cc/test/golden/types_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/types_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
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 6419d39..49f5f67 100644
--- a/rs_bindings_from_cc/test/golden/unions_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/unions_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 72768fa..7bf7f66 100644
--- a/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 43eaa6f..a8870cb 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes, negative_impls, type_alias_impl_trait)]
#![allow(stable_features)]
#![no_std]
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 097e9d5..feb484f 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
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]
diff --git a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs
index 26a791b..972e103 100644
--- a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs
@@ -7,6 +7,7 @@
// Features: experimental, supported
#![rustfmt::skip]
+#![feature(arbitrary_self_types)]
#![feature(custom_inner_attributes)]
#![allow(stable_features)]
#![no_std]