Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow static mut definitions with #[linkage] #125920

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Jun 3, 2024

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)

Unlike static declarations with #[linkage], for definitions rustc
doesn't rewrite it to add an extra indirection.
@rustbot
Copy link
Collaborator

rustbot commented Jun 3, 2024

r? @pnkfelix

rustbot has assigned @pnkfelix.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 3, 2024
Copy link
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

Feel free to r=me unless to you want someone more familiar with this part of rustc.

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 3, 2024

@bors r=Urgau

@bors
Copy link
Contributor

bors commented Jun 3, 2024

📌 Commit 07dc3eb has been approved by Urgau

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2024
fmease added a commit to fmease/rust that referenced this pull request Jun 4, 2024
…f, 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 rust-lang#125046.

cc rust-lang#125800 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#125273 (bootstrap: implement new feature `bootstrap-self-test`)
 - rust-lang#125800 (Fix `mut` static task queue in SGX target)
 - rust-lang#125903 (rustc_span: Inline some hot functions)
 - rust-lang#125920 (Allow static mut definitions with #[linkage])
 - rust-lang#125921 (coverage: Carve out hole spans in a separate early pass)
 - rust-lang#125995 (Use inline const blocks to create arrays of `MaybeUninit`.)
 - rust-lang#125996 (Closures are recursively reachable)

r? `@ghost`
`@rustbot` modify labels: rollup
@workingjubilee
Copy link
Member

@bors rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
…kingjubilee

Rollup of 12 pull requests

Successful merges:

 - rust-lang#123168 (Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude)
 - rust-lang#125273 (bootstrap: implement new feature `bootstrap-self-test`)
 - rust-lang#125683 (Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format)
 - rust-lang#125815 (`rustc_parse` top-level cleanups)
 - rust-lang#125903 (rustc_span: Inline some hot functions)
 - rust-lang#125906 (Remove a bunch of redundant args from `report_method_error`)
 - rust-lang#125920 (Allow static mut definitions with #[linkage])
 - rust-lang#125982 (Make deleting on LinkedList aware of the allocator)
 - rust-lang#125995 (Use inline const blocks to create arrays of `MaybeUninit`.)
 - rust-lang#125996 (Closures are recursively reachable)
 - rust-lang#126003 (Add a co-maintainer for the two ARMv4T targets)
 - rust-lang#126004 (Add another test for hidden types capturing lifetimes that outlive but arent mentioned in substs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2b89c1b into rust-lang:master Jun 5, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone Jun 5, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
Rollup merge of rust-lang#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 rust-lang#125046.

cc rust-lang#125800 (comment)
@bjorn3 bjorn3 deleted the allow_static_mut_linkage_def branch June 5, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants