address reveiew comment

pull/18264/head
Zoey Greer 5 months ago
parent 77e78e9d66
commit aca540fac9
  1. 9
      src/google/protobuf/compiler/rust/message.cc

@ -287,6 +287,9 @@ void UpbGeneratedMessageTraitImpls(Context& ctx, const Descriptor& msg) {
unsafe impl $pbr$::AssociatedMiniTable for $Msg$ {
#[inline(always)]
fn mini_table() -> *const $pbr$::upb_MiniTable {
// This is unsafe only for Rust 1.80 and below and thus can be dropped
// once our MSRV is 1.81+
#[allow(unused_unsafe)]
unsafe {
$std$::ptr::addr_of!($minitable$)
}
@ -296,6 +299,9 @@ void UpbGeneratedMessageTraitImpls(Context& ctx, const Descriptor& msg) {
unsafe impl $pbr$::AssociatedMiniTable for $Msg$View<'_> {
#[inline(always)]
fn mini_table() -> *const $pbr$::upb_MiniTable {
// This is unsafe only for Rust 1.80 and below and thus can be dropped
// once our MSRV is 1.81+
#[allow(unused_unsafe)]
unsafe {
$std$::ptr::addr_of!($minitable$)
}
@ -305,6 +311,9 @@ void UpbGeneratedMessageTraitImpls(Context& ctx, const Descriptor& msg) {
unsafe impl $pbr$::AssociatedMiniTable for $Msg$Mut<'_> {
#[inline(always)]
fn mini_table() -> *const $pbr$::upb_MiniTable {
// This is unsafe only for Rust 1.80 and below and thus can be dropped
// once our MSRV is 1.81+
#[allow(unused_unsafe)]
unsafe {
$std$::ptr::addr_of!($minitable$)
}

Loading…
Cancel
Save