about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/abi/statics/static-mut-foreign.rs5
-rw-r--r--tests/ui/abi/statics/static-mut-foreign.stderr31
-rw-r--r--tests/ui/array-slice-vec/slice-panic-1.rs2
-rw-r--r--tests/ui/array-slice-vec/slice-panic-2.rs2
-rw-r--r--tests/ui/array-slice-vec/slice.rs3
-rw-r--r--tests/ui/async-await/issues/issue-67611-static-mut-refs.rs2
-rw-r--r--tests/ui/binding/order-drop-with-match.rs2
-rw-r--r--tests/ui/borrowck/borrowck-access-permissions.rs1
-rw-r--r--tests/ui/borrowck/borrowck-access-permissions.stderr25
-rw-r--r--tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr11
-rw-r--r--tests/ui/borrowck/issue-20801.rs1
-rw-r--r--tests/ui/borrowck/issue-20801.stderr25
-rw-r--r--tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs3
-rw-r--r--tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr55
-rw-r--r--tests/ui/consts/const_let_assign2.stderr11
-rw-r--r--tests/ui/consts/static-mut-refs.rs3
-rw-r--r--tests/ui/coroutine/static-mut-reference-across-yield.rs2
-rw-r--r--tests/ui/drop/drop-struct-as-object.rs3
-rw-r--r--tests/ui/drop/drop-struct-as-object.stderr2
-rw-r--r--tests/ui/drop/issue-23338-ensure-param-drop-order.rs3
-rw-r--r--tests/ui/drop/issue-23338-ensure-param-drop-order.stderr17
-rw-r--r--tests/ui/drop/issue-23611-enum-swap-in-drop.rs3
-rw-r--r--tests/ui/drop/issue-23611-enum-swap-in-drop.stderr17
-rw-r--r--tests/ui/drop/issue-48962.rs3
-rw-r--r--tests/ui/drop/repeat-drop.rs3
-rw-r--r--tests/ui/drop/static-issue-17302.rs (renamed from tests/ui/issues/issue-17302.rs)3
-rw-r--r--tests/ui/for-loop-while/cleanup-rvalue-during-if-and-while.rs3
-rw-r--r--tests/ui/functional-struct-update/functional-struct-update-respects-privacy.rs4
-rw-r--r--tests/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr2
-rw-r--r--tests/ui/issues/issue-10734.rs3
-rw-r--r--tests/ui/issues/issue-15858.rs2
-rw-r--r--tests/ui/issues/issue-15858.stderr2
-rw-r--r--tests/ui/issues/issue-16151.rs3
-rw-r--r--tests/ui/issues/issue-39367.rs1
-rw-r--r--tests/ui/issues/issue-39367.stderr17
-rw-r--r--tests/ui/issues/issue-4734.rs3
-rw-r--r--tests/ui/issues/issue-54410.rs1
-rw-r--r--tests/ui/issues/issue-54410.stderr17
-rw-r--r--tests/ui/issues/issue-6892.rs2
-rw-r--r--tests/ui/issues/issue-8860.rs2
-rw-r--r--tests/ui/link-section.rs3
-rw-r--r--tests/ui/linkage-attr/linkage-attr-mutable-static.rs2
-rw-r--r--tests/ui/linkage-attr/linkage-attr-mutable-static.stderr2
-rw-r--r--tests/ui/lint/static-mut-refs.e2021.stderr143
-rw-r--r--tests/ui/lint/static-mut-refs.e2024.stderr143
-rw-r--r--tests/ui/lint/static-mut-refs.rs95
-rw-r--r--tests/ui/lto/lto-still-runs-thread-dtors.rs3
-rw-r--r--tests/ui/methods/method-self-arg-trait.rs3
-rw-r--r--tests/ui/methods/method-self-arg.rs3
-rw-r--r--tests/ui/mir/mir_early_return_scope.rs2
-rw-r--r--tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr11
-rw-r--r--tests/ui/nll/issue-69114-static-mut-ty.rs3
-rw-r--r--tests/ui/nll/issue-69114-static-mut-ty.stderr4
-rw-r--r--tests/ui/numbers-arithmetic/shift-near-oflo.rs3
-rw-r--r--tests/ui/self/where-for-self.rs2
-rw-r--r--tests/ui/static/reference-to-mut-static-safe.e2021.stderr26
-rw-r--r--tests/ui/static/reference-to-mut-static-safe.e2024.stderr24
-rw-r--r--tests/ui/static/reference-to-mut-static-safe.rs13
-rw-r--r--tests/ui/static/reference-to-mut-static-unsafe-fn.rs28
-rw-r--r--tests/ui/static/reference-to-mut-static-unsafe-fn.stderr75
-rw-r--r--tests/ui/static/reference-to-mut-static.e2021.stderr91
-rw-r--r--tests/ui/static/reference-to-mut-static.e2024.stderr75
-rw-r--r--tests/ui/static/reference-to-mut-static.rs50
-rw-r--r--tests/ui/static/safe-extern-statics-mut.rs2
-rw-r--r--tests/ui/static/safe-extern-statics-mut.stderr35
-rw-r--r--tests/ui/statics/issue-15261.stderr11
-rw-r--r--tests/ui/statics/static-mut-xc.rs5
-rw-r--r--tests/ui/statics/static-mut-xc.stderr75
-rw-r--r--tests/ui/statics/static-recursive.rs1
-rw-r--r--tests/ui/statics/static-recursive.stderr22
-rw-r--r--tests/ui/thread-local/thread-local-issue-37508.rs3
-rw-r--r--tests/ui/traits/impl.rs3
-rw-r--r--tests/ui/traits/impl.stderr2
-rw-r--r--tests/ui/union/union-drop-assign.rs3
-rw-r--r--tests/ui/union/union-drop.rs2
75 files changed, 617 insertions, 651 deletions
diff --git a/tests/ui/abi/statics/static-mut-foreign.rs b/tests/ui/abi/statics/static-mut-foreign.rs
index 167b7a4e36e..40cd57637e6 100644
--- a/tests/ui/abi/statics/static-mut-foreign.rs
+++ b/tests/ui/abi/statics/static-mut-foreign.rs
@@ -3,6 +3,9 @@
 // statics cannot. This ensures that there's some form of error if this is
 // attempted.
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 use std::ffi::c_int;
 
 #[link(name = "rust_test_helpers", kind = "static")]
@@ -29,9 +32,7 @@ unsafe fn run() {
     rust_dbg_static_mut = -3;
     assert_eq!(rust_dbg_static_mut, -3);
     static_bound(&rust_dbg_static_mut);
-    //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
     static_bound_set(&mut rust_dbg_static_mut);
-    //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
 }
 
 pub fn main() {
diff --git a/tests/ui/abi/statics/static-mut-foreign.stderr b/tests/ui/abi/statics/static-mut-foreign.stderr
deleted file mode 100644
index 0c4bd5382a1..00000000000
--- a/tests/ui/abi/statics/static-mut-foreign.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/static-mut-foreign.rs:31:18
-   |
-LL |     static_bound(&rust_dbg_static_mut);
-   |                  ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |     static_bound(addr_of!(rust_dbg_static_mut));
-   |                  ~~~~~~~~~                   +
-
-warning: creating a mutable reference to mutable static is discouraged
-  --> $DIR/static-mut-foreign.rs:33:22
-   |
-LL |     static_bound_set(&mut rust_dbg_static_mut);
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |     static_bound_set(addr_of_mut!(rust_dbg_static_mut));
-   |                      ~~~~~~~~~~~~~                   +
-
-warning: 2 warnings emitted
-
diff --git a/tests/ui/array-slice-vec/slice-panic-1.rs b/tests/ui/array-slice-vec/slice-panic-1.rs
index 4436b633856..d4f584c1632 100644
--- a/tests/ui/array-slice-vec/slice-panic-1.rs
+++ b/tests/ui/array-slice-vec/slice-panic-1.rs
@@ -5,6 +5,8 @@
 
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
 
 use std::thread;
 
diff --git a/tests/ui/array-slice-vec/slice-panic-2.rs b/tests/ui/array-slice-vec/slice-panic-2.rs
index 4bd13988424..b3d1dc45573 100644
--- a/tests/ui/array-slice-vec/slice-panic-2.rs
+++ b/tests/ui/array-slice-vec/slice-panic-2.rs
@@ -5,6 +5,8 @@
 
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
 
 use std::thread;
 
diff --git a/tests/ui/array-slice-vec/slice.rs b/tests/ui/array-slice-vec/slice.rs
index 2adcd96f598..ad5db7a2102 100644
--- a/tests/ui/array-slice-vec/slice.rs
+++ b/tests/ui/array-slice-vec/slice.rs
@@ -3,6 +3,9 @@
 
 // Test slicing sugar.
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 extern crate core;
 use core::ops::{Index, IndexMut, Range, RangeTo, RangeFrom, RangeFull};
 
diff --git a/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs b/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs
index 51e85931dbf..547c7414526 100644
--- a/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs
+++ b/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs
@@ -2,6 +2,8 @@
 //@ edition:2018
 
 #![feature(if_let_guard)]
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 
 static mut A: [i32; 5] = [1, 2, 3, 4, 5];
 
diff --git a/tests/ui/binding/order-drop-with-match.rs b/tests/ui/binding/order-drop-with-match.rs
index c12c5e4c627..cd0ff73cf12 100644
--- a/tests/ui/binding/order-drop-with-match.rs
+++ b/tests/ui/binding/order-drop-with-match.rs
@@ -5,6 +5,8 @@
 // in ORDER matching up to when it ran.
 // Correct order is: matched, inner, outer
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 
 static mut ORDER: [usize; 3] = [0, 0, 0];
 static mut INDEX: usize = 0;
diff --git a/tests/ui/borrowck/borrowck-access-permissions.rs b/tests/ui/borrowck/borrowck-access-permissions.rs
index be11286a523..0e9e2bc1354 100644
--- a/tests/ui/borrowck/borrowck-access-permissions.rs
+++ b/tests/ui/borrowck/borrowck-access-permissions.rs
@@ -16,7 +16,6 @@ fn main() {
         let _y1 = &mut static_x; //~ ERROR [E0596]
         unsafe {
             let _y2 = &mut static_x_mut;
-            //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
         }
     }
 
diff --git a/tests/ui/borrowck/borrowck-access-permissions.stderr b/tests/ui/borrowck/borrowck-access-permissions.stderr
index 36e259fa6e8..ade10dbbfbd 100644
--- a/tests/ui/borrowck/borrowck-access-permissions.stderr
+++ b/tests/ui/borrowck/borrowck-access-permissions.stderr
@@ -1,18 +1,3 @@
-warning: creating a mutable reference to mutable static is discouraged
-  --> $DIR/borrowck-access-permissions.rs:18:23
-   |
-LL |             let _y2 = &mut static_x_mut;
-   |                       ^^^^^^^^^^^^^^^^^ mutable reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |             let _y2 = addr_of_mut!(static_x_mut);
-   |                       ~~~~~~~~~~~~~            +
-
 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
   --> $DIR/borrowck-access-permissions.rs:10:19
    |
@@ -31,7 +16,7 @@ LL |         let _y1 = &mut static_x;
    |                   ^^^^^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable
-  --> $DIR/borrowck-access-permissions.rs:28:19
+  --> $DIR/borrowck-access-permissions.rs:27:19
    |
 LL |         let _y1 = &mut *box_x;
    |                   ^^^^^^^^^^^ cannot borrow as mutable
@@ -42,7 +27,7 @@ LL |         let mut box_x = Box::new(1);
    |             +++
 
 error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
-  --> $DIR/borrowck-access-permissions.rs:37:19
+  --> $DIR/borrowck-access-permissions.rs:36:19
    |
 LL |         let _y1 = &mut *ref_x;
    |                   ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
@@ -53,7 +38,7 @@ LL |         let ref_x = &mut x;
    |                      +++
 
 error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer
-  --> $DIR/borrowck-access-permissions.rs:47:23
+  --> $DIR/borrowck-access-permissions.rs:46:23
    |
 LL |             let _y1 = &mut *ptr_x;
    |                       ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
@@ -64,7 +49,7 @@ LL |         let ptr_x: *const _ = &mut x;
    |                                +++
 
 error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference
-  --> $DIR/borrowck-access-permissions.rs:60:18
+  --> $DIR/borrowck-access-permissions.rs:59:18
    |
 LL |         let _y = &mut *foo_ref.f;
    |                  ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable
@@ -74,6 +59,6 @@ help: consider changing this to be a mutable reference
 LL |         let foo_ref = &mut foo;
    |                        +++
 
-error: aborting due to 6 previous errors; 1 warning emitted
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0596`.
diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr
index a727c9414c5..e4dfa6d7fba 100644
--- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr
+++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr
@@ -4,14 +4,13 @@ warning: creating a mutable reference to mutable static is discouraged
 LL |         let sfoo: *mut Foo = &mut SFOO;
    |                              ^^^^^^^^^ mutable reference to mutable static
    |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
    = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of_mut!` instead to create a raw pointer
+help: use `&raw mut` instead to create a raw pointer
    |
-LL |         let sfoo: *mut Foo = addr_of_mut!(SFOO);
-   |                              ~~~~~~~~~~~~~    +
+LL |         let sfoo: *mut Foo = &raw mut SFOO;
+   |                              ~~~~~~~~
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/borrowck/issue-20801.rs b/tests/ui/borrowck/issue-20801.rs
index 7e3d3703dc7..c3f136f2876 100644
--- a/tests/ui/borrowck/issue-20801.rs
+++ b/tests/ui/borrowck/issue-20801.rs
@@ -12,7 +12,6 @@ fn imm_ref() -> &'static T {
 
 fn mut_ref() -> &'static mut T {
     unsafe { &mut GLOBAL_MUT_T }
-    //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
 }
 
 fn mut_ptr() -> *mut T {
diff --git a/tests/ui/borrowck/issue-20801.stderr b/tests/ui/borrowck/issue-20801.stderr
index 769b34831c1..5fda92634d8 100644
--- a/tests/ui/borrowck/issue-20801.stderr
+++ b/tests/ui/borrowck/issue-20801.stderr
@@ -1,20 +1,5 @@
-warning: creating a mutable reference to mutable static is discouraged
-  --> $DIR/issue-20801.rs:14:14
-   |
-LL |     unsafe { &mut GLOBAL_MUT_T }
-   |              ^^^^^^^^^^^^^^^^^ mutable reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |     unsafe { addr_of_mut!(GLOBAL_MUT_T) }
-   |              ~~~~~~~~~~~~~            +
-
 error[E0507]: cannot move out of a mutable reference
-  --> $DIR/issue-20801.rs:27:22
+  --> $DIR/issue-20801.rs:26:22
    |
 LL |     let a = unsafe { *mut_ref() };
    |                      ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
@@ -34,7 +19,7 @@ LL +     let a = unsafe { mut_ref() };
    |
 
 error[E0507]: cannot move out of a shared reference
-  --> $DIR/issue-20801.rs:30:22
+  --> $DIR/issue-20801.rs:29:22
    |
 LL |     let b = unsafe { *imm_ref() };
    |                      ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
@@ -54,7 +39,7 @@ LL +     let b = unsafe { imm_ref() };
    |
 
 error[E0507]: cannot move out of a raw pointer
-  --> $DIR/issue-20801.rs:33:22
+  --> $DIR/issue-20801.rs:32:22
    |
 LL |     let c = unsafe { *mut_ptr() };
    |                      ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
@@ -69,7 +54,7 @@ LL |     let c = unsafe { *mut_ptr() };
    |                      ---------- you could clone this value
 
 error[E0507]: cannot move out of a raw pointer
-  --> $DIR/issue-20801.rs:36:22
+  --> $DIR/issue-20801.rs:35:22
    |
 LL |     let d = unsafe { *const_ptr() };
    |                      ^^^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
@@ -83,6 +68,6 @@ LL | struct T(u8);
 LL |     let d = unsafe { *const_ptr() };
    |                      ------------ you could clone this value
 
-error: aborting due to 4 previous errors; 1 warning emitted
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0507`.
diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
index c3909d05963..e22bf42e021 100644
--- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
+++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
@@ -10,7 +10,6 @@ mod borrowck_closures_unique {
         //~^ ERROR is not declared as mutable
         unsafe {
             c1(&mut Y);
-            //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
         }
     }
 }
@@ -25,7 +24,6 @@ mod borrowck_closures_unique_grandparent {
         };
         unsafe {
             c1(&mut Z);
-            //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
         }
     }
 }
@@ -62,7 +60,6 @@ fn main() {
     static mut X: isize = 2;
     unsafe {
         borrowck_closures_unique::e(&mut X);
-        //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
     }
 
     mutability_errors::capture_assign_whole((1000,));
diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
index 72fd0d8ce16..6fc8d3a6c35 100644
--- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
+++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
@@ -1,46 +1,3 @@
-warning: creating a mutable reference to mutable static is discouraged
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:12:16
-   |
-LL |             c1(&mut Y);
-   |                ^^^^^^ mutable reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |             c1(addr_of_mut!(Y));
-   |                ~~~~~~~~~~~~~ +
-
-warning: creating a mutable reference to mutable static is discouraged
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:27:16
-   |
-LL |             c1(&mut Z);
-   |                ^^^^^^ mutable reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |             c1(addr_of_mut!(Z));
-   |                ~~~~~~~~~~~~~ +
-
-warning: creating a mutable reference to mutable static is discouraged
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:64:37
-   |
-LL |         borrowck_closures_unique::e(&mut X);
-   |                                     ^^^^^^ mutable reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |         borrowck_closures_unique::e(addr_of_mut!(X));
-   |                                     ~~~~~~~~~~~~~ +
-
 error[E0594]: cannot assign to `x`, as it is not declared as mutable
   --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46
    |
@@ -53,7 +10,7 @@ LL |     pub fn e(mut x: &'static mut isize) {
    |              +++
 
 error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:22:50
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:21:50
    |
 LL |             let mut c2 = |y: &'static mut isize| x = y;
    |                                                  ^^^^^ cannot assign
@@ -64,7 +21,7 @@ LL |     pub fn ee(mut x: &'static mut isize) {
    |               +++
 
 error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:37:13
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:35:13
    |
 LL |             x = (1,);
    |             ^^^^^^^^ cannot assign
@@ -75,7 +32,7 @@ LL |     pub fn capture_assign_whole(mut x: (i32,)) {
    |                                 +++
 
 error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:43:13
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:41:13
    |
 LL |             x.0 = 1;
    |             ^^^^^^^ cannot assign
@@ -86,7 +43,7 @@ LL |     pub fn capture_assign_part(mut x: (i32,)) {
    |                                +++
 
 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:49:13
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:47:13
    |
 LL |             &mut x;
    |             ^^^^^^ cannot borrow as mutable
@@ -97,7 +54,7 @@ LL |     pub fn capture_reborrow_whole(mut x: (i32,)) {
    |                                   +++
 
 error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
-  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:55:13
+  --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:53:13
    |
 LL |             &mut x.0;
    |             ^^^^^^^^ cannot borrow as mutable
@@ -107,7 +64,7 @@ help: consider changing this to be mutable
 LL |     pub fn capture_reborrow_part(mut x: (i32,)) {
    |                                  +++
 
-error: aborting due to 6 previous errors; 3 warnings emitted
+error: aborting due to 6 previous errors
 
 Some errors have detailed explanations: E0594, E0596.
 For more information about an error, try `rustc --explain E0594`.
diff --git a/tests/ui/consts/const_let_assign2.stderr b/tests/ui/consts/const_let_assign2.stderr
index 87b94a7be67..9a1b84dbf09 100644
--- a/tests/ui/consts/const_let_assign2.stderr
+++ b/tests/ui/consts/const_let_assign2.stderr
@@ -4,14 +4,13 @@ warning: creating a mutable reference to mutable static is discouraged
 LL |     let ptr = unsafe { &mut BB };
    |                        ^^^^^^^ mutable reference to mutable static
    |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
    = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of_mut!` instead to create a raw pointer
+help: use `&raw mut` instead to create a raw pointer
    |
-LL |     let ptr = unsafe { addr_of_mut!(BB) };
-   |                        ~~~~~~~~~~~~~  +
+LL |     let ptr = unsafe { &raw mut BB };
+   |                        ~~~~~~~~
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/consts/static-mut-refs.rs b/tests/ui/consts/static-mut-refs.rs
index d4ebfbbf17a..c0d0bb61332 100644
--- a/tests/ui/consts/static-mut-refs.rs
+++ b/tests/ui/consts/static-mut-refs.rs
@@ -1,6 +1,9 @@
 //@ run-pass
 #![allow(dead_code)]
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 // Checks that mutable static items can have mutable slices and other references
 
 
diff --git a/tests/ui/coroutine/static-mut-reference-across-yield.rs b/tests/ui/coroutine/static-mut-reference-across-yield.rs
index 40d5fdf2d57..d45d6e6428b 100644
--- a/tests/ui/coroutine/static-mut-reference-across-yield.rs
+++ b/tests/ui/coroutine/static-mut-reference-across-yield.rs
@@ -1,6 +1,8 @@
 //@ build-pass
 
 #![feature(coroutines, stmt_expr_attributes)]
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 
 static mut A: [i32; 5] = [1, 2, 3, 4, 5];
 
diff --git a/tests/ui/drop/drop-struct-as-object.rs b/tests/ui/drop/drop-struct-as-object.rs
index 07c8950f1b2..46633bd7075 100644
--- a/tests/ui/drop/drop-struct-as-object.rs
+++ b/tests/ui/drop/drop-struct-as-object.rs
@@ -5,6 +5,9 @@
 // Test that destructor on a struct runs successfully after the struct
 // is boxed and converted to an object.
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 static mut value: usize = 0;
 
 struct Cat {
diff --git a/tests/ui/drop/drop-struct-as-object.stderr b/tests/ui/drop/drop-struct-as-object.stderr
index 10527c968ed..16f6d1110ba 100644
--- a/tests/ui/drop/drop-struct-as-object.stderr
+++ b/tests/ui/drop/drop-struct-as-object.stderr
@@ -1,5 +1,5 @@
 warning: method `get` is never used
-  --> $DIR/drop-struct-as-object.rs:15:8
+  --> $DIR/drop-struct-as-object.rs:18:8
    |
 LL | trait Dummy {
    |       ----- method in this trait
diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs
index 1fa68a2e738..6fee4520cbc 100644
--- a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs
+++ b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs
@@ -1,5 +1,7 @@
 //@ run-pass
 #![allow(non_upper_case_globals)]
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 
 // This test is ensuring that parameters are indeed dropped after
 // temporaries in a fn body.
@@ -91,7 +93,6 @@ pub mod d {
     pub fn max_width() -> u32 {
         unsafe {
             (mem::size_of_val(&trails) * 8) as u32
-            //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
         }
     }
 
diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr b/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr
deleted file mode 100644
index 9126e602391..00000000000
--- a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/issue-23338-ensure-param-drop-order.rs:93:31
-   |
-LL |             (mem::size_of_val(&trails) * 8) as u32
-   |                               ^^^^^^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |             (mem::size_of_val(addr_of!(trails)) * 8) as u32
-   |                               ~~~~~~~~~      +
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/drop/issue-23611-enum-swap-in-drop.rs b/tests/ui/drop/issue-23611-enum-swap-in-drop.rs
index 1afaff0f735..410b07b16fc 100644
--- a/tests/ui/drop/issue-23611-enum-swap-in-drop.rs
+++ b/tests/ui/drop/issue-23611-enum-swap-in-drop.rs
@@ -1,5 +1,7 @@
 //@ run-pass
 #![allow(non_upper_case_globals)]
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 
 // Issue 23611: this test is ensuring that, for an instance `X` of the
 // enum `E`, if you swap in a different variant during the execution
@@ -187,7 +189,6 @@ pub mod d {
     pub fn max_width() -> u32 {
         unsafe {
             (mem::size_of_val(&trails) * 8) as u32
-            //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
         }
     }
 
diff --git a/tests/ui/drop/issue-23611-enum-swap-in-drop.stderr b/tests/ui/drop/issue-23611-enum-swap-in-drop.stderr
deleted file mode 100644
index 6da87416802..00000000000
--- a/tests/ui/drop/issue-23611-enum-swap-in-drop.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/issue-23611-enum-swap-in-drop.rs:189:31
-   |
-LL |             (mem::size_of_val(&trails) * 8) as u32
-   |                               ^^^^^^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |             (mem::size_of_val(addr_of!(trails)) * 8) as u32
-   |                               ~~~~~~~~~      +
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/drop/issue-48962.rs b/tests/ui/drop/issue-48962.rs
index 428a6ca6cd2..98d3af49ac1 100644
--- a/tests/ui/drop/issue-48962.rs
+++ b/tests/ui/drop/issue-48962.rs
@@ -1,6 +1,9 @@
 //@ run-pass
 #![allow(unused_must_use)]
 // Test that we are able to reinitialize box with moved referent
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 static mut ORDER: [usize; 3] = [0, 0, 0];
 static mut INDEX: usize = 0;
 
diff --git a/tests/ui/drop/repeat-drop.rs b/tests/ui/drop/repeat-drop.rs
index b83bee8c1bf..7488d9113b0 100644
--- a/tests/ui/drop/repeat-drop.rs
+++ b/tests/ui/drop/repeat-drop.rs
@@ -3,6 +3,9 @@
 
 #![allow(dropping_references, dropping_copy_types)]
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 static mut CHECK: usize = 0;
 
 struct DropChecker(usize);
diff --git a/tests/ui/issues/issue-17302.rs b/tests/ui/drop/static-issue-17302.rs
index c499cc5281f..060f5564efd 100644
--- a/tests/ui/issues/issue-17302.rs
+++ b/tests/ui/drop/static-issue-17302.rs
@@ -1,5 +1,8 @@
 //@ run-pass
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 static mut DROPPED: [bool; 2] = [false, false];
 
 struct A(usize);
diff --git a/tests/ui/for-loop-while/cleanup-rvalue-during-if-and-while.rs b/tests/ui/for-loop-while/cleanup-rvalue-during-if-and-while.rs
index fef9f24d462..57e8b228649 100644
--- a/tests/ui/for-loop-while/cleanup-rvalue-during-if-and-while.rs
+++ b/tests/ui/for-loop-while/cleanup-rvalue-during-if-and-while.rs
@@ -2,6 +2,9 @@
 // This test verifies that temporaries created for `while`'s and `if`
 // conditions are dropped after the condition is evaluated.
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 struct Temporary;
 
 static mut DROPPED: isize = 0;
diff --git a/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.rs b/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.rs
index 500633edf12..a05d20ffbd2 100644
--- a/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.rs
+++ b/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.rs
@@ -2,6 +2,10 @@
 
 // The `foo` module attempts to maintains an invariant that each `S`
 // has a unique `u64` id.
+
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 use self::foo::S;
 mod foo {
     use std::cell::{UnsafeCell};
diff --git a/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr b/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr
index 692d98bc53c..8924800ef27 100644
--- a/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr
+++ b/tests/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr
@@ -1,5 +1,5 @@
 error[E0451]: field `secret_uid` of struct `S` is private
-  --> $DIR/functional-struct-update-respects-privacy.rs:28:49
+  --> $DIR/functional-struct-update-respects-privacy.rs:32:49
    |
 LL |     let s_2 = foo::S { b: format!("ess two"), ..s_1 }; // FRU ...
    |                                                 ^^^ field `secret_uid` is private
diff --git a/tests/ui/issues/issue-10734.rs b/tests/ui/issues/issue-10734.rs
index 8daa401748c..6d815aeca07 100644
--- a/tests/ui/issues/issue-10734.rs
+++ b/tests/ui/issues/issue-10734.rs
@@ -1,6 +1,9 @@
 //@ run-pass
 #![allow(non_upper_case_globals)]
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 static mut drop_count: usize = 0;
 
 struct Foo {
diff --git a/tests/ui/issues/issue-15858.rs b/tests/ui/issues/issue-15858.rs
index 2d4aac01fbe..27887d49e3e 100644
--- a/tests/ui/issues/issue-15858.rs
+++ b/tests/ui/issues/issue-15858.rs
@@ -1,4 +1,6 @@
 //@ run-pass
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
 static mut DROP_RAN: bool = false;
 
 trait Bar {
diff --git a/tests/ui/issues/issue-15858.stderr b/tests/ui/issues/issue-15858.stderr
index f36bcc21bd7..0c082cc0862 100644
--- a/tests/ui/issues/issue-15858.stderr
+++ b/tests/ui/issues/issue-15858.stderr
@@ -1,5 +1,5 @@
 warning: method `do_something` is never used
-  --> $DIR/issue-15858.rs:5:8
+  --> $DIR/issue-15858.rs:7:8
    |
 LL | trait Bar {
    |       --- method in this trait
diff --git a/tests/ui/issues/issue-16151.rs b/tests/ui/issues/issue-16151.rs
index 20a3b5a04da..b18108e0a8a 100644
--- a/tests/ui/issues/issue-16151.rs
+++ b/tests/ui/issues/issue-16151.rs
@@ -1,5 +1,8 @@
 //@ run-pass
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 use std::mem;
 
 static mut DROP_COUNT: usize = 0;
diff --git a/tests/ui/issues/issue-39367.rs b/tests/ui/issues/issue-39367.rs
index dd16d4da1bd..937d6c4b9e0 100644
--- a/tests/ui/issues/issue-39367.rs
+++ b/tests/ui/issues/issue-39367.rs
@@ -20,6 +20,7 @@ fn arena() -> &'static ArenaSet<Vec<u8>> {
 
             static mut ONCE: Once = Once::new();
             ONCE.call_once(|| {
+            //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
                 DATA = transmute
                     ::<Box<ArenaSet<Vec<u8>>>, *const ArenaSet<Vec<u8>>>
                     (Box::new(__static_ref_initialize()));
diff --git a/tests/ui/issues/issue-39367.stderr b/tests/ui/issues/issue-39367.stderr
new file mode 100644
index 00000000000..333c9f9634a
--- /dev/null
+++ b/tests/ui/issues/issue-39367.stderr
@@ -0,0 +1,17 @@
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/issue-39367.rs:22:13
+   |
+LL | /             ONCE.call_once(|| {
+LL | |
+LL | |                 DATA = transmute
+LL | |                     ::<Box<ArenaSet<Vec<u8>>>, *const ArenaSet<Vec<u8>>>
+LL | |                     (Box::new(__static_ref_initialize()));
+LL | |             });
+   | |______________^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+   = note: `#[warn(static_mut_refs)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/issues/issue-4734.rs b/tests/ui/issues/issue-4734.rs
index 938d7064789..58aa0179693 100644
--- a/tests/ui/issues/issue-4734.rs
+++ b/tests/ui/issues/issue-4734.rs
@@ -3,7 +3,8 @@
 // Ensures that destructors are run for expressions of the form "e;" where
 // `e` is a type which requires a destructor.
 
-
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 #![allow(path_statements)]
 
 struct A { n: isize }
diff --git a/tests/ui/issues/issue-54410.rs b/tests/ui/issues/issue-54410.rs
index 208be6f221c..e3e8ca985b9 100644
--- a/tests/ui/issues/issue-54410.rs
+++ b/tests/ui/issues/issue-54410.rs
@@ -5,5 +5,4 @@ extern "C" {
 
 fn main() {
     println!("{:p}", unsafe { &symbol });
-    //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
 }
diff --git a/tests/ui/issues/issue-54410.stderr b/tests/ui/issues/issue-54410.stderr
index 6cc5cd95e2f..97e5990750e 100644
--- a/tests/ui/issues/issue-54410.stderr
+++ b/tests/ui/issues/issue-54410.stderr
@@ -6,21 +6,6 @@ LL |     pub static mut symbol: [i8];
    |
    = help: the trait `Sized` is not implemented for `[i8]`
 
-warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/issue-54410.rs:7:31
-   |
-LL |     println!("{:p}", unsafe { &symbol });
-   |                               ^^^^^^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |     println!("{:p}", unsafe { addr_of!(symbol) });
-   |                               ~~~~~~~~~      +
-
-error: aborting due to 1 previous error; 1 warning emitted
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-6892.rs b/tests/ui/issues/issue-6892.rs
index aff00cf60ba..7d99aef4ac5 100644
--- a/tests/ui/issues/issue-6892.rs
+++ b/tests/ui/issues/issue-6892.rs
@@ -3,6 +3,8 @@
 // Ensures that destructors are run for expressions of the form "let _ = e;"
 // where `e` is a type which requires a destructor.
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 
 struct Foo;
 struct Bar { x: isize }
diff --git a/tests/ui/issues/issue-8860.rs b/tests/ui/issues/issue-8860.rs
index 67e9a276ae4..3af61576fe1 100644
--- a/tests/ui/issues/issue-8860.rs
+++ b/tests/ui/issues/issue-8860.rs
@@ -1,4 +1,6 @@
 //@ run-pass
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
 #![allow(dead_code)]
 
 static mut DROP: isize = 0;
diff --git a/tests/ui/link-section.rs b/tests/ui/link-section.rs
index 1a791b88ef9..a8de8c2e1e7 100644
--- a/tests/ui/link-section.rs
+++ b/tests/ui/link-section.rs
@@ -1,5 +1,8 @@
 //@ run-pass
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 #![allow(non_upper_case_globals)]
 #[cfg(not(target_vendor = "apple"))]
 #[link_section = ".moretext"]
diff --git a/tests/ui/linkage-attr/linkage-attr-mutable-static.rs b/tests/ui/linkage-attr/linkage-attr-mutable-static.rs
index ed11947f59e..cc93f61e28f 100644
--- a/tests/ui/linkage-attr/linkage-attr-mutable-static.rs
+++ b/tests/ui/linkage-attr/linkage-attr-mutable-static.rs
@@ -2,6 +2,8 @@
 //! them at runtime, so deny mutable statics with #[linkage].
 
 #![feature(linkage)]
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
 
 fn main() {
     #[rustfmt::skip]
diff --git a/tests/ui/linkage-attr/linkage-attr-mutable-static.stderr b/tests/ui/linkage-attr/linkage-attr-mutable-static.stderr
index ad999769047..50d5d812196 100644
--- a/tests/ui/linkage-attr/linkage-attr-mutable-static.stderr
+++ b/tests/ui/linkage-attr/linkage-attr-mutable-static.stderr
@@ -1,5 +1,5 @@
 error: extern mutable statics are not allowed with `#[linkage]`
-  --> $DIR/linkage-attr-mutable-static.rs:9:9
+  --> $DIR/linkage-attr-mutable-static.rs:11:9
    |
 LL |         #[linkage = "extern_weak"]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/static-mut-refs.e2021.stderr b/tests/ui/lint/static-mut-refs.e2021.stderr
new file mode 100644
index 00000000000..09f560652e7
--- /dev/null
+++ b/tests/ui/lint/static-mut-refs.e2021.stderr
@@ -0,0 +1,143 @@
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:39:18
+   |
+LL |         let _y = &X;
+   |                  ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let _y = &raw const X;
+   |                  ~~~~~~~~~~
+
+warning: creating a mutable reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:43:18
+   |
+LL |         let _y = &mut X;
+   |                  ^^^^^^ mutable reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
+help: use `&raw mut` instead to create a raw pointer
+   |
+LL |         let _y = &raw mut X;
+   |                  ~~~~~~~~
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:51:22
+   |
+LL |         let ref _a = X;
+   |                      ^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:55:25
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                         ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (&raw const X, &Y);
+   |                         ~~~~~~~~~~
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:55:29
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                             ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (&X, &raw const Y);
+   |                             ~~~~~~~~~~
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:61:13
+   |
+LL |         foo(&X);
+   |             ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         foo(&raw const X);
+   |             ~~~~~~~~~~
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:67:17
+   |
+LL |         let _ = Z.len();
+   |                 ^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:73:33
+   |
+LL |         let _ = format!("{:?}", Z);
+   |                                 ^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:77:18
+   |
+LL |         let _v = &A.value;
+   |                  ^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let _v = &raw const A.value;
+   |                  ~~~~~~~~~~
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:81:18
+   |
+LL |         let _s = &A.s.value;
+   |                  ^^^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let _s = &raw const A.s.value;
+   |                  ~~~~~~~~~~
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:85:22
+   |
+LL |         let ref _v = A.value;
+   |                      ^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a mutable reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:15:14
+   |
+LL |         &mut ($x.0)
+   |              ^^^^^^ mutable reference to mutable static
+...
+LL |         let _x = bar!(FOO);
+   |                  --------- in this macro invocation
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
+   = note: this warning originates in the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+warning: 12 warnings emitted
+
diff --git a/tests/ui/lint/static-mut-refs.e2024.stderr b/tests/ui/lint/static-mut-refs.e2024.stderr
new file mode 100644
index 00000000000..2d2a4f7afe0
--- /dev/null
+++ b/tests/ui/lint/static-mut-refs.e2024.stderr
@@ -0,0 +1,143 @@
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:39:18
+   |
+LL |         let _y = &X;
+   |                  ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+   = note: `#[deny(static_mut_refs)]` on by default
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let _y = &raw const X;
+   |                  ~~~~~~~~~~
+
+error: creating a mutable reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:43:18
+   |
+LL |         let _y = &mut X;
+   |                  ^^^^^^ mutable reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
+help: use `&raw mut` instead to create a raw pointer
+   |
+LL |         let _y = &raw mut X;
+   |                  ~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:51:22
+   |
+LL |         let ref _a = X;
+   |                      ^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:55:25
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                         ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (&raw const X, &Y);
+   |                         ~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:55:29
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                             ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (&X, &raw const Y);
+   |                             ~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:61:13
+   |
+LL |         foo(&X);
+   |             ^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         foo(&raw const X);
+   |             ~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:67:17
+   |
+LL |         let _ = Z.len();
+   |                 ^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:73:33
+   |
+LL |         let _ = format!("{:?}", Z);
+   |                                 ^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:77:18
+   |
+LL |         let _v = &A.value;
+   |                  ^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let _v = &raw const A.value;
+   |                  ~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:81:18
+   |
+LL |         let _s = &A.s.value;
+   |                  ^^^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
+   |
+LL |         let _s = &raw const A.s.value;
+   |                  ~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:85:22
+   |
+LL |         let ref _v = A.value;
+   |                      ^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+error: creating a mutable reference to mutable static is discouraged
+  --> $DIR/static-mut-refs.rs:15:14
+   |
+LL |         &mut ($x.0)
+   |              ^^^^^^ mutable reference to mutable static
+...
+LL |         let _x = bar!(FOO);
+   |                  --------- in this macro invocation
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
+   = note: this error originates in the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 12 previous errors
+
diff --git a/tests/ui/lint/static-mut-refs.rs b/tests/ui/lint/static-mut-refs.rs
new file mode 100644
index 00000000000..3d84d7dbf40
--- /dev/null
+++ b/tests/ui/lint/static-mut-refs.rs
@@ -0,0 +1,95 @@
+// Test `static_mut_refs` lint.
+
+//@ revisions: e2021 e2024
+
+//@ [e2021] edition:2021
+//@ [e2021] run-pass
+
+//@ [e2024] edition:2024
+//@ [e2024] compile-flags: -Zunstable-options
+
+static mut FOO: (u32, u32) = (1, 2);
+
+macro_rules! bar {
+    ($x:expr) => {
+        &mut ($x.0)
+        //[e2021]~^ WARN creating a mutable reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR creating a mutable reference to mutable static is discouraged [static_mut_refs]
+    };
+}
+
+static mut STATIC: i64 = 1;
+
+fn main() {
+    static mut X: i32 = 1;
+
+    static mut Y: i32 = 1;
+
+    struct TheStruct {
+        pub value: i32,
+    }
+    struct MyStruct {
+        pub value: i32,
+        pub s: TheStruct,
+    }
+
+    static mut A: MyStruct = MyStruct { value: 1, s: TheStruct { value: 2 } };
+
+    unsafe {
+        let _y = &X;
+        //[e2021]~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        let _y = &mut X;
+        //[e2021]~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR mutable reference to mutable static is discouraged [static_mut_refs]
+
+        let _z = &raw mut X;
+
+        let _p = &raw const X;
+
+        let ref _a = X;
+        //[e2021]~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        let (_b, _c) = (&X, &Y);
+        //[e2021]~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2021]~^^^ WARN shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        foo(&X);
+        //[e2021]~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        static mut Z: &[i32; 3] = &[0, 1, 2];
+
+        let _ = Z.len();
+        //[e2021]~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR creating a shared reference to mutable static is discouraged [static_mut_refs]
+
+        let _ = Z[0];
+
+        let _ = format!("{:?}", Z);
+        //[e2021]~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR creating a shared reference to mutable static is discouraged [static_mut_refs]
+
+        let _v = &A.value;
+        //[e2021]~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR creating a shared reference to mutable static is discouraged [static_mut_refs]
+
+        let _s = &A.s.value;
+        //[e2021]~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR creating a shared reference to mutable static is discouraged [static_mut_refs]
+
+        let ref _v = A.value;
+        //[e2021]~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^ ERROR creating a shared reference to mutable static is discouraged [static_mut_refs]
+
+        let _x = bar!(FOO);
+
+        STATIC += 1;
+    }
+}
+
+fn foo<'a>(_x: &'a i32) {}
diff --git a/tests/ui/lto/lto-still-runs-thread-dtors.rs b/tests/ui/lto/lto-still-runs-thread-dtors.rs
index 504923a93c2..900368496eb 100644
--- a/tests/ui/lto/lto-still-runs-thread-dtors.rs
+++ b/tests/ui/lto/lto-still-runs-thread-dtors.rs
@@ -3,6 +3,9 @@
 //@ no-prefer-dynamic
 //@ needs-threads
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 use std::thread;
 
 static mut HIT: usize = 0;
diff --git a/tests/ui/methods/method-self-arg-trait.rs b/tests/ui/methods/method-self-arg-trait.rs
index 63594380753..ccffe02328b 100644
--- a/tests/ui/methods/method-self-arg-trait.rs
+++ b/tests/ui/methods/method-self-arg-trait.rs
@@ -1,6 +1,9 @@
 //@ run-pass
 // Test method calls with self as an argument
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 static mut COUNT: u64 = 1;
 
 #[derive(Copy, Clone)]
diff --git a/tests/ui/methods/method-self-arg.rs b/tests/ui/methods/method-self-arg.rs
index d26b9663fd0..2e058ee1077 100644
--- a/tests/ui/methods/method-self-arg.rs
+++ b/tests/ui/methods/method-self-arg.rs
@@ -1,6 +1,9 @@
 //@ run-pass
 // Test method calls with self as an argument
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 static mut COUNT: usize = 1;
 
 #[derive(Copy, Clone)]
diff --git a/tests/ui/mir/mir_early_return_scope.rs b/tests/ui/mir/mir_early_return_scope.rs
index 6dc3f8bc39b..42f1cc50d15 100644
--- a/tests/ui/mir/mir_early_return_scope.rs
+++ b/tests/ui/mir/mir_early_return_scope.rs
@@ -1,5 +1,7 @@
 //@ run-pass
 #![allow(unused_variables)]
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
 static mut DROP: bool = false;
 
 struct ConnWrap(Conn);
diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr
index a6d4f9a2a5c..1f01d3e8260 100644
--- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr
+++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr
@@ -4,14 +4,13 @@ warning: creating a mutable reference to mutable static is discouraged
 LL |         S1 { a: unsafe { &mut X1 } }
    |                          ^^^^^^^ mutable reference to mutable static
    |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
    = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of_mut!` instead to create a raw pointer
+help: use `&raw mut` instead to create a raw pointer
    |
-LL |         S1 { a: unsafe { addr_of_mut!(X1) } }
-   |                          ~~~~~~~~~~~~~  +
+LL |         S1 { a: unsafe { &raw mut X1 } }
+   |                          ~~~~~~~~
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/nll/issue-69114-static-mut-ty.rs b/tests/ui/nll/issue-69114-static-mut-ty.rs
index ce37da053e3..95c787488c0 100644
--- a/tests/ui/nll/issue-69114-static-mut-ty.rs
+++ b/tests/ui/nll/issue-69114-static-mut-ty.rs
@@ -1,5 +1,8 @@
 // Check that borrowck ensures that `static mut` items have the expected type.
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 static FOO: u8 = 42;
 static mut BAR: &'static u8 = &FOO;
 static mut BAR_ELIDED: &u8 = &FOO;
diff --git a/tests/ui/nll/issue-69114-static-mut-ty.stderr b/tests/ui/nll/issue-69114-static-mut-ty.stderr
index 1b41230d7ba..eebfdee2896 100644
--- a/tests/ui/nll/issue-69114-static-mut-ty.stderr
+++ b/tests/ui/nll/issue-69114-static-mut-ty.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `n` does not live long enough
-  --> $DIR/issue-69114-static-mut-ty.rs:19:15
+  --> $DIR/issue-69114-static-mut-ty.rs:22:15
    |
 LL |     let n = 42;
    |         - binding `n` declared here
@@ -14,7 +14,7 @@ LL | }
    | - `n` dropped here while still borrowed
 
 error[E0597]: `n` does not live long enough
-  --> $DIR/issue-69114-static-mut-ty.rs:27:22
+  --> $DIR/issue-69114-static-mut-ty.rs:30:22
    |
 LL |     let n = 42;
    |         - binding `n` declared here
diff --git a/tests/ui/numbers-arithmetic/shift-near-oflo.rs b/tests/ui/numbers-arithmetic/shift-near-oflo.rs
index 5cca31af0e3..97227bd843f 100644
--- a/tests/ui/numbers-arithmetic/shift-near-oflo.rs
+++ b/tests/ui/numbers-arithmetic/shift-near-oflo.rs
@@ -1,6 +1,9 @@
 //@ run-pass
 //@ compile-flags: -C debug-assertions
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 // Check that we do *not* overflow on a number of edge cases.
 // (compare with test/run-fail/overflowing-{lsh,rsh}*.rs)
 
diff --git a/tests/ui/self/where-for-self.rs b/tests/ui/self/where-for-self.rs
index 9b4e8325664..d31bb1f22c4 100644
--- a/tests/ui/self/where-for-self.rs
+++ b/tests/ui/self/where-for-self.rs
@@ -2,6 +2,8 @@
 // Test that we can quantify lifetimes outside a constraint (i.e., including
 // the self type) in a where clause.
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
 
 static mut COUNT: u32 = 1;
 
diff --git a/tests/ui/static/reference-to-mut-static-safe.e2021.stderr b/tests/ui/static/reference-to-mut-static-safe.e2021.stderr
deleted file mode 100644
index 9fdfc00dfcd..00000000000
--- a/tests/ui/static/reference-to-mut-static-safe.e2021.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/reference-to-mut-static-safe.rs:9:14
-   |
-LL |     let _x = &X;
-   |              ^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |     let _x = addr_of!(X);
-   |              ~~~~~~~~~ +
-
-error[E0133]: use of mutable static is unsafe and requires unsafe function or block
-  --> $DIR/reference-to-mut-static-safe.rs:9:15
-   |
-LL |     let _x = &X;
-   |               ^ use of mutable static
-   |
-   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
-
-error: aborting due to 1 previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/static/reference-to-mut-static-safe.e2024.stderr b/tests/ui/static/reference-to-mut-static-safe.e2024.stderr
deleted file mode 100644
index b3e0c84d1d8..00000000000
--- a/tests/ui/static/reference-to-mut-static-safe.e2024.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static-safe.rs:9:14
-   |
-LL |     let _x = &X;
-   |              ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |     let _x = addr_of!(X);
-   |              ~~~~~~~~~ +
-
-error[E0133]: use of mutable static is unsafe and requires unsafe block
-  --> $DIR/reference-to-mut-static-safe.rs:9:15
-   |
-LL |     let _x = &X;
-   |               ^ use of mutable static
-   |
-   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0133, E0796.
-For more information about an error, try `rustc --explain E0133`.
diff --git a/tests/ui/static/reference-to-mut-static-safe.rs b/tests/ui/static/reference-to-mut-static-safe.rs
deleted file mode 100644
index 98afdadf4d2..00000000000
--- a/tests/ui/static/reference-to-mut-static-safe.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ revisions: e2021 e2024
-
-//@ [e2021] edition:2021
-//@ [e2024] compile-flags: --edition 2024 -Z unstable-options
-
-fn main() {
-    static mut X: i32 = 1;
-
-    let _x = &X;
-    //[e2024]~^ creating a shared reference to a mutable static [E0796]
-    //~^^ use of mutable static is unsafe and requires unsafe
-    //[e2021]~^^^ shared reference to mutable static is discouraged [static_mut_refs]
-}
diff --git a/tests/ui/static/reference-to-mut-static-unsafe-fn.rs b/tests/ui/static/reference-to-mut-static-unsafe-fn.rs
deleted file mode 100644
index d63fd5460d8..00000000000
--- a/tests/ui/static/reference-to-mut-static-unsafe-fn.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-//@ compile-flags: --edition 2024 -Z unstable-options
-
-fn main() {}
-
-unsafe fn _foo() {
-    unsafe {
-        static mut X: i32 = 1;
-        static mut Y: i32 = 1;
-
-        let _y = &X;
-        //~^ ERROR creating a shared reference to a mutable static [E0796]
-
-        let ref _a = X;
-        //~^ ERROR creating a shared reference to a mutable static [E0796]
-
-        let ref mut _a = X;
-        //~^ ERROR creating a mutable reference to a mutable static [E0796]
-
-        let (_b, _c) = (&X, &mut Y);
-        //~^ ERROR creating a shared reference to a mutable static [E0796]
-        //~^^ ERROR creating a mutable reference to a mutable static [E0796]
-
-        foo(&X);
-        //~^ ERROR creating a shared reference to a mutable static [E0796]
-    }
-}
-
-fn foo<'a>(_x: &'a i32) {}
diff --git a/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr b/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr
deleted file mode 100644
index ca9cfbf7ac7..00000000000
--- a/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr
+++ /dev/null
@@ -1,75 +0,0 @@
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static-unsafe-fn.rs:10:18
-   |
-LL |         let _y = &X;
-   |                  ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let _y = addr_of!(X);
-   |                  ~~~~~~~~~ +
-
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static-unsafe-fn.rs:13:22
-   |
-LL |         let ref _a = X;
-   |                      ^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let ref _a = addr_of!(X);
-   |                      +++++++++ +
-
-error[E0796]: creating a mutable reference to a mutable static
-  --> $DIR/reference-to-mut-static-unsafe-fn.rs:16:26
-   |
-LL |         let ref mut _a = X;
-   |                          ^ mutable reference to mutable static
-   |
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |         let ref mut _a = addr_of_mut!(X);
-   |                          +++++++++++++ +
-
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static-unsafe-fn.rs:19:25
-   |
-LL |         let (_b, _c) = (&X, &mut Y);
-   |                         ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let (_b, _c) = (addr_of!(X), &mut Y);
-   |                         ~~~~~~~~~ +
-
-error[E0796]: creating a mutable reference to a mutable static
-  --> $DIR/reference-to-mut-static-unsafe-fn.rs:19:29
-   |
-LL |         let (_b, _c) = (&X, &mut Y);
-   |                             ^^^^^^ mutable reference to mutable static
-   |
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |         let (_b, _c) = (&X, addr_of_mut!(Y));
-   |                             ~~~~~~~~~~~~~ +
-
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static-unsafe-fn.rs:23:13
-   |
-LL |         foo(&X);
-   |             ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         foo(addr_of!(X));
-   |             ~~~~~~~~~ +
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0796`.
diff --git a/tests/ui/static/reference-to-mut-static.e2021.stderr b/tests/ui/static/reference-to-mut-static.e2021.stderr
deleted file mode 100644
index 667d7602f34..00000000000
--- a/tests/ui/static/reference-to-mut-static.e2021.stderr
+++ /dev/null
@@ -1,91 +0,0 @@
-error: creating a shared reference to mutable static is discouraged
-  --> $DIR/reference-to-mut-static.rs:16:18
-   |
-LL |         let _y = &X;
-   |                  ^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-note: the lint level is defined here
-  --> $DIR/reference-to-mut-static.rs:6:9
-   |
-LL | #![deny(static_mut_refs)]
-   |         ^^^^^^^^^^^^^^^
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let _y = addr_of!(X);
-   |                  ~~~~~~~~~ +
-
-error: creating a mutable reference to mutable static is discouraged
-  --> $DIR/reference-to-mut-static.rs:20:18
-   |
-LL |         let _y = &mut X;
-   |                  ^^^^^^ mutable reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |         let _y = addr_of_mut!(X);
-   |                  ~~~~~~~~~~~~~ +
-
-error: creating a shared reference to mutable static is discouraged
-  --> $DIR/reference-to-mut-static.rs:28:22
-   |
-LL |         let ref _a = X;
-   |                      ^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let ref _a = addr_of!(X);
-   |                      +++++++++ +
-
-error: creating a shared reference to mutable static is discouraged
-  --> $DIR/reference-to-mut-static.rs:32:25
-   |
-LL |         let (_b, _c) = (&X, &Y);
-   |                         ^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let (_b, _c) = (addr_of!(X), &Y);
-   |                         ~~~~~~~~~ +
-
-error: creating a shared reference to mutable static is discouraged
-  --> $DIR/reference-to-mut-static.rs:32:29
-   |
-LL |         let (_b, _c) = (&X, &Y);
-   |                             ^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let (_b, _c) = (&X, addr_of!(Y));
-   |                             ~~~~~~~~~ +
-
-error: creating a shared reference to mutable static is discouraged
-  --> $DIR/reference-to-mut-static.rs:38:13
-   |
-LL |         foo(&X);
-   |             ^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         foo(addr_of!(X));
-   |             ~~~~~~~~~ +
-
-error: aborting due to 6 previous errors
-
diff --git a/tests/ui/static/reference-to-mut-static.e2024.stderr b/tests/ui/static/reference-to-mut-static.e2024.stderr
deleted file mode 100644
index e77f4355466..00000000000
--- a/tests/ui/static/reference-to-mut-static.e2024.stderr
+++ /dev/null
@@ -1,75 +0,0 @@
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static.rs:16:18
-   |
-LL |         let _y = &X;
-   |                  ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let _y = addr_of!(X);
-   |                  ~~~~~~~~~ +
-
-error[E0796]: creating a mutable reference to a mutable static
-  --> $DIR/reference-to-mut-static.rs:20:18
-   |
-LL |         let _y = &mut X;
-   |                  ^^^^^^ mutable reference to mutable static
-   |
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |         let _y = addr_of_mut!(X);
-   |                  ~~~~~~~~~~~~~ +
-
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static.rs:28:22
-   |
-LL |         let ref _a = X;
-   |                      ^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let ref _a = addr_of!(X);
-   |                      +++++++++ +
-
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static.rs:32:25
-   |
-LL |         let (_b, _c) = (&X, &Y);
-   |                         ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let (_b, _c) = (addr_of!(X), &Y);
-   |                         ~~~~~~~~~ +
-
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static.rs:32:29
-   |
-LL |         let (_b, _c) = (&X, &Y);
-   |                             ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         let (_b, _c) = (&X, addr_of!(Y));
-   |                             ~~~~~~~~~ +
-
-error[E0796]: creating a shared reference to a mutable static
-  --> $DIR/reference-to-mut-static.rs:38:13
-   |
-LL |         foo(&X);
-   |             ^^ shared reference to mutable static
-   |
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |         foo(addr_of!(X));
-   |             ~~~~~~~~~ +
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0796`.
diff --git a/tests/ui/static/reference-to-mut-static.rs b/tests/ui/static/reference-to-mut-static.rs
deleted file mode 100644
index af2cab7dd87..00000000000
--- a/tests/ui/static/reference-to-mut-static.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-//@ revisions: e2021 e2024
-
-//@ [e2021] edition:2021
-//@ [e2024] compile-flags: --edition 2024 -Z unstable-options
-
-#![deny(static_mut_refs)]
-
-use std::ptr::{addr_of, addr_of_mut};
-
-fn main() {
-    static mut X: i32 = 1;
-
-    static mut Y: i32 = 1;
-
-    unsafe {
-        let _y = &X;
-        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
-        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
-
-        let _y = &mut X;
-        //[e2024]~^ ERROR creating a mutable reference to a mutable static [E0796]
-        //[e2021]~^^ ERROR mutable reference to mutable static is discouraged [static_mut_refs]
-
-        let _z = addr_of_mut!(X);
-
-        let _p = addr_of!(X);
-
-        let ref _a = X;
-        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
-        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
-
-        let (_b, _c) = (&X, &Y);
-        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
-        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
-        //[e2024]~^^^ ERROR creating a shared reference to a mutable static [E0796]
-        //[e2021]~^^^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
-
-        foo(&X);
-        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
-        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
-
-        static mut Z: &[i32; 3] = &[0, 1, 2];
-
-        let _ = Z.len();
-        let _ = Z[0];
-        let _ = format!("{:?}", Z);
-    }
-}
-
-fn foo<'a>(_x: &'a i32) {}
diff --git a/tests/ui/static/safe-extern-statics-mut.rs b/tests/ui/static/safe-extern-statics-mut.rs
index 05a1bee8891..4dfcd41b73c 100644
--- a/tests/ui/static/safe-extern-statics-mut.rs
+++ b/tests/ui/static/safe-extern-statics-mut.rs
@@ -10,8 +10,6 @@ extern "C" {
 fn main() {
     let b = B; //~ ERROR use of mutable static is unsafe
     let rb = &B; //~ ERROR use of mutable static is unsafe
-    //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
     let xb = XB; //~ ERROR use of mutable static is unsafe
     let xrb = &XB; //~ ERROR use of mutable static is unsafe
-    //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
 }
diff --git a/tests/ui/static/safe-extern-statics-mut.stderr b/tests/ui/static/safe-extern-statics-mut.stderr
index 7705a897e27..e390625f20a 100644
--- a/tests/ui/static/safe-extern-statics-mut.stderr
+++ b/tests/ui/static/safe-extern-statics-mut.stderr
@@ -1,32 +1,3 @@
-warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/safe-extern-statics-mut.rs:12:14
-   |
-LL |     let rb = &B;
-   |              ^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |     let rb = addr_of!(B);
-   |              ~~~~~~~~~ +
-
-warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/safe-extern-statics-mut.rs:15:15
-   |
-LL |     let xrb = &XB;
-   |               ^^^ shared reference to mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-help: use `addr_of!` instead to create a raw pointer
-   |
-LL |     let xrb = addr_of!(XB);
-   |               ~~~~~~~~~  +
-
 error[E0133]: use of mutable static is unsafe and requires unsafe function or block
   --> $DIR/safe-extern-statics-mut.rs:11:13
    |
@@ -44,7 +15,7 @@ LL |     let rb = &B;
    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
 
 error[E0133]: use of mutable static is unsafe and requires unsafe function or block
-  --> $DIR/safe-extern-statics-mut.rs:14:14
+  --> $DIR/safe-extern-statics-mut.rs:13:14
    |
 LL |     let xb = XB;
    |              ^^ use of mutable static
@@ -52,13 +23,13 @@ LL |     let xb = XB;
    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
 
 error[E0133]: use of mutable static is unsafe and requires unsafe function or block
-  --> $DIR/safe-extern-statics-mut.rs:15:16
+  --> $DIR/safe-extern-statics-mut.rs:14:16
    |
 LL |     let xrb = &XB;
    |                ^^ use of mutable static
    |
    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
 
-error: aborting due to 4 previous errors; 2 warnings emitted
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/statics/issue-15261.stderr b/tests/ui/statics/issue-15261.stderr
index 6035eef5b71..417dbae9db1 100644
--- a/tests/ui/statics/issue-15261.stderr
+++ b/tests/ui/statics/issue-15261.stderr
@@ -4,14 +4,13 @@ warning: creating a shared reference to mutable static is discouraged
 LL | static n: &'static usize = unsafe { &n_mut };
    |                                     ^^^^^^ shared reference to mutable static
    |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
    = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
+help: use `&raw const` instead to create a raw pointer
    |
-LL | static n: &'static usize = unsafe { addr_of!(n_mut) };
-   |                                     ~~~~~~~~~     +
+LL | static n: &'static usize = unsafe { &raw const n_mut };
+   |                                     ~~~~~~~~~~
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/statics/static-mut-xc.rs b/tests/ui/statics/static-mut-xc.rs
index a772d4151f7..c23cc822ce7 100644
--- a/tests/ui/statics/static-mut-xc.rs
+++ b/tests/ui/statics/static-mut-xc.rs
@@ -17,14 +17,19 @@ fn static_bound_set(a: &'static mut isize) {
 
 unsafe fn run() {
     assert_eq!(static_mut_xc::a, 3);
+    //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
     static_mut_xc::a = 4;
     assert_eq!(static_mut_xc::a, 4);
+    //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
     static_mut_xc::a += 1;
     assert_eq!(static_mut_xc::a, 5);
+    //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
     static_mut_xc::a *= 3;
     assert_eq!(static_mut_xc::a, 15);
+    //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
     static_mut_xc::a = -3;
     assert_eq!(static_mut_xc::a, -3);
+    //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
     static_bound(&static_mut_xc::a);
     //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
     static_bound_set(&mut static_mut_xc::a);
diff --git a/tests/ui/statics/static-mut-xc.stderr b/tests/ui/statics/static-mut-xc.stderr
index 9751f754332..176deb518fc 100644
--- a/tests/ui/statics/static-mut-xc.stderr
+++ b/tests/ui/statics/static-mut-xc.stderr
@@ -1,31 +1,74 @@
 warning: creating a shared reference to mutable static is discouraged
-  --> $DIR/static-mut-xc.rs:28:18
+  --> $DIR/static-mut-xc.rs:19:16
+   |
+LL |     assert_eq!(static_mut_xc::a, 3);
+   |                ^^^^^^^^^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+   = note: `#[warn(static_mut_refs)]` on by default
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-xc.rs:22:16
+   |
+LL |     assert_eq!(static_mut_xc::a, 4);
+   |                ^^^^^^^^^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-xc.rs:25:16
+   |
+LL |     assert_eq!(static_mut_xc::a, 5);
+   |                ^^^^^^^^^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-xc.rs:28:16
+   |
+LL |     assert_eq!(static_mut_xc::a, 15);
+   |                ^^^^^^^^^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-xc.rs:31:16
+   |
+LL |     assert_eq!(static_mut_xc::a, -3);
+   |                ^^^^^^^^^^^^^^^^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-mut-xc.rs:33:18
    |
 LL |     static_bound(&static_mut_xc::a);
    |                  ^^^^^^^^^^^^^^^^^ shared reference to mutable static
    |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
-   = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+help: use `&raw const` instead to create a raw pointer
    |
-LL |     static_bound(addr_of!(static_mut_xc::a));
-   |                  ~~~~~~~~~                +
+LL |     static_bound(&raw const static_mut_xc::a);
+   |                  ~~~~~~~~~~
 
 warning: creating a mutable reference to mutable static is discouraged
-  --> $DIR/static-mut-xc.rs:30:22
+  --> $DIR/static-mut-xc.rs:35:22
    |
 LL |     static_bound_set(&mut static_mut_xc::a);
    |                      ^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static
    |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
-help: use `addr_of_mut!` instead to create a raw pointer
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
+help: use `&raw mut` instead to create a raw pointer
    |
-LL |     static_bound_set(addr_of_mut!(static_mut_xc::a));
-   |                      ~~~~~~~~~~~~~                +
+LL |     static_bound_set(&raw mut static_mut_xc::a);
+   |                      ~~~~~~~~
 
-warning: 2 warnings emitted
+warning: 7 warnings emitted
 
diff --git a/tests/ui/statics/static-recursive.rs b/tests/ui/statics/static-recursive.rs
index 29b80818b7d..da23b54d1fc 100644
--- a/tests/ui/statics/static-recursive.rs
+++ b/tests/ui/statics/static-recursive.rs
@@ -17,6 +17,7 @@ static L3: StaticDoubleLinked = StaticDoubleLinked { prev: &L2, next: &L1, data:
 pub fn main() {
     unsafe {
         assert_eq!(S, *(S as *const *const u8));
+        //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
     }
 
     let mut test_vec = Vec::new();
diff --git a/tests/ui/statics/static-recursive.stderr b/tests/ui/statics/static-recursive.stderr
index a7a1a1610af..f2dd5b8a6cf 100644
--- a/tests/ui/statics/static-recursive.stderr
+++ b/tests/ui/statics/static-recursive.stderr
@@ -4,14 +4,22 @@ warning: creating a shared reference to mutable static is discouraged
 LL | static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 };
    |                                    ^^ shared reference to mutable static
    |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: this will be a hard error in the 2024 edition
-   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
    = note: `#[warn(static_mut_refs)]` on by default
-help: use `addr_of!` instead to create a raw pointer
+help: use `&raw const` instead to create a raw pointer
    |
-LL | static mut S: *const u8 = unsafe { addr_of!(S) as *const *const u8 as *const u8 };
-   |                                    ~~~~~~~~~ +
+LL | static mut S: *const u8 = unsafe { &raw const S as *const *const u8 as *const u8 };
+   |                                    ~~~~~~~~~~
 
-warning: 1 warning emitted
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/static-recursive.rs:19:20
+   |
+LL |         assert_eq!(S, *(S as *const *const u8));
+   |                    ^ shared reference to mutable static
+   |
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
+   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
+
+warning: 2 warnings emitted
 
diff --git a/tests/ui/thread-local/thread-local-issue-37508.rs b/tests/ui/thread-local/thread-local-issue-37508.rs
index db430a3229c..34c39453451 100644
--- a/tests/ui/thread-local/thread-local-issue-37508.rs
+++ b/tests/ui/thread-local/thread-local-issue-37508.rs
@@ -4,6 +4,9 @@
 //
 // Regression test for issue #37508
 
+// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
+#![allow(static_mut_refs)]
+
 #![no_main]
 #![no_std]
 #![feature(thread_local, lang_items)]
diff --git a/tests/ui/traits/impl.rs b/tests/ui/traits/impl.rs
index 348096f37f7..b45935fd86a 100644
--- a/tests/ui/traits/impl.rs
+++ b/tests/ui/traits/impl.rs
@@ -3,6 +3,9 @@
 
 //@ aux-build:traitimpl.rs
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 extern crate traitimpl;
 use traitimpl::Bar;
 
diff --git a/tests/ui/traits/impl.stderr b/tests/ui/traits/impl.stderr
index 98b6fb03d83..9216a33c1d0 100644
--- a/tests/ui/traits/impl.stderr
+++ b/tests/ui/traits/impl.stderr
@@ -1,5 +1,5 @@
 warning: method `t` is never used
-  --> $DIR/impl.rs:12:8
+  --> $DIR/impl.rs:15:8
    |
 LL | trait T {
    |       - method in this trait
diff --git a/tests/ui/union/union-drop-assign.rs b/tests/ui/union/union-drop-assign.rs
index e9165fddc51..451fb14eddf 100644
--- a/tests/ui/union/union-drop-assign.rs
+++ b/tests/ui/union/union-drop-assign.rs
@@ -3,6 +3,9 @@
 
 // Drop works for union itself.
 
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
+
 use std::mem::ManuallyDrop;
 
 struct S;
diff --git a/tests/ui/union/union-drop.rs b/tests/ui/union/union-drop.rs
index e467eda2935..6f6d5c14165 100644
--- a/tests/ui/union/union-drop.rs
+++ b/tests/ui/union/union-drop.rs
@@ -2,6 +2,8 @@
 
 #![allow(dead_code)]
 #![allow(unused_variables)]
+// FIXME(static_mut_refs): this could use an atomic
+#![allow(static_mut_refs)]
 
 // Drop works for union itself.