We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Compile the following proto file:
syntax = "proto3"; package Example; enum E { in = 0; // Uses the Rust 'in' keyword } message M { E e = 1; }
The generated Rust code compiles.
The enum E is generated correctly:
E
#[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum E { value_in = 0, }
However, the following methods of M reference E::in instead of E::value_in:
M
E::in
E::value_in
clear_e
compute_size
write_to_with_cached_sizes
This leads to three compilation errors: expected identifier, found keyword.
expected identifier, found keyword
The text was updated successfully, but these errors were encountered:
4eaf07f
Thanks for the quick response, @stepancheg!
Sorry, something went wrong.
You are welcome! Going to backport it to stable branches now.
Published versions 2.0.1 and 1.7.2.
2.0.1
1.7.2
Fix codegen for enums where default value is rust keyword
22158bb
Fixes #295
344af32
No branches or pull requests
Repro Steps
Compile the following proto file:
Expected Results
The generated Rust code compiles.
Actual Results
The enum
E
is generated correctly:However, the following methods of
M
referenceE::in
instead ofE::value_in
:clear_e
compute_size
write_to_with_cached_sizes
This leads to three compilation errors:
expected identifier, found keyword
.The text was updated successfully, but these errors were encountered: