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

Error in Rust Variable Name page #2006

Open
uptudev opened this issue Feb 2, 2025 · 0 comments · May be fixed by #2007
Open

Error in Rust Variable Name page #2006

uptudev opened this issue Feb 2, 2025 · 0 comments · May be fixed by #2007
Labels
bug Something isn't working

Comments

@uptudev
Copy link

uptudev commented Feb 2, 2025

Link to erroneous code

Explanation

This does not explain how to get the name of a variable, but its type.

Fix

PR attached. The only other option beyond the stringify!() macro (which does not work where there is any indirection, like getting the name of a variable passed as a function parameter) is using the external syn crate, which is not ideal for most scenarios.

@uptudev uptudev added the bug Something isn't working label Feb 2, 2025
@uptudev uptudev linked a pull request Feb 2, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant