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
MIR borrowck errors out on assignments to mutable statics, which should be allowed (in unsafe code) e.g.
static mut Y: u32 = 0; unsafe fn should_ok() { Y = 1; } fn main() {}
which causes:
$ rustc x.rs -Z borrowck-mir error: cannot assign to immutable static item Y (Mir) --> x.rs:5:5 | 5 | Y = 1; | ^^^^^ error: aborting due to previous error
The text was updated successfully, but these errors were encountered:
Seems like this ought to fall out from permissions checking (#44837), right?
Sorry, something went wrong.
Nope, still broken in 88a28ff (which includes #44837)
Looking at this as well. I believe the error comes from the improper static check in check_if_reassignment_to_immutable_state.
check_if_reassignment_to_immutable_state
Auto merge of #46032 - KiChjang:ignore-borrowck-statics, r=nikomatsakis
b1409af
Ignore borrowck for static lvalues and allow assignment to static muts Fixes #45129. Fixes #45641.
No branches or pull requests
MIR borrowck errors out on assignments to mutable statics, which should be allowed (in unsafe code) e.g.
which causes:
The text was updated successfully, but these errors were encountered: