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
-19Lines changed: 0 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -467,25 +467,6 @@ hir_analysis_start_not_target_feature = `#[start]` function is not allowed to ha
467
467
hir_analysis_start_not_track_caller = `#[start]` function is not allowed to be `#[track_caller]`
468
468
.label = `#[start]` function is not allowed to be `#[track_caller]`
469
469
470
-
hir_analysis_static_mut_ref = creating a {$shared} reference to a mutable static
471
-
.label = {$shared} reference to mutable static
472
-
.note = {$shared->
473
-
[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
474
-
*[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
475
-
}
476
-
.suggestion = use `addr_of!` instead to create a raw pointer
477
-
.suggestion_mut = use `addr_of_mut!` instead to create a raw pointer
478
-
479
-
hir_analysis_static_mut_refs_lint = creating a {$shared} reference to mutable static is discouraged
480
-
.label = {$shared} reference to mutable static
481
-
.suggestion = use `addr_of!` instead to create a raw pointer
482
-
.suggestion_mut = use `addr_of_mut!` instead to create a raw pointer
483
-
.note = this will be a hard error in the 2024 edition
484
-
.why_note = {$shared->
485
-
[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
486
-
*[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
487
-
}
488
-
489
470
hir_analysis_static_specialize = cannot specialize on `'static` lifetime
490
471
491
472
hir_analysis_tait_forward_compat = item constrains opaque type that is not in its signature
Copy file name to clipboardExpand all lines: compiler/rustc_lint/messages.ftl
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -769,6 +769,13 @@ lint_single_use_lifetime = lifetime parameter `{$ident}` only used once
769
769
770
770
lint_span_use_eq_ctxt = use `.eq_ctxt()` instead of `.ctxt() == .ctxt()`
771
771
772
+
lint_static_mut_refs_lint = creating a {$shared_label}reference to mutable static is discouraged
773
+
.label = {$shared_label}reference to mutable static
774
+
.suggestion = use `&raw const` instead to create a raw pointer
775
+
.suggestion_mut = use `&raw mut` instead to create a raw pointer
776
+
.shared_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
777
+
.mut_note = 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
778
+
772
779
lint_supertrait_as_deref_target = this `Deref` implementation is covered by an implicit supertrait coercion
773
780
.label = `{$self_ty}` implements `Deref<Target = dyn {$target_principal}>` which conflicts with supertrait `{$supertrait_principal}`
774
781
.label2 = target type is a supertrait of `{$self_ty}`
0 commit comments