diff --git a/rust/BUILD b/rust/BUILD index a86ec6966866..24dce3acce81 100644 --- a/rust/BUILD +++ b/rust/BUILD @@ -48,7 +48,6 @@ rust_library( PROTOBUF_SHARED = [ "enum.rs", "internal.rs", - "macros.rs", "optional.rs", "primitive.rs", "proxied.rs", diff --git a/rust/cpp.rs b/rust/cpp.rs index 9e78c093366d..3b70dff6cece 100644 --- a/rust/cpp.rs +++ b/rust/cpp.rs @@ -10,7 +10,7 @@ use crate::__internal::{Enum, Private}; use crate::{ Map, MapIter, Mut, ProtoStr, Proxied, ProxiedInMapValue, ProxiedInRepeated, Repeated, - RepeatedMut, RepeatedView, SettableValue, View, + RepeatedMut, RepeatedView, View, }; use core::fmt::Debug; use paste::paste; diff --git a/rust/macros.rs b/rust/macros.rs deleted file mode 100644 index 4f8334933e87..000000000000 --- a/rust/macros.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -//! Runtime-internal macros - -/// Defines a `impl SettableValue<$proxied> for SomeType` body that forwards to -/// another implementation. -/// -/// # Example -/// ```ignore -/// impl<'a, const N: usize> SettableValue<[u8]> for &'a [u8; N] { -/// // Use the `SettableValue<[u8]>` implementation for `&[u8]`: -/// impl_forwarding_settable_value!([u8], self => &self[..]); -/// } -/// ``` -macro_rules! impl_forwarding_settable_value { - ($proxied:ty, $self:ident => $self_forwarding_expr:expr) => { - fn set_on<'b>( - $self, - _private: $crate::__internal::Private, - mutator: $crate::Mut<'b, $proxied>, - ) where $proxied: 'b { - ($self_forwarding_expr).set_on(Private, mutator) - } - - fn set_on_absent( - $self, - _private: $crate::__internal::Private, - absent_mutator: <$proxied as $crate::ProxiedWithPresence>::AbsentMutData<'_>, - ) -> <$proxied as $crate::ProxiedWithPresence>::PresentMutData<'_> { - ($self_forwarding_expr).set_on_absent($crate::__internal::Private, absent_mutator) - } - - fn set_on_present( - $self, - _private: $crate::__internal::Private, - present_mutator: <$proxied as $crate::ProxiedWithPresence>::PresentMutData<'_>, - ) { - ($self_forwarding_expr).set_on_present($crate::__internal::Private, present_mutator) - } - }; -} -pub(crate) use impl_forwarding_settable_value; diff --git a/rust/shared.rs b/rust/shared.rs index 79ff7e629a93..26d606a4caaa 100644 --- a/rust/shared.rs +++ b/rust/shared.rs @@ -56,7 +56,6 @@ pub mod __runtime; #[path = "enum.rs"] mod r#enum; -mod macros; mod map; mod optional; mod primitive; diff --git a/rust/string.rs b/rust/string.rs index e54ec44bc02d..9711f87bf1f2 100644 --- a/rust/string.rs +++ b/rust/string.rs @@ -13,7 +13,6 @@ use crate::__internal::Private; use crate::__runtime::{ BytesAbsentMutData, BytesPresentMutData, InnerBytesMut, PtrAndLen, RawMessage, }; -use crate::macros::impl_forwarding_settable_value; use crate::{ AbsentField, FieldEntry, Mut, MutProxied, MutProxy, Optional, PresentField, Proxied, ProxiedWithPresence, SettableValue, View, ViewProxy, diff --git a/rust/upb.rs b/rust/upb.rs index e697a27bf80c..413f9851e1ad 100644 --- a/rust/upb.rs +++ b/rust/upb.rs @@ -10,7 +10,7 @@ use crate::__internal::{Enum, Private}; use crate::{ Map, MapIter, MapMut, MapView, Mut, ProtoStr, Proxied, ProxiedInMapValue, ProxiedInRepeated, - Repeated, RepeatedMut, RepeatedView, SettableValue, View, ViewProxy, + Repeated, RepeatedMut, RepeatedView, View, ViewProxy, }; use core::fmt::Debug; use std::alloc::Layout;