diff options
| author | yuk1ty <yuk1ty@users.noreply.github.com> | 2025-04-20 10:51:19 +0900 |
|---|---|---|
| committer | yuk1ty <yuk1ty@users.noreply.github.com> | 2025-04-26 14:48:30 +0900 |
| commit | bffb7608ce727d61cb1d9d3bb58d5461375f59a5 (patch) | |
| tree | d4494c7a87053feae77833ec16f8f520782ee693 /compiler | |
| parent | d3508a8ad0163fab0c9b2188b3adf43c87200788 (diff) | |
| download | rust-bffb7608ce727d61cb1d9d3bb58d5461375f59a5.tar.gz rust-bffb7608ce727d61cb1d9d3bb58d5461375f59a5.zip | |
Fix error message for static references or mutable references
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/messages.ftl | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/static_mut_refs.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl index 60c183bd56b..9025c41240b 100644 --- a/compiler/rustc_lint/messages.ftl +++ b/compiler/rustc_lint/messages.ftl @@ -757,7 +757,7 @@ lint_single_use_lifetime = lifetime parameter `{$ident}` only used once lint_span_use_eq_ctxt = use `.eq_ctxt()` instead of `.ctxt() == .ctxt()` -lint_static_mut_refs_lint = creating a {$shared_label}reference to mutable static is discouraged +lint_static_mut_refs_lint = creating a {$shared_label}reference to mutable static .label = {$shared_label}reference to mutable static .suggestion = use `&raw const` instead to create a raw pointer .suggestion_mut = use `&raw mut` instead to create a raw pointer diff --git a/compiler/rustc_lint/src/static_mut_refs.rs b/compiler/rustc_lint/src/static_mut_refs.rs index 50021157dda..4dda3c7951b 100644 --- a/compiler/rustc_lint/src/static_mut_refs.rs +++ b/compiler/rustc_lint/src/static_mut_refs.rs @@ -51,7 +51,7 @@ declare_lint! { /// This lint is "warn" by default on editions up to 2021, in 2024 is "deny". pub STATIC_MUT_REFS, Warn, - "shared references or mutable references of mutable static is discouraged", + "creating a shared reference to mutable static", @future_incompatible = FutureIncompatibleInfo { reason: FutureIncompatibilityReason::EditionError(Edition::Edition2024), reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>", |
