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
Copy file name to clipboardexpand all lines: compiler/rustc_hir_analysis/messages.ftl
+8-12
Original file line number
Diff line number
Diff line change
@@ -463,24 +463,20 @@ hir_analysis_start_not_target_feature = `#[start]` function is not allowed to ha
463
463
hir_analysis_start_not_track_caller = `#[start]` function is not allowed to be `#[track_caller]`
464
464
.label = `#[start]` function is not allowed to be `#[track_caller]`
465
465
466
-
hir_analysis_static_mut_ref = creating a {$shared} reference to a mutable static
467
-
.label = {$shared} reference to mutable static
468
-
.note = {$shared->
469
-
[shared] 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
470
-
*[mutable] 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
471
-
}
466
+
hir_analysis_static_mut_ref = creating a {$shared_label}reference to a mutable static
467
+
.label = {$shared_label}reference to mutable static
468
+
.shared_note = shared references to mutable statics are dangerous since if there's any kind of mutation of, or mutable reference created for, that static while the reference lives, that's undefined behavior
469
+
.mut_note = mutable references to mutable statics are dangerous since if there's any other pointer used or reference created for that static while the reference lives, that's undefined behavior
472
470
.suggestion = use `addr_of!` instead to create a raw pointer
473
471
.suggestion_mut = use `addr_of_mut!` instead to create a raw pointer
474
472
475
-
hir_analysis_static_mut_refs_lint = creating a {$shared}reference to mutable static is discouraged
476
-
.label = {$shared}reference to mutable static
473
+
hir_analysis_static_mut_refs_lint = creating a {$shared_label}reference to mutable static is discouraged
474
+
.label = {$shared_label}reference to mutable static
477
475
.suggestion = use `addr_of!` instead to create a raw pointer
478
476
.suggestion_mut = use `addr_of_mut!` instead to create a raw pointer
479
477
.note = this will be a hard error in the 2024 edition
480
-
.why_note = {$shared->
481
-
[shared] 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
482
-
*[mutable] 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
483
-
}
478
+
.shared_note = shared references to mutable statics are dangerous since if there's any kind of mutation of, or mutable reference created for, that static while the reference lives, that's undefined behavior
479
+
.mut_note = mutable references to mutable statics are dangerous since if there's any other pointer used or reference created for that static while the reference lives, that's undefined behavior
484
480
485
481
hir_analysis_static_specialize = cannot specialize on `'static` lifetime
0 commit comments