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

Audit uses of static mut #678

Open
ChrisDenton opened this issue Nov 13, 2024 · 0 comments · May be fixed by #679
Open

Audit uses of static mut #678

ChrisDenton opened this issue Nov 13, 2024 · 0 comments · May be fixed by #679

Comments

@ChrisDenton
Copy link
Member

The new warning is causing CI to fail. E.g:

error: creating a mutable reference to mutable static is discouraged
   --> src/symbolize/gimli.rs:368:11
    |
368 |         f(MAPPINGS_CACHE.get_or_insert_with(Cache::new))
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
    = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
    = note: `-D static-mut-refs` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(static_mut_refs)]`

error: could not compile `backtrace` (lib) due to 1 previous error

Either we should allow the lint and add some comments or else actually fix the issue.

@ChrisDenton ChrisDenton linked a pull request Nov 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant