Skip to content

Commit b588372

Browse files
committed
Rename static_mut_ref to static_mut_refs
1 parent c15b018 commit b588372

File tree

56 files changed

+85
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+85
-82
lines changed

Diff for: compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ fn start<T: Termination + 'static>(
112112

113113
static mut NUM: u8 = 6 * 7;
114114

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

119119
unsafe fn zeroed<T>() -> T {

Diff for: compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ fn start<T: Termination + 'static>(
9999

100100
static mut NUM: u8 = 6 * 7;
101101

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

106106
macro_rules! assert {

Diff for: compiler/rustc_hir_analysis/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ hir_analysis_static_mut_ref = reference to mutable static is disallowed
380380
.suggestion = 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
381381
.suggestion_mut = 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
382382
383-
hir_analysis_static_mut_ref_lint = {$shared}reference to mutable static is discouraged
383+
hir_analysis_static_mut_refs_lint = {$shared}reference to mutable static is discouraged
384384
.label = shared reference of mutable static
385385
.label_mut = mutable reference of mutable static
386386
.suggestion = 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

Diff for: compiler/rustc_hir_analysis/src/check/errs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc_hir as hir;
22
use rustc_hir_pretty::qpath_to_string;
3-
use rustc_lint_defs::builtin::STATIC_MUT_REF;
3+
use rustc_lint_defs::builtin::STATIC_MUT_REFS;
44
use rustc_middle::ty::TyCtxt;
55
use rustc_span::Span;
66
use rustc_type_ir::Mutability;
@@ -89,7 +89,7 @@ fn handle_static_mut_ref(
8989
)
9090
};
9191
tcx.emit_node_span_lint(
92-
STATIC_MUT_REF,
92+
STATIC_MUT_REFS,
9393
hir_id,
9494
span,
9595
errors::RefOfMutStatic { shared, why_note: (), why_note_mut: (), label, sugg },

Diff for: compiler/rustc_hir_analysis/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ pub enum StaticMutRefSugg {
14931493

14941494
// STATIC_MUT_REF lint
14951495
#[derive(LintDiagnostic)]
1496-
#[diag(hir_analysis_static_mut_ref_lint)]
1496+
#[diag(hir_analysis_static_mut_refs_lint)]
14971497
#[note]
14981498
pub struct RefOfMutStatic<'a> {
14991499
pub shared: &'a str,

Diff for: compiler/rustc_lint/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ fn register_builtins(store: &mut LintStore) {
324324
store.register_renamed("or_patterns_back_compat", "rust_2021_incompatible_or_patterns");
325325
store.register_renamed("non_fmt_panic", "non_fmt_panics");
326326
store.register_renamed("unused_tuple_struct_fields", "dead_code");
327+
store.register_renamed("static_mut_ref", "static_mut_refs");
327328

328329
// These were moved to tool lints, but rustc still sees them when compiling normally, before
329330
// tool lints are registered, so `check_tool_name_for_backwards_compat` doesn't work. Use

Diff for: compiler/rustc_lint_defs/src/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ declare_lint_pass! {
8989
SINGLE_USE_LIFETIMES,
9090
SOFT_UNSTABLE,
9191
STABLE_FEATURES,
92-
STATIC_MUT_REF,
92+
STATIC_MUT_REFS,
9393
SUSPICIOUS_AUTO_TRAIT_IMPLS,
9494
TEST_UNSTABLE_LINT,
9595
TEXT_DIRECTION_CODEPOINT_IN_COMMENT,
@@ -1769,7 +1769,7 @@ declare_lint! {
17691769
}
17701770

17711771
declare_lint! {
1772-
/// The `static_mut_ref` lint checks for shared or mutable references
1772+
/// The `static_mut_refs` lint checks for shared or mutable references
17731773
/// of mutable static inside `unsafe` blocks and `unsafe` functions.
17741774
///
17751775
/// ### Example
@@ -1809,7 +1809,7 @@ declare_lint! {
18091809
///
18101810
/// This lint is "warn" by default on editions up to 2021, in 2024 there is
18111811
/// a hard error instead.
1812-
pub STATIC_MUT_REF,
1812+
pub STATIC_MUT_REFS,
18131813
Warn,
18141814
"shared references or mutable references of mutable static is discouraged",
18151815
@future_incompatible = FutureIncompatibleInfo {

Diff for: library/panic_unwind/src/seh.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ cfg_if::cfg_if! {
261261
}
262262
}
263263

264-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
265-
#[allow(static_mut_ref)]
264+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
265+
#[allow(static_mut_refs)]
266266
pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
267267
use core::intrinsics::atomic_store_seqcst;
268268

@@ -324,8 +324,8 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
324324
_CxxThrowException(throw_ptr, &mut THROW_INFO as *mut _ as *mut _);
325325
}
326326

327-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
328-
#[allow(static_mut_ref)]
327+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
328+
#[allow(static_mut_refs)]
329329
pub unsafe fn cleanup(payload: *mut u8) -> Box<dyn Any + Send> {
330330
// A null payload here means that we got here from the catch (...) of
331331
// __rust_try. This happens when a non-Rust foreign exception is caught.

Diff for: library/std/src/panicking.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,9 @@ pub mod panic_count {
337337
#[doc(hidden)]
338338
#[cfg(not(feature = "panic_immediate_abort"))]
339339
#[unstable(feature = "update_panic_count", issue = "none")]
340-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
341-
#[allow(static_mut_ref)]
340+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
341+
#[cfg_attr(bootstrap, allow(static_mut_ref))]
342+
#[cfg_attr(not(bootstrap), allow(static_mut_refs))]
342343
pub mod panic_count {
343344
use crate::cell::Cell;
344345
use crate::sync::atomic::{AtomicUsize, Ordering};

Diff for: library/std/src/sys/pal/common/thread_local/fast_local.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ pub macro thread_local_inner {
1313
(@key $t:ty, const $init:expr) => {{
1414
#[inline]
1515
#[deny(unsafe_op_in_unsafe_fn)]
16-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
17-
#[allow(static_mut_ref)]
16+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
17+
#[cfg_attr(bootstrap, allow(static_mut_ref))]
18+
#[cfg_attr(not(bootstrap), allow(static_mut_refs))]
1819
unsafe fn __getit(
1920
_init: $crate::option::Option<&mut $crate::option::Option<$t>>,
2021
) -> $crate::option::Option<&'static $t> {

Diff for: library/std/src/sys/pal/common/thread_local/static_local.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pub macro thread_local_inner {
1111
(@key $t:ty, const $init:expr) => {{
1212
#[inline] // see comments below
1313
#[deny(unsafe_op_in_unsafe_fn)]
14-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
15-
#[allow(static_mut_ref)]
14+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
15+
#[allow(static_mut_refs)]
1616
unsafe fn __getit(
1717
_init: $crate::option::Option<&mut $crate::option::Option<$t>>,
1818
) -> $crate::option::Option<&'static $t> {

Diff for: library/std/src/thread/local.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ impl<T: 'static> fmt::Debug for LocalKey<T> {
180180
#[stable(feature = "rust1", since = "1.0.0")]
181181
#[cfg_attr(not(test), rustc_diagnostic_item = "thread_local_macro")]
182182
#[allow_internal_unstable(thread_local_internals)]
183-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
184-
#[allow(static_mut_ref)]
183+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
184+
#[cfg_attr(not(bootstrap), allow(static_mut_refs))]
185185
macro_rules! thread_local {
186186
// empty (base case for the recursion)
187187
() => {};

Diff for: src/tools/miri/tests/fail/tls/tls_static_dealloc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Ensure that thread-local statics get deallocated when the thread dies.
22
33
#![feature(thread_local)]
4-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
5-
#![allow(static_mut_ref)]
4+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
5+
#![allow(static_mut_refs)]
66

77
#[thread_local]
88
static mut TLS: u8 = 0;

Diff for: src/tools/miri/tests/pass/static_mut.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
static mut FOO: i32 = 42;
22

3-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
4-
#[allow(static_mut_ref)]
3+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
4+
#[allow(static_mut_refs)]
55
static BAR: Foo = Foo(unsafe { &FOO as *const _ });
66

77
#[allow(dead_code)]

Diff for: src/tools/miri/tests/pass/tls/tls_static.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
//! test, we also check that thread-locals act as per-thread statics.
99
1010
#![feature(thread_local)]
11-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
12-
#![allow(static_mut_ref)]
11+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
12+
#![allow(static_mut_refs)]
1313

1414
use std::thread;
1515

Diff for: tests/ui/abi/statics/static-mut-foreign.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ unsafe fn run() {
3333
rust_dbg_static_mut = -3;
3434
assert_eq!(rust_dbg_static_mut, -3);
3535
static_bound(&rust_dbg_static_mut);
36-
//~^ WARN shared reference to mutable static is discouraged [static_mut_ref]
36+
//~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
3737
static_bound_set(&mut rust_dbg_static_mut);
38-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
38+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
3939
}
4040

4141
pub fn main() {

Diff for: tests/ui/abi/statics/static-mut-foreign.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | static_bound(&rust_dbg_static_mut);
88
= note: reference of mutable static is a hard error in 2024 edition
99
= note: a shared reference supposedly lives forever, so if there is ever also a mutable reference created that is very dangerous as they can accidentally be used in overlapping ways
1010
= note: a mutable reference supposedly lives forever, so creating more than one is very dangerous and they can accidentally be used in overlapping ways
11-
= note: `#[warn(static_mut_ref)]` on by default
11+
= note: `#[warn(static_mut_refs)]` on by default
1212
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
1313
|
1414
LL | static_bound(addr_of!(rust_dbg_static_mut));

Diff for: tests/ui/borrowck/borrowck-access-permissions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn main() {
1616
let _y1 = &mut static_x; //~ ERROR [E0596]
1717
unsafe {
1818
let _y2 = &mut static_x_mut;
19-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
19+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
2020
}
2121
}
2222

Diff for: tests/ui/borrowck/borrowck-access-permissions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | let _y2 = &mut static_x_mut;
88
= note: reference of mutable static is a hard error in 2024 edition
99
= note: a shared reference supposedly lives forever, so if there is ever also a mutable reference created that is very dangerous as they can accidentally be used in overlapping ways
1010
= note: a mutable reference supposedly lives forever, so creating more than one is very dangerous and they can accidentally be used in overlapping ways
11-
= note: `#[warn(static_mut_ref)]` on by default
11+
= note: `#[warn(static_mut_refs)]` on by default
1212
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
1313
|
1414
LL | let _y2 = addr_of_mut!(static_x_mut);

Diff for: tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl Foo {
1717
fn main() {
1818
unsafe {
1919
let sfoo: *mut Foo = &mut SFOO;
20-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
20+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
2121
let x = (*sfoo).x();
2222
(*sfoo).x[1] += 1;
2323
*x += 1;

Diff for: tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | let sfoo: *mut Foo = &mut SFOO;
88
= note: reference of mutable static is a hard error in 2024 edition
99
= note: a shared reference supposedly lives forever, so if there is ever also a mutable reference created that is very dangerous as they can accidentally be used in overlapping ways
1010
= note: a mutable reference supposedly lives forever, so creating more than one is very dangerous and they can accidentally be used in overlapping ways
11-
= note: `#[warn(static_mut_ref)]` on by default
11+
= note: `#[warn(static_mut_refs)]` on by default
1212
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
1313
|
1414
LL | let sfoo: *mut Foo = addr_of_mut!(SFOO);

Diff for: tests/ui/borrowck/issue-20801.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn imm_ref() -> &'static T {
1212

1313
fn mut_ref() -> &'static mut T {
1414
unsafe { &mut GLOBAL_MUT_T }
15-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
15+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
1616
}
1717

1818
fn mut_ptr() -> *mut T {

Diff for: tests/ui/borrowck/issue-20801.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | unsafe { &mut GLOBAL_MUT_T }
88
= note: reference of mutable static is a hard error in 2024 edition
99
= note: a shared reference supposedly lives forever, so if there is ever also a mutable reference created that is very dangerous as they can accidentally be used in overlapping ways
1010
= note: a mutable reference supposedly lives forever, so creating more than one is very dangerous and they can accidentally be used in overlapping ways
11-
= note: `#[warn(static_mut_ref)]` on by default
11+
= note: `#[warn(static_mut_refs)]` on by default
1212
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
1313
|
1414
LL | unsafe { addr_of_mut!(GLOBAL_MUT_T) }

Diff for: tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod borrowck_closures_unique {
1010
//~^ ERROR is not declared as mutable
1111
unsafe {
1212
c1(&mut Y);
13-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
13+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
1414
}
1515
}
1616
}
@@ -25,7 +25,7 @@ mod borrowck_closures_unique_grandparent {
2525
};
2626
unsafe {
2727
c1(&mut Z);
28-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
28+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
2929
}
3030
}
3131
}
@@ -62,7 +62,7 @@ fn main() {
6262
static mut X: isize = 2;
6363
unsafe {
6464
borrowck_closures_unique::e(&mut X);
65-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
65+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
6666
}
6767

6868
mutability_errors::capture_assign_whole((1000,));

Diff for: tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | c1(&mut Y);
88
= note: reference of mutable static is a hard error in 2024 edition
99
= note: a shared reference supposedly lives forever, so if there is ever also a mutable reference created that is very dangerous as they can accidentally be used in overlapping ways
1010
= note: a mutable reference supposedly lives forever, so creating more than one is very dangerous and they can accidentally be used in overlapping ways
11-
= note: `#[warn(static_mut_ref)]` on by default
11+
= note: `#[warn(static_mut_refs)]` on by default
1212
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
1313
|
1414
LL | c1(addr_of_mut!(Y));

Diff for: tests/ui/consts/const_let_assign2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static mut BB: AA = AA::new();
1616

1717
fn main() {
1818
let ptr = unsafe { &mut BB };
19-
//~^ WARN mutable reference to mutable static is discouraged [static_mut_ref]
19+
//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
2020
for a in ptr.data.iter() {
2121
println!("{}", a);
2222
}

Diff for: tests/ui/consts/const_let_assign2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | let ptr = unsafe { &mut BB };
88
= note: reference of mutable static is a hard error in 2024 edition
99
= note: a shared reference supposedly lives forever, so if there is ever also a mutable reference created that is very dangerous as they can accidentally be used in overlapping ways
1010
= note: a mutable reference supposedly lives forever, so creating more than one is very dangerous and they can accidentally be used in overlapping ways
11-
= note: `#[warn(static_mut_ref)]` on by default
11+
= note: `#[warn(static_mut_refs)]` on by default
1212
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
1313
|
1414
LL | let ptr = unsafe { addr_of_mut!(BB) };

Diff for: tests/ui/consts/const_refs_to_static_fail_invalid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
22
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
33
#![feature(const_refs_to_static)]
4-
#![allow(static_mut_ref)]
4+
#![allow(static_mut_refs)]
55

66
fn invalid() {
77
static S: i8 = 10;

Diff for: tests/ui/consts/issue-17718-const-bad-values.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(static_mut_ref)]
1+
#![allow(static_mut_refs)]
22

33
const C1: &'static mut [usize] = &mut [];
44
//~^ ERROR: mutable references are not allowed

Diff for: tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// aux-build:static_cross_crate.rs
33
// stderr-per-bitwidth
44
#![feature(exclusive_range_pattern, half_open_range_patterns_in_slices)]
5-
#![allow(static_mut_ref)]
5+
#![allow(static_mut_refs)]
66

77
extern crate static_cross_crate;
88

Diff for: tests/ui/consts/miri_unleashed/extern-static.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags: -Zunleash-the-miri-inside-of-you
22
#![feature(thread_local)]
3-
#![allow(static_mut_ref)]
3+
#![allow(static_mut_refs)]
44

55
extern "C" {
66
static mut DATA: u8;

Diff for: tests/ui/consts/miri_unleashed/mutable_references_err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// stderr-per-bitwidth
22
// compile-flags: -Zunleash-the-miri-inside-of-you
3-
#![allow(invalid_reference_casting, static_mut_ref)]
3+
#![allow(invalid_reference_casting, static_mut_refs)]
44

55
use std::sync::atomic::*;
66
use std::cell::UnsafeCell;

Diff for: tests/ui/consts/static-promoted-to-mutable-static.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
#![allow(non_camel_case_types, non_upper_case_globals, static_mut_ref)]
2+
#![allow(non_camel_case_types, non_upper_case_globals, static_mut_refs)]
33

44
pub struct wl_interface {
55
pub version: i32

Diff for: tests/ui/consts/static_mut_containing_mut_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// build-pass (FIXME(62277): could be check-pass?)
2-
#![allow(static_mut_ref)]
2+
#![allow(static_mut_refs)]
33

44
static mut STDERR_BUFFER_SPACE: [u8; 42] = [0u8; 42];
55

Diff for: tests/ui/consts/static_mut_containing_mut_ref2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: stock mut_refs
2-
#![allow(static_mut_ref)]
2+
#![allow(static_mut_refs)]
33
#![cfg_attr(mut_refs, feature(const_mut_refs))]
44

55
static mut STDERR_BUFFER_SPACE: u8 = 0;

Diff for: tests/ui/drop/issue-23338-ensure-param-drop-order.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub mod d {
9191
pub fn max_width() -> u32 {
9292
unsafe {
9393
(mem::size_of_val(&trails) * 8) as u32
94-
//~^ WARN shared reference to mutable static is discouraged [static_mut_ref]
94+
//~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
9595
}
9696
}
9797

Diff for: tests/ui/drop/issue-23338-ensure-param-drop-order.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | (mem::size_of_val(&trails) * 8) as u32
88
= note: reference of mutable static is a hard error in 2024 edition
99
= note: a shared reference supposedly lives forever, so if there is ever also a mutable reference created that is very dangerous as they can accidentally be used in overlapping ways
1010
= note: a mutable reference supposedly lives forever, so creating more than one is very dangerous and they can accidentally be used in overlapping ways
11-
= note: `#[warn(static_mut_ref)]` on by default
11+
= note: `#[warn(static_mut_refs)]` on by default
1212
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
1313
|
1414
LL | (mem::size_of_val(addr_of!(trails)) * 8) as u32

0 commit comments

Comments
 (0)