Skip to content

Commit

Permalink
Stop emitting the non-suffixed name for the oneof generated types.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 715458657
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jan 14, 2025
1 parent 2b35dae commit d43eec8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/google/protobuf/compiler/rust/naming.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
4 changes: 0 additions & 4 deletions src/google/protobuf/compiler/rust/naming.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions src/google/protobuf/compiler/rust/oneof.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
[&] {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d43eec8

Please sign in to comment.