We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to @oli-obk, there are currently some checks somewhere to rule out interior mutability in constants. However, this is accepted:
use std::sync::atomic::AtomicUsize; const FOO : AtomicUsize = AtomicUsize::new(3);
It would be great if the reasons for this check could be spelled out, ideally somewhere in this repo :D
The text was updated successfully, but these errors were encountered:
Interior mutability is ruled out in statics, not in constants. Constants are annotated internally so statics using them know about it
Sorry, something went wrong.
This works as well:
use std::sync::atomic::AtomicUsize; static FOO : AtomicUsize = AtomicUsize::new(3);
And indeed why would it not...
discussion continued in rust-lang/rust#53819
No branches or pull requests
According to @oli-obk, there are currently some checks somewhere to rule out interior mutability in constants. However, this is accepted:
It would be great if the reasons for this check could be spelled out, ideally somewhere in this repo :D
The text was updated successfully, but these errors were encountered: