You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected: A message with a oneof can refer to a map of itself.
Observed: An opaque error message
error[E0596]: cannot borrow `value` as mutable, as it is not declared as mutable
--> src/value_wrapper.rs:11:28
|
11 | #[derive(Clone, PartialEq, prost::Oneof)]
| ^^^^^^^^^^^^ cannot borrow as mutable
|
= note: this error originates in the derive macro `prost::Oneof` (in Nightly builds, run with -Z macro-backtrace for more info)
Source
use std::collections::HashMap;#[derive(Clone,PartialEq, prost::Message)]pubstructDiskValue{#[prost(oneof = "ValueKind", tags = "1")]pubkind:Option<ValueKind>,}#[derive(Clone,PartialEq, prost::Oneof)]pubenumValueKind{#[prost(map = "string, message", tag = "1")]Map(HashMap<String,DiskValue>),}
I carefully referenced https://github.com/tokio-rs/prost/blob/master/tests/src/message_encoding.rs . This is likely PBKAC but I seem to be missing something here. I have no field named "value" and I'm not sure how to inspect this procedural macro. I use VS Code and Rust Analyzer doesn't have an option to expand the macro to show what's happening.
I'm not using a .proto. This is my source code for dependency prost = { version = "0.13" }
The text was updated successfully, but these errors were encountered:
I don't have experience with using derive prost::OneOf. If you model this in a .proto, does that work? Is the generated code any different from the example?
Expected: A
message
with aoneof
can refer to a map of itself.Observed: An opaque error message
Source
I carefully referenced https://github.com/tokio-rs/prost/blob/master/tests/src/message_encoding.rs . This is likely PBKAC but I seem to be missing something here. I have no field named "value" and I'm not sure how to inspect this procedural macro. I use VS Code and Rust Analyzer doesn't have an option to expand the macro to show what's happening.
I'm not using a .proto. This is my source code for dependency
prost = { version = "0.13" }
The text was updated successfully, but these errors were encountered: