about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/consts/const_refs_to_static_fail_invalid.rs2
-rw-r--r--tests/ui/consts/const_refs_to_static_fail_invalid.stderr27
-rw-r--r--tests/ui/consts/issue-17718-const-bad-values.rs3
-rw-r--r--tests/ui/consts/issue-17718-const-bad-values.stderr21
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr21
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr21
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs2
-rw-r--r--tests/ui/consts/static_mut_containing_mut_ref.rs2
-rw-r--r--tests/ui/consts/static_mut_containing_mut_ref.stderr17
-rw-r--r--tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr17
-rw-r--r--tests/ui/consts/static_mut_containing_mut_ref2.rs4
-rw-r--r--tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr17
-rw-r--r--tests/ui/thread-local/thread-local-static.rs4
-rw-r--r--tests/ui/thread-local/thread-local-static.stderr25
-rw-r--r--tests/ui/thread-local/thread-local-static.thir.stderr59
15 files changed, 30 insertions, 212 deletions
diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.rs b/tests/ui/consts/const_refs_to_static_fail_invalid.rs
index bf52f884209..665b876c43e 100644
--- a/tests/ui/consts/const_refs_to_static_fail_invalid.rs
+++ b/tests/ui/consts/const_refs_to_static_fail_invalid.rs
@@ -1,6 +1,7 @@
 // normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 // normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
 #![feature(const_refs_to_static)]
+#![allow(static_mut_ref)]
 
 fn invalid() {
     static S: i8 = 10;
@@ -38,7 +39,6 @@ fn mutable() {
     const C: &i32 = unsafe { &S_MUT };
     //~^ERROR: undefined behavior
     //~| encountered reference to mutable memory
-    //~| WARN shared reference of mutable static is discouraged
 
     // This *must not build*, the constant we are matching against
     // could change its value!
diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
index 35051557b61..082f8532444 100644
--- a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
+++ b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
@@ -1,20 +1,5 @@
-warning: shared reference of mutable static is discouraged
-  --> $DIR/const_refs_to_static_fail_invalid.rs:38:30
-   |
-LL |     const C: &i32 = unsafe { &S_MUT };
-   |                              ^^^^^^ shared reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
-   |
-LL |     const C: &i32 = unsafe { addr_of!(S_MUT) };
-   |                              ~~~~~~~~~~~~~~~
-
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refs_to_static_fail_invalid.rs:8:5
+  --> $DIR/const_refs_to_static_fail_invalid.rs:9:5
    |
 LL |     const C: &bool = unsafe { std::mem::transmute(&S) };
    |     ^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered 0x0a, but expected a boolean
@@ -25,13 +10,13 @@ LL |     const C: &bool = unsafe { std::mem::transmute(&S) };
            }
 
 error: could not evaluate constant pattern
-  --> $DIR/const_refs_to_static_fail_invalid.rs:14:9
+  --> $DIR/const_refs_to_static_fail_invalid.rs:15:9
    |
 LL |         C => {}
    |         ^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refs_to_static_fail_invalid.rs:24:5
+  --> $DIR/const_refs_to_static_fail_invalid.rs:25:5
    |
 LL |     const C: &i8 = unsafe { &S };
    |     ^^^^^^^^^^^^ constructing invalid value: encountered reference to `extern` static in `const`
@@ -42,13 +27,13 @@ LL |     const C: &i8 = unsafe { &S };
            }
 
 error: could not evaluate constant pattern
-  --> $DIR/const_refs_to_static_fail_invalid.rs:30:9
+  --> $DIR/const_refs_to_static_fail_invalid.rs:31:9
    |
 LL |         C => {}
    |         ^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refs_to_static_fail_invalid.rs:38:5
+  --> $DIR/const_refs_to_static_fail_invalid.rs:39:5
    |
 LL |     const C: &i32 = unsafe { &S_MUT };
    |     ^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -64,6 +49,6 @@ error: could not evaluate constant pattern
 LL |         C => {},
    |         ^
 
-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 E0080`.
diff --git a/tests/ui/consts/issue-17718-const-bad-values.rs b/tests/ui/consts/issue-17718-const-bad-values.rs
index 2b593a192ee..0299bfef1b4 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.rs
+++ b/tests/ui/consts/issue-17718-const-bad-values.rs
@@ -1,9 +1,10 @@
+#![allow(static_mut_ref)]
+
 const C1: &'static mut [usize] = &mut [];
 //~^ ERROR: mutable references are not allowed
 
 static mut S: usize = 3;
 const C2: &'static mut usize = unsafe { &mut S };
 //~^ ERROR: referencing statics in constants
-//~| WARN mutable reference of mutable static is discouraged [static_mut_ref]
 
 fn main() {}
diff --git a/tests/ui/consts/issue-17718-const-bad-values.stderr b/tests/ui/consts/issue-17718-const-bad-values.stderr
index 92bab1ab53e..57fcb1c7e9a 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.stderr
+++ b/tests/ui/consts/issue-17718-const-bad-values.stderr
@@ -1,26 +1,11 @@
-warning: mutable reference of mutable static is discouraged
-  --> $DIR/issue-17718-const-bad-values.rs:5:41
-   |
-LL | const C2: &'static mut usize = unsafe { &mut S };
-   |                                         ^^^^^^ mutable reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
-   |
-LL | const C2: &'static mut usize = unsafe { addr_of_mut!(S) };
-   |                                         ~~~~~~~~~~~~~~~
-
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/issue-17718-const-bad-values.rs:1:34
+  --> $DIR/issue-17718-const-bad-values.rs:3:34
    |
 LL | const C1: &'static mut [usize] = &mut [];
    |                                  ^^^^^^^
 
 error[E0658]: referencing statics in constants is unstable
-  --> $DIR/issue-17718-const-bad-values.rs:5:46
+  --> $DIR/issue-17718-const-bad-values.rs:7:46
    |
 LL | const C2: &'static mut usize = unsafe { &mut S };
    |                                              ^
@@ -31,7 +16,7 @@ LL | const C2: &'static mut usize = unsafe { &mut S };
    = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
    = help: to fix this, the value can be extracted to a `const` and then used.
 
-error: aborting due to 2 previous errors; 1 warning emitted
+error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0658, E0764.
 For more information about an error, try `rustc --explain E0658`.
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
index e280fe622ec..db7e8b6847a 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
@@ -1,20 +1,5 @@
-warning: shared reference of mutable static is discouraged
-  --> $DIR/const_refers_to_static_cross_crate.rs:12:14
-   |
-LL |     unsafe { &static_cross_crate::ZERO }
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
-   |
-LL |     unsafe { addr_of!(static_cross_crate::ZERO) }
-   |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static_cross_crate.rs:10:1
+  --> $DIR/const_refers_to_static_cross_crate.rs:11:1
    |
 LL | const SLICE_MUT: &[u8; 1] = {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -79,7 +64,7 @@ LL |         U8_MUT3 => true,
 warning: skipping const checks
    |
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:12:15
+  --> $DIR/const_refers_to_static_cross_crate.rs:13:15
    |
 LL |     unsafe { &static_cross_crate::ZERO }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -99,6 +84,6 @@ help: skipping check for `const_refs_to_static` feature
 LL |         match static_cross_crate::OPT_ZERO {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 8 previous errors; 2 warnings emitted
+error: aborting due to 8 previous errors; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
index 9bca60485c0..200faf35587 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
@@ -1,20 +1,5 @@
-warning: shared reference of mutable static is discouraged
-  --> $DIR/const_refers_to_static_cross_crate.rs:12:14
-   |
-LL |     unsafe { &static_cross_crate::ZERO }
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
-   |
-LL |     unsafe { addr_of!(static_cross_crate::ZERO) }
-   |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static_cross_crate.rs:10:1
+  --> $DIR/const_refers_to_static_cross_crate.rs:11:1
    |
 LL | const SLICE_MUT: &[u8; 1] = {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -79,7 +64,7 @@ LL |         U8_MUT3 => true,
 warning: skipping const checks
    |
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:12:15
+  --> $DIR/const_refers_to_static_cross_crate.rs:13:15
    |
 LL |     unsafe { &static_cross_crate::ZERO }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -99,6 +84,6 @@ help: skipping check for `const_refs_to_static` feature
 LL |         match static_cross_crate::OPT_ZERO {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 8 previous errors; 2 warnings emitted
+error: aborting due to 8 previous errors; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
index cdbfb37c7c7..bcd29f8b034 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
@@ -2,6 +2,7 @@
 // aux-build:static_cross_crate.rs
 // stderr-per-bitwidth
 #![feature(exclusive_range_pattern, half_open_range_patterns_in_slices)]
+#![allow(static_mut_ref)]
 
 extern crate static_cross_crate;
 
@@ -10,7 +11,6 @@ extern crate static_cross_crate;
 const SLICE_MUT: &[u8; 1] = { //~ ERROR undefined behavior
     //~| encountered reference to mutable memory
     unsafe { &static_cross_crate::ZERO }
-    //~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
 };
 
 const U8_MUT: &u8 = { //~ ERROR undefined behavior
diff --git a/tests/ui/consts/static_mut_containing_mut_ref.rs b/tests/ui/consts/static_mut_containing_mut_ref.rs
index 874aa59df0b..495804649b1 100644
--- a/tests/ui/consts/static_mut_containing_mut_ref.rs
+++ b/tests/ui/consts/static_mut_containing_mut_ref.rs
@@ -1,8 +1,8 @@
 // build-pass (FIXME(62277): could be check-pass?)
+#![allow(static_mut_ref)]
 
 static mut STDERR_BUFFER_SPACE: [u8; 42] = [0u8; 42];
 
 pub static mut STDERR_BUFFER: *mut [u8] = unsafe { &mut STDERR_BUFFER_SPACE };
-//~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
 
 fn main() {}
diff --git a/tests/ui/consts/static_mut_containing_mut_ref.stderr b/tests/ui/consts/static_mut_containing_mut_ref.stderr
deleted file mode 100644
index 56ceba41cf8..00000000000
--- a/tests/ui/consts/static_mut_containing_mut_ref.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: mutable reference of mutable static is discouraged
-  --> $DIR/static_mut_containing_mut_ref.rs:5:52
-   |
-LL | pub static mut STDERR_BUFFER: *mut [u8] = unsafe { &mut STDERR_BUFFER_SPACE };
-   |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
-   |
-LL | pub static mut STDERR_BUFFER: *mut [u8] = unsafe { addr_of_mut!(STDERR_BUFFER_SPACE) };
-   |                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr b/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr
index bc32ecc2c35..42cb119d2ae 100644
--- a/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr
+++ b/tests/ui/consts/static_mut_containing_mut_ref2.mut_refs.stderr
@@ -1,24 +1,9 @@
-warning: mutable reference of mutable static is discouraged
-  --> $DIR/static_mut_containing_mut_ref2.rs:8:6
-   |
-LL |     *(&mut STDERR_BUFFER_SPACE) = 42;
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |     *addr_of_mut!(STDERR_BUFFER_SPACE) = 42;
-   |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 error[E0080]: could not evaluate static initializer
   --> $DIR/static_mut_containing_mut_ref2.rs:8:5
    |
 LL |     *(&mut STDERR_BUFFER_SPACE) = 42;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ modifying a static's initial value from another static's initializer
 
-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 E0080`.
diff --git a/tests/ui/consts/static_mut_containing_mut_ref2.rs b/tests/ui/consts/static_mut_containing_mut_ref2.rs
index b71f1122cd0..e60a17922fd 100644
--- a/tests/ui/consts/static_mut_containing_mut_ref2.rs
+++ b/tests/ui/consts/static_mut_containing_mut_ref2.rs
@@ -1,5 +1,5 @@
 // revisions: stock mut_refs
-
+#![allow(static_mut_ref)]
 #![cfg_attr(mut_refs, feature(const_mut_refs))]
 
 static mut STDERR_BUFFER_SPACE: u8 = 0;
@@ -8,8 +8,6 @@ pub static mut STDERR_BUFFER: () = unsafe {
     *(&mut STDERR_BUFFER_SPACE) = 42;
     //[mut_refs]~^ ERROR could not evaluate static initializer
     //[stock]~^^ ERROR mutation through a reference is not allowed in statics
-    //[mut_refs]~^^^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
-    //[stock]~^^^^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
 };
 
 fn main() {}
diff --git a/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr b/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr
index aea5b8a33b5..5ff9c0b6e2b 100644
--- a/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr
+++ b/tests/ui/consts/static_mut_containing_mut_ref2.stock.stderr
@@ -1,18 +1,3 @@
-warning: mutable reference of mutable static is discouraged
-  --> $DIR/static_mut_containing_mut_ref2.rs:8:6
-   |
-LL |     *(&mut STDERR_BUFFER_SPACE) = 42;
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |     *addr_of_mut!(STDERR_BUFFER_SPACE) = 42;
-   |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 error[E0658]: mutation through a reference is not allowed in statics
   --> $DIR/static_mut_containing_mut_ref2.rs:8:5
    |
