-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #125920 - bjorn3:allow_static_mut_linkage_def, r=Urgau
Allow static mut definitions with #[linkage] Unlike static declarations with #[linkage], for definitions rustc doesn't rewrite it to add an extra indirection. This was accidentally disallowed in #125046. cc #125800 (comment)
- Loading branch information
Showing
3 changed files
with
30 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
error: mutable statics are not allowed with `#[linkage]` | ||
--> $DIR/linkage-attr-mutable-static.rs:8:9 | ||
error: extern mutable statics are not allowed with `#[linkage]` | ||
--> $DIR/linkage-attr-mutable-static.rs:9:9 | ||
| | ||
LL | #[linkage = "weak"] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
LL | #[linkage = "extern_weak"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: making the static mutable would allow changing which symbol the static references rather than make the target of the symbol mutable | ||
= note: marking the extern static mutable would allow changing which symbol the static references rather than make the target of the symbol mutable | ||
|
||
error: aborting due to 1 previous error | ||
|