-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 7 pull requests #128088
Closed
Closed
Rollup of 7 pull requests #128088
Conversation
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
The implied deref to statics introduced by HIR->THIR lowering is only used to create place expressions, it lacks unsafe semantics. It is also confusing, as there is no visible `*ident` in the source. For both classes of "unsafe static" (extern static and static mut) allow this operation. We lack a clear story around `thread_local! { static mut }`, which is actually its own category of item that reuses the static syntax but has its own rules. It's possible they should be similarly included, but in the absence of a good reason one way or another, we do not bless it.
…haelwoerister Disallow hidden references to mutable static Closes rust-lang#123060 Tracking: - rust-lang#123758
…k-for-addr-of-static-mut, r=compiler-errors treat `&raw (const|mut) UNSAFE_STATIC` implied deref as safe Fixes rust-lang#125833 As reported in that and related issues, `static mut STATIC_MUT: T` is very often used in embedded code, and is in many ways equivalent to `static STATIC_CELL: SyncUnsafeCell<T>`. The Rust expression of `&raw mut STATIC_MUT` and `SyncUnsafeCell::get(&STATIC_CELL)` are approximately equal, and both evaluate to `*mut T`. The library function is safe because it has *declared itself* to be safe. However, the raw ref operator is unsafe because all uses of `static mut` are considered unsafe, even though the static's value is not used by this expression (unlike, for example, `&STATIC_MUT`). We can fix this unnatural difference by simply adding the proper exclusion for the safety check inside the THIR unsafeck, so that we do not declare it unsafe if it is not. While the primary concern here is `static mut`, this change is made for all instances of an "unsafe static", which includes a static declared inside `extern "abi" {}`. Hypothetically, we could go as far as generalizing this to all instances of `&raw (const|mut) *ptr`, but today we do not, as we have not actually considered the range of possible expressions that use a similar encoding. We do not even extend this to thread-local equivalents, because they have less clear semantics.
…nk-framework, r=Kobzol Migrate `run-make/link-framework` to `rmake.rs` Part of rust-lang#121876. r? `@Kobzol` try-job: x86_64-apple-1
…r=fmease Cleanup compiletest dylib name calculation Use `std::env::consts::{DLL_PREFIX, DLL_EXTENSION}` for dylib name calculation which is more accurate for the various different platforms, and is more likely to be looked at by target maintainers. cc `@bzEq` (as this impacts how compiletest handles AIX dll extensions)
…=jieyouxu Migrate `lto-linkage-used-attr`, `no-duplicate-libs` and `pgo-gen-no-imp-symbols` `run-make` tests to rmake Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc try-job: aarch64-apple try-job: armhf-gnu try-job: test-various try-job: x86_64-gnu-llvm-18
…lcnr Get rid of `can_eq_shallow` ✨ r? lcnr
…lcnr Get rid of `InferCtxtExt` from `error_reporting::traits` One more cleanup. r? lcnr
rustbot
added
A-run-make
Area: port run-make Makefiles to rmake.rs
A-testsuite
Area: The testsuite used to check the correctness of rustc
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
rollup
A PR which is a rollup
labels
Jul 23, 2024
@bors r+ rollup=never p=5 |
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
Jul 23, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 23, 2024
Rollup of 7 pull requests Successful merges: - rust-lang#124895 (Disallow hidden references to mutable static) - rust-lang#125834 (treat `&raw (const|mut) UNSAFE_STATIC` implied deref as safe) - rust-lang#126898 (Migrate `run-make/link-framework` to `rmake.rs`) - rust-lang#127962 (Cleanup compiletest dylib name calculation) - rust-lang#127990 (Migrate `lto-linkage-used-attr`, `no-duplicate-libs` and `pgo-gen-no-imp-symbols` `run-make` tests to rmake) - rust-lang#128067 (Get rid of `can_eq_shallow`) - rust-lang#128076 (Get rid of `InferCtxtExt` from `error_reporting::traits`) r? `@ghost` `@rustbot` modify labels: rollup
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
bors
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Jul 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-run-make
Area: port run-make Makefiles to rmake.rs
A-testsuite
Area: The testsuite used to check the correctness of rustc
rollup
A PR which is a rollup
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
&raw (const|mut) UNSAFE_STATIC
implied deref as safe #125834 (treat&raw (const|mut) UNSAFE_STATIC
implied deref as safe)run-make/link-framework
tormake.rs
#126898 (Migraterun-make/link-framework
tormake.rs
)lto-linkage-used-attr
,no-duplicate-libs
andpgo-gen-no-imp-symbols
run-make
tests to rmake #127990 (Migratelto-linkage-used-attr
,no-duplicate-libs
andpgo-gen-no-imp-symbols
run-make
tests to rmake)can_eq_shallow
#128067 (Get rid ofcan_eq_shallow
)InferCtxtExt
fromerror_reporting::traits
#128076 (Get rid ofInferCtxtExt
fromerror_reporting::traits
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup