Stop emitting the non-suffixed name for the oneof generated types.

PiperOrigin-RevId: 715458657
pull/19999/head
Protobuf Team Bot 1 month ago committed by Copybara-Service
parent 2b35daebad
commit d43eec81d0
  1. 4
      src/google/protobuf/compiler/rust/naming.cc
  2. 4
      src/google/protobuf/compiler/rust/naming.h
  3. 4
      src/google/protobuf/compiler/rust/oneof.cc

@ -333,10 +333,6 @@ std::string EnumValueRsName(const MultiCasePrefixStripper& stripper,
return RsSafeName(name);
}
std::string DeprecatedOneofViewEnumRsName(const OneofDescriptor& oneof) {
return RsSafeName(SnakeToUpperCamelCase(oneof.name()));
}
std::string OneofViewEnumRsName(const OneofDescriptor& oneof) {
return SnakeToUpperCamelCase(oneof.name()) + "Oneof";
}

@ -63,10 +63,6 @@ std::string RsViewType(Context& ctx, const FieldDescriptor& field,
std::string EnumRsName(const EnumDescriptor& desc);
std::string EnumValueRsName(const EnumValueDescriptor& value);
// The old names for these types, which we intend to imminently burn down
// to avoid collisions.
std::string DeprecatedOneofViewEnumRsName(const OneofDescriptor& oneof);
std::string OneofViewEnumRsName(const OneofDescriptor& oneof);
std::string OneofCaseEnumRsName(const OneofDescriptor& oneof);

@ -124,7 +124,6 @@ std::string RsTypeNameView(Context& ctx, const FieldDescriptor& field) {
void GenerateOneofDefinition(Context& ctx, const OneofDescriptor& oneof) {
ctx.Emit(
{
{"deprecated_view_enum_name", DeprecatedOneofViewEnumRsName(oneof)},
{"view_enum_name", OneofViewEnumRsName(oneof)},
{"view_fields",
[&] {
@ -157,9 +156,6 @@ void GenerateOneofDefinition(Context& ctx, const OneofDescriptor& oneof) {
not_set(std::marker::PhantomData<&'msg ()>) = 0
}
#[deprecated(note="Use $view_enum_name$ instead (will be imminently moved)")]
pub use $view_enum_name$ as $deprecated_view_enum_name$;
)rs");
// Note: This enum is used as the Thunk return type for getting which case is

Loading…
Cancel
Save