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
@@ -468,24 +468,20 @@ hir_analysis_start_not_target_feature = `#[start]` function is not allowed to ha
468
468
hir_analysis_start_not_track_caller = `#[start]` function is not allowed to be `#[track_caller]`
469
469
.label = `#[start]` function is not allowed to be `#[track_caller]`
470
470
471
-
hir_analysis_static_mut_ref = creating a {$shared} reference to a mutable static
472
-
.label = {$shared} reference to mutable static
473
-
.note = {$shared->
474
-
[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
475
-
*[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
476
-
}
471
+
hir_analysis_static_mut_ref = creating a {$shared_label}reference to a mutable static
472
+
.label = {$shared_label}reference to mutable static
473
+
.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
474
+
.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
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
480
-
hir_analysis_static_mut_refs_lint = creating a {$shared}reference to mutable static is discouraged
481
-
.label = {$shared}reference to mutable static
478
+
hir_analysis_static_mut_refs_lint = creating a {$shared_label}reference to mutable static is discouraged
479
+
.label = {$shared_label}reference to mutable static
482
480
.suggestion = use `addr_of!` instead to create a raw pointer
483
481
.suggestion_mut = use `addr_of_mut!` instead to create a raw pointer
484
482
.note = this will be a hard error in the 2024 edition
485
-
.why_note = {$shared->
486
-
[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
487
-
*[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
488
-
}
483
+
.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
484
+
.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
489
485
490
486
hir_analysis_static_specialize = cannot specialize on `'static` lifetime
0 commit comments