Repro Steps
Compile the following proto file:
syntax = "proto3";
package Example;
enum E {
in = 0; // Uses the Rust 'in' keyword
}
message M {
E e = 1;
}
Expected Results
The generated Rust code compiles.
Actual Results
The enum E is generated correctly:
#[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:
clear_e
compute_size
write_to_with_cached_sizes
This leads to three compilation errors: expected identifier, found keyword.
Repro Steps
Compile the following proto file:
Expected Results
The generated Rust code compiles.
Actual Results
The enum
Eis generated correctly:However, the following methods of
MreferenceE::ininstead ofE::value_in:clear_ecompute_sizewrite_to_with_cached_sizesThis leads to three compilation errors:
expected identifier, found keyword.