about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-01-09 13:23:15 +0100
committerGitHub <noreply@github.com>2024-01-09 13:23:15 +0100
commit18e12dcf6b7bd4f17553a7db7b57bab37ffcdfa5 (patch)
treec77244a87f0f64e82f4f9548c0e57ec501bfe5f6
parenta2a9032d1b04041f01ba9331b79aef36c8b8a33e (diff)
parent837c0305c6e61c1591b0c59935bb71df11b3638e (diff)
downloadrust-18e12dcf6b7bd4f17553a7db7b57bab37ffcdfa5.tar.gz
rust-18e12dcf6b7bd4f17553a7db7b57bab37ffcdfa5.zip
Rollup merge of #117556 - obeis:static-mut-ref-lint, r=davidtwco
Disallow reference to `static mut` and adding `static_mut_ref` lint

Closes #114447

r? `@scottmcm`
-rw-r--r--example/mini_core_hello_world.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index a1cdf31c68a..2a7b1107ffc 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -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 {