Skip to content

Commit

Permalink
Rollup merge of rust-lang#117556 - obeis:static-mut-ref-lint, r=david…
Browse files Browse the repository at this point in the history
…twco

Disallow reference to `static mut` and adding `static_mut_ref` lint

Closes rust-lang#114447

r? `@scottmcm`
  • Loading branch information
GuillaumeGomez authored Jan 9, 2024
2 parents a2a9032 + 837c030 commit 18e12dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example/mini_core_hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ fn start<T: Termination + 'static>(
}

static mut NUM: u8 = 6 * 7;

// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
#[allow(static_mut_ref)]
static NUM_REF: &'static u8 = unsafe { &NUM };

unsafe fn zeroed<T>() -> T {
Expand Down

0 comments on commit 18e12dc

Please sign in to comment.