You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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"
3395
3395
)]
3396
3396
pubmut_note:bool,
3397
+
#[help(
3398
+
"use a type that relies on \"interior mutability\" instead; to read more on this, visit <https://doc.rust-lang.org/reference/interior-mutability.html>"
Copy file name to clipboardExpand all lines: tests/ui/issues/issue-39367.stderr
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,14 @@ LL | | });
10
10
| |______________^ shared reference to mutable static
11
11
|
12
12
= 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
13
+
= help: use a type that relies on "interior mutability" instead; to read more on this, visit <https://doc.rust-lang.org/reference/interior-mutability.html>
13
14
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
14
15
= note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
16
+
help: this type already provides "interior mutability", so its binding doesn't need to be declared as mutable
LL | let _lock = unsafe { STDINOUT_MUTEX.lock().unwrap() };
5
+
| ^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
6
+
|
7
+
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
8
+
= 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
9
+
= help: use a type that relies on "interior mutability" instead; to read more on this, visit <https://doc.rust-lang.org/reference/interior-mutability.html>
10
+
= note: `#[deny(static_mut_refs)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
11
+
help: this type already provides "interior mutability", so its binding doesn't need to be declared as mutable
0 commit comments