-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Defmt's proc macros issue an error if the filename is not a correct identifier #853
Comments
The error stems from defmt/macros/src/function_like/log/env_filter/parse.rs Lines 102 to 105 in 75fb317
|
I believe we should allow using filenames that are not correct identifiers. PS. also the error message should be better. |
Bit by this as well, on Would appreciate the limitation to be lifted if there's no technical reason for its existance. |
@lure23 @gregtwice I gave it a shot in https://github.com/knurling-rs/defmt/tree/accept-crate-names-with-leading-numbers, but could not get it to work fully. Feel free to pick up the work. |
Unfortunately I’m not confident enough yet, in Rust, but thanks for the link. Prefixing with |
Probably that would be enough to fix it, just internally prefixing it with an underscore. |
It would be good to know (and document!) why the path segments even need to be valid identifier. Maybe we can even lift it? Briefly looking in the |
I have a file name 00_Hello_world in my bin folder which contains the following code:
When compiling I get the following error:
It compiles fine when removing the "00_" part of the file, or when removing the macros. So I guess that the issue is due to the fact that my filename is not a correct identifier. Do you think the error message could be improved? Or is it outside the scope of the crate?
Thank you for your consideration.
The text was updated successfully, but these errors were encountered: