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

Fix unsafe mutable static warnings #8229

Open
wants to merge 1 commit into
base: dev-mail
Choose a base branch
from

Conversation

paw-hub
Copy link
Contributor

@paw-hub paw-hub commented Jan 7, 2025

Keep a Console always in existence, but make it so the sender can be set/unset. We can do this by using Once to ensure that our panic hook and logger are set once, and then having Console be pre-initialized with the sender set to None.

This ensures we do not need any static mutables, thus Console can be inited and deinited safely.

@paw-hub paw-hub force-pushed the rust-console-warning-fix branch from ab9e75b to d36b3ad Compare January 7, 2025 17:05
@paw-hub paw-hub marked this pull request as ready for review January 7, 2025 17:05
Keep a Console always in existence, but make it so the sender can be
set/unset. We can do this by using Once to ensure that our panic hook
and logger are set once, and then having Console be pre-initialized
with the sender set to None.

This ensures we do not need any static mutables, thus Console can be
inited and deinited safely.

Co-authored-by: hrb <[email protected]>
Co-authored-by: ivk <[email protected]>
@paw-hub paw-hub force-pushed the rust-console-warning-fix branch from d36b3ad to 2184238 Compare January 7, 2025 17:11
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 this pull request may close these issues.

1 participant