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

treat &raw (const|mut) UNSAFE_STATIC implied deref as safe #125834

Commits on Jul 22, 2024

  1. compiler: treat &raw (const|mut) UNSAFE_STATIC implied deref as safe

    The implied deref to statics introduced by HIR->THIR lowering is only
    used to create place expressions, it lacks unsafe semantics.
    It is also confusing, as there is no visible `*ident` in the source.
    For both classes of "unsafe static" (extern static and static mut)
    allow this operation.
    
    We lack a clear story around `thread_local! { static mut }`, which
    is actually its own category of item that reuses the static syntax but
    has its own rules. It's possible they should be similarly included, but
    in the absence of a good reason one way or another, we do not bless it.
    workingjubilee committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    3fdd8d5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bf454af View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3cd9b5 View commit details
    Browse the repository at this point in the history