@@ -23,6 +8,6 @@ LL |     *(&mut STDERR_BUFFER_SPACE) = 42;
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-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 E0658`.
diff --git a/tests/ui/thread-local/thread-local-static.rs b/tests/ui/thread-local/thread-local-static.rs
index dac9259a6a6..a2c1954881f 100644
--- a/tests/ui/thread-local/thread-local-static.rs
+++ b/tests/ui/thread-local/thread-local-static.rs
@@ -2,14 +2,14 @@
 
 #![feature(thread_local)]
 #![feature(const_swap)]
+#![allow(static_mut_ref)]
 
 #[thread_local]
 static mut STATIC_VAR_2: [u32; 8] = [4; 8];
 const fn g(x: &mut [u32; 8]) {
     //~^ ERROR mutable references are not allowed
     std::mem::swap(x, &mut STATIC_VAR_2)
-    //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
-    //~^^ ERROR thread-local statics cannot be accessed
+    //~^ ERROR thread-local statics cannot be accessed
     //~| ERROR mutable references are not allowed
     //~| ERROR use of mutable static is unsafe
 }
diff --git a/tests/ui/thread-local/thread-local-static.stderr b/tests/ui/thread-local/thread-local-static.stderr
index 3dd1e2d4000..a6499fd15ec 100644
--- a/tests/ui/thread-local/thread-local-static.stderr
+++ b/tests/ui/thread-local/thread-local-static.stderr
@@ -1,20 +1,5 @@
-warning: mutable reference of mutable static is discouraged
-  --> $DIR/thread-local-static.rs:10:23
-   |
-LL |     std::mem::swap(x, &mut STATIC_VAR_2)
-   |                       ^^^^^^^^^^^^^^^^^ mutable reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |     std::mem::swap(x, addr_of_mut!(STATIC_VAR_2))
-   |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 error[E0133]: use of mutable static is unsafe and requires unsafe function or block
-  --> $DIR/thread-local-static.rs:10:28
+  --> $DIR/thread-local-static.rs:11:28
    |
 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
    |                            ^^^^^^^^^^^^ use of mutable static
@@ -22,7 +7,7 @@ LL |     std::mem::swap(x, &mut STATIC_VAR_2)
    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
 
 error[E0658]: mutable references are not allowed in constant functions
-  --> $DIR/thread-local-static.rs:8:12
+  --> $DIR/thread-local-static.rs:9:12
    |
 LL | const fn g(x: &mut [u32; 8]) {
    |            ^
@@ -32,13 +17,13 @@ LL | const fn g(x: &mut [u32; 8]) {
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0625]: thread-local statics cannot be accessed at compile-time
-  --> $DIR/thread-local-static.rs:10:28
+  --> $DIR/thread-local-static.rs:11:28
    |
 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
    |                            ^^^^^^^^^^^^
 
 error[E0658]: mutable references are not allowed in constant functions
-  --> $DIR/thread-local-static.rs:10:23
+  --> $DIR/thread-local-static.rs:11:23
    |
 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
    |                       ^^^^^^^^^^^^^^^^^
@@ -47,7 +32,7 @@ LL |     std::mem::swap(x, &mut STATIC_VAR_2)
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error: aborting due to 4 previous errors; 1 warning emitted
+error: aborting due to 4 previous errors
 
 Some errors have detailed explanations: E0133, E0625, E0658.
 For more information about an error, try `rustc --explain E0133`.
diff --git a/tests/ui/thread-local/thread-local-static.thir.stderr b/tests/ui/thread-local/thread-local-static.thir.stderr
deleted file mode 100644
index 2043b268c09..00000000000
--- a/tests/ui/thread-local/thread-local-static.thir.stderr
+++ /dev/null
@@ -1,59 +0,0 @@
-warning: mutable reference of mutable static is discouraged
-  --> $DIR/thread-local-static.rs:12:23
-   |
-LL |     std::mem::swap(x, &mut STATIC_VAR_2)
-   |                       ^^^^^^^^^^^^^^^^^ mutable reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
-   |
-LL |     std::mem::swap(x, addr_of_mut!(STATIC_VAR_2))
-   |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-error[E0658]: mutable references are not allowed in constant functions
-  --> $DIR/thread-local-static.rs:10:12
-   |
-LL | const fn g(x: &mut [u32; 8]) {
-   |            ^
-   |
-   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
-   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-
-error[E0625]: thread-local statics cannot be accessed at compile-time
-  --> $DIR/thread-local-static.rs:12:28
-   |
-LL |     std::mem::swap(x, &mut STATIC_VAR_2)
-   |                            ^^^^^^^^^^^^
-
-error[E0013]: constant functions cannot refer to statics
-  --> $DIR/thread-local-static.rs:12:28
-   |
-LL |     std::mem::swap(x, &mut STATIC_VAR_2)
-   |                            ^^^^^^^^^^^^
-   |
-   = help: consider extracting the value of the `static` to a `const`, and referring to that
-
-error[E0658]: mutable references are not allowed in constant functions
-  --> $DIR/thread-local-static.rs:12:23
-   |
-LL |     std::mem::swap(x, &mut STATIC_VAR_2)
-   |                       ^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
-   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-
-error[E0133]: use of mutable static is unsafe and requires unsafe function or block
-  --> $DIR/thread-local-static.rs:12:23
-   |
-LL |     std::mem::swap(x, &mut STATIC_VAR_2)
-   |                       ^^^^^^^^^^^^^^^^^ 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 5 previous errors; 1 warning emitted
-
-Some errors have detailed explanations: E0013, E0133, E0625, E0658.
-For more information about an error, try `rustc --explain E0013`.