Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Generated Rust file contains reference to super::struct_pb::NullValue::NULL_VALUE #129

Closed
chbaker0 opened this issue Oct 2, 2018 · 2 comments

Comments

@chbaker0
Copy link

chbaker0 commented Oct 2, 2018

I'm using this library, with protoc-rust-grpc, to to generate Rust code for the Google Cloud Datastore protos defined at https://github.com/googleapis/googleapis. The generated code for Value in entity.proto contains the following code:

    pub fn get_null_value(&self) -> ::protobuf::well_known_types::NullValue {
        match self.value_type {
            ::std::option::Option::Some(Value_oneof_value_type::null_value(v)) => v,
            _ => super::struct_pb::NullValue::NULL_VALUE,
        }
    }

When building, I get the following error:

error[E0433]: failed to resolve. Could not find `struct_pb` in `super`                                   
   --> src/gen/proto/entity.rs:968:25                                                                    
    |                                                                                                    
968 |             _ => super::struct_pb::NullValue::NULL_VALUE,                                          
    |                         ^^^^^^^^^ Could not find `struct_pb` in `super`                            

There's no corresponding definition of struct_pb in the generated files. I'm guessing this should be referring to ::protobuf::well_known_types::struct_pb?

I'm sorry if I'm just doing something wrong here.

@Ragnaroek
Copy link

Ragnaroek commented Mar 26, 2019

Same here for this file https://github.com/googleapis/googleapis/blob/master/google/firestore/v1/document.proto

It generates the following code that cannot be compiled:

pub fn get_null_value(&self) -> ::protobuf::well_known_types::NullValue {
        match self.value_type {
            ::std::option::Option::Some(Value_oneof_value_type::null_value(v)) => v,
            _ => super::struct_pb::NullValue::NULL_VALUE,
        }
 }

@stepancheg
Copy link
Owner

Fixed in 2.4.2. Thank you for the reminder!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants