Skip to content
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

Generates invalid identifier when protocol field name is gen #1267

Open
de11n opened this issue Apr 4, 2025 · 0 comments
Open

Generates invalid identifier when protocol field name is gen #1267

de11n opened this issue Apr 4, 2025 · 0 comments

Comments

@de11n
Copy link

de11n commented Apr 4, 2025

Given a .proto containing this field

    uint32 gen = 3;

The resulting Rust code is invalid,

error: expected identifier, found reserved keyword `gen`
    --> /.../out/grpc.rs:1041:9
     |
1041 |     pub gen: u32,
     |         ^^^ expected identifier, found reserved keyword
     |
help: escape `gen` to use it as an identifier
     |
1041 |     pub r#gen: u32,
     |         ++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant