diff --git a/src/google/protobuf/compiler/rust/oneof.cc b/src/google/protobuf/compiler/rust/oneof.cc index 393cdd622b..83881b3513 100644 --- a/src/google/protobuf/compiler/rust/oneof.cc +++ b/src/google/protobuf/compiler/rust/oneof.cc @@ -187,6 +187,7 @@ void GenerateOneofDefinition(Context& ctx, const OneofDescriptor& oneof) { impl $case_enum_name$ { //~ This try_from is not a TryFrom impl so that it isn't //~ committed to as part of our public api. + #[allow(dead_code)] pub(crate) fn try_from(v: u32) -> Option<$case_enum_name$> { match v { 0 => Some($case_enum_name$::not_set),