diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-01-09 13:23:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-09 13:23:15 +0100 |
| commit | 4a24b5bc054f78c165cbdf4dd3e0a7f56f468d7d (patch) | |
| tree | 8c1fef00c6ab1567f6552704e4593932d04d6685 /compiler/rustc_codegen_cranelift | |
| parent | be00c5a9b89161b7f45ba80340f709e8e41122f9 (diff) | |
| parent | a8aa6878f63e53a9b0cfee542e9765407e1ca0d6 (diff) | |
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`
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index a1cdf31c68a..2a7b1107ffc 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/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 { |
