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[E0492]: statics cannot refer to interior mutable data #283
Labels
Comments
I found the following syntax seems to work, but the syntax is nasty: static YS: phf::Map<&'static str, &Lazy<String>> = phf_map! {
"fee" => { static _DUMMY: Lazy<String> = Lazy::new(|| "bizz".to_string()); &_DUMMY },
"fi" => { static _DUMMY: Lazy<String> = Lazy::new(|| "buzz".to_string()); &_DUMMY },
}; |
proc-macro doesn't handle it nicely, I think. We've declared: rust-phf/phf_macros/src/lib.rs Lines 65 to 173 in 3776342
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is probably me not understanding something rather than a bug but why do the following static declarations work but using the same declaration as part of
phf_map!
does not?The text was updated successfully, but these errors were encountered: