From 897be0c738e8c6d0e6f59783239f40c41bc21b01 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 29 Aug 2024 07:56:27 -0700 Subject: [PATCH] Put allow(dead_code) on oneof case enum try_from This being unused in some cases is causing a warning at head, just suppressing the warning rather than conditionally emitting it only when we need it. PiperOrigin-RevId: 668937899 --- src/google/protobuf/compiler/rust/oneof.cc | 1 + 1 file changed, 1 insertion(+) 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),