-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust_2018_idioms: build warning "hidden lifetime parameters in types are deprecated" #588
Comments
Where is this code located? |
This is the generated code: impl ::protobuf::reflect::ProtobufValue for CollectorMessages {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
message CollectorMessages {
oneof message {
SendObservationRequest send_observation_req = 1;
SendObservationResponse send_observation_resp = 2;
}
} |
Did you turn on Because otherwise I cannot reproduce it. |
Yes, apparently so. I just tried turning it on to see the warnings and off to not see them. Sorry I forgot to specify what lints I had turned on (I have quite a few).
|
If |
I think the generated code should be modified as described by the linter: impl ::protobuf::reflect::ProtobufValue for CollectorMessages {
- fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
+ fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef<'_> {
::protobuf::reflect::ReflectValueRef::Message(self)
}
} |
Yes, I think you are right, it would be safer this way. |
Interesting, current version from master does not have this warning (it generate similar code differently). rust-protobuf v3 will be released in the following weeks. Is it critical to have this warning fixed in rust-protobuf v2? |
No, it's not critical. Just annoying. And can of course be silenced with: |
I get the following warnings when compiling my code (with 2.25.2):
Same kind of issue is previously reported in #435.
The text was updated successfully, but these errors were encountered: