-
Notifications
You must be signed in to change notification settings - Fork 314
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
Support 'pub const BAR: &CStr = c"hello world";' #927
Comments
actually, that's not supported yet in |
Seems like sending a PR to syn would be the way to go, then once that's merged we can use it... |
looks like it's already merged: |
@emilio I am currently blocked from using C string literals in my project due to this issue. Would be great to pull in the latest |
We presumably also need to use them somehow right? Maybe can be a follow-up tho. |
I believe this can be closed since PR #961 was merged |
Ah, I just found the |
Also do note that this does not fix the issue of #324 namely that It is currently documented that it may become a thin pointer in the future, but it seems less likely as time goes on. |
We have C string literals now stabilized in Rust since rust-lang/rust#105723 (since v1.77.0, which'll be released next month).
It seems reasonable to have const string literals like these:
and convert them to
#define
orconstexpr
or whatever cbindgen usually does with constantsCurrent behavior is very much not ideal (probably need to update syn to v2?):
The text was updated successfully, but these errors were encountered: