diff --git a/src/google/protobuf/compiler/rust/accessors/singular_message.cc b/src/google/protobuf/compiler/rust/accessors/singular_message.cc index 81dbc4efe6..9e045bfb10 100644 --- a/src/google/protobuf/compiler/rust/accessors/singular_message.cc +++ b/src/google/protobuf/compiler/rust/accessors/singular_message.cc @@ -36,11 +36,11 @@ void SingularMessage::InMsgImpl(Context& ctx, if (ctx.is_upb()) { ctx.Emit({}, R"rs( let submsg = unsafe { $getter_thunk$(self.inner.msg) }; - // For upb, getters return null if the field is unset, so we need - // to check for null and return the default instance manually. - // Note that a nullptr received from upb manifests as Option::None + //~ For upb, getters return null if the field is unset, so we need + //~ to check for null and return the default instance manually. + //~ Note that a nullptr received from upb manifests as Option::None match submsg { - // TODO:(b/304357029) + //~ TODO:(b/304357029) None => $prefix$View::new($pbi$::Private, $pbr$::ScratchSpace::zeroed_block($pbi$::Private)), Some(field) => $prefix$View::new($pbi$::Private, field), @@ -48,8 +48,8 @@ void SingularMessage::InMsgImpl(Context& ctx, )rs"); } else { ctx.Emit({}, R"rs( - // For C++ kernel, getters automatically return the - // default_instance if the field is unset. + //~ For C++ kernel, getters automatically return the + //~ default_instance if the field is unset. let submsg = unsafe { $getter_thunk$(self.inner.msg) }; $prefix$View::new($pbi$::Private, submsg) )rs"); diff --git a/src/google/protobuf/compiler/rust/message.cc b/src/google/protobuf/compiler/rust/message.cc index 4affd948cd..6ead0f0bb3 100644 --- a/src/google/protobuf/compiler/rust/message.cc +++ b/src/google/protobuf/compiler/rust/message.cc @@ -110,8 +110,8 @@ void MessageDeserialize(Context& ctx, const Descriptor& msg) { match msg { None => Err($pb$::ParseError), Some(msg) => { - // This assignment causes self.arena to be dropped and to deallocate - // any previous message pointed/owned to by self.inner.msg. + //~ This assignment causes self.arena to be dropped and to deallocate + //~ any previous message pointed/owned to by self.inner.msg. self.inner.arena = arena; self.inner.msg = msg; Ok(()) @@ -437,7 +437,7 @@ void GenerateRs(Context& ctx, const Descriptor& msg) { {"settable_impl", [&] { MessageSettableValue(ctx, msg); }}}, R"rs( #[allow(non_camel_case_types)] - // TODO: Implement support for debug redaction + //~ TODO: Implement support for debug redaction #[derive(Debug)] pub struct $Msg$ { inner: $pbr$::MessageInner