-
Notifications
You must be signed in to change notification settings - Fork 526
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
Unsupported raw identifiers in 0.5 #179
Comments
I made a simple local fix to the to_snake and to_upper_camel functions to resolve the issue. A little investigation suggests that Fix submitted in PR https://github.com/danburkert/prost/pull/180 |
fujiapple852
referenced
this issue
in fujiapple852/prost
May 1, 2019
danburkert
referenced
this issue
May 11, 2019
* fix for https://github.com/danburkert/prost/issues/179 * simplified the code
Fixed in #180, thanks! |
This was referenced Mar 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a proto file (that I do not control) which contains a field named
self
(of typeUnit
). In PROST 0.4 this is generated asSelf_
which works whereas in PROST 0.5 it is generated asr#Self
which fails to compile in stable rust (1.34) withr#Self is not currently supported
(see discussion on why here).Workaround is either to use PROST 0.4 (which in turn forces using Rust 2015 and therefore the PROST generated code needs to be in a separate crate for Rust 2018 projects) or some clunky pre or post processing of the proto file or generated code.
Suggested fix: revert to appending an
_
to keyword identifiers for the list of 5 keywords not supported by raw identifiers.Aside: I tried using the
field_attributes
option to prepend an_
to the field but this doesn't work as it is rendered as a separate token to the identifier:The text was updated successfully, but these errors were encountered: