Rollup merge of #140056 - yuk1ty:fix-static-mut-error-message, r=jieyouxu
Fix a wrong error message in 2024 edition Fixes https://github.com/rust-lang/rust/issues/139952
This commit is contained in:
commit
1a766a8772
22 changed files with 91 additions and 93 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue