rustc_data_structures: Explicitly check for 64-bit atomics support by glaubitz · Pull Request #127075 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation13 Commits1 Checks6 Files changed
Conversation
This file contains hidden or 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
[ Show hidden characters]({{ revealButtonHref }})
Instead of keeping a list of architectures which have native support
for 64-bit atomics, just use #[cfg(target_has_atomic = "64")] and its
inverted counterpart to determine whether we need to use portable
AtomicU64 on the target architecture.
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
FWIW, I think we can use #[cfg(target_has_atomic = "64")]
/#[cfg(not(target_has_atomic = "64"))]
instead of listing concrete architecture names.
FWIW, I think we can use
#[cfg(target_has_atomic = "64")]
/#[cfg(not(target_has_atomic = "64"))]
instead of listing concrete architecture names.
Good idea. Can we use this in the Cargo.toml
as well?
Can we use this in the
Cargo.toml
as well?
Yes. (For example, cargo and pyo3 uses it in Cargo.toml
.)
Can we use this in the
Cargo.toml
as well?
OK, testing this now. Thanks a lot for the suggestion!
Thanks! If #[cfg(target_has_atomic = "64")]
works it's the best
r? @SparrowLii
@bors delegate+
r=me after your testing
✌️ @glaubitz, you can now approve this pull request!
If @SparrowLii told you to "r=me
" after making some further change, please make that change, then do @bors r=@SparrowLii
Instead of keeping a list of architectures which have native support for 64-bit atomics, just use #[cfg(target_has_atomic = "64")] and its inverted counterpart to determine whether we need to use portable AtomicU64 on the target architecture.
glaubitz changed the title
rustc_data_structures: Fix copy-and-paste error from previous change rustc_data_structures: Explicitly check for 64-bit atomics support
📌 Commit ab1b48e has been approved by SparrowLii
It is now in the queue for this repository.
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
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request
…rrowLii
rustc_data_structures: Explicitly check for 64-bit atomics support
Instead of keeping a list of architectures which have native support for 64-bit atomics, just use #[cfg(target_has_atomic = "64")] and its inverted counterpart to determine whether we need to use portable AtomicU64 on the target architecture.
bors added a commit to rust-lang-ci/rust that referenced this pull request
…llaumeGomez
Rollup of 10 pull requests
Successful merges:
- rust-lang#123714 (Add test for fn pointer duplication.)
- rust-lang#124091 (Update AST validation module docs)
- rust-lang#126963 (Add basic Serde serialization capabilities to Stable MIR)
- rust-lang#127015 (Switch back
non_local_definitions
lint to allow-by-default) - rust-lang#127016 (docs: check if the disambiguator matches its suffix)
- rust-lang#127029 (Fix Markdown tables in platform-support.md)
- rust-lang#127032 (Enable const casting for
f16
andf128
) - rust-lang#127041 (Migrate
run-make/override-aliased-flags
tormake.rs
) - rust-lang#127045 (Rename
super_predicates_of
and similar queries toexplicit_*
to note that they're not elaborated) - rust-lang#127075 (rustc_data_structures: Explicitly check for 64-bit atomics support)
r? @ghost
@rustbot
modify labels: rollup
@SparrowLii This seems to be fallen out of the merge queue. Any ideas?
@glaubitz Seems not related to this PR
https://github.com/rust-lang-ci/rust/actions/runs/9711788661/job/26805261710
or
plain
thread 'main' panicked at src/lib.rs:1712:17:
failed to copy `C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-tools\x86_64-pc-windows-msvc\release\miri.exe` to `C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-tools-bin\miri.exe`: The process cannot access the file because it is being used by another process. (os error 32)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:09
local time: Fri, Jun 28, 2024 12:32:23 PM
network time: Fri, 28 Jun 2024 12:32:23 GMT
Error: Process completed with exit code 1.
Just wait for #127111 to merge
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#126822 (Bootstrap command refactoring: port more
Command
usages toBootstrapCmd
(step 2)) - rust-lang#126835 (Simplifications in match lowering)
- rust-lang#126953 (std: separate TLS key creation from TLS access)
- rust-lang#127045 (Rename
super_predicates_of
and similar queries toexplicit_*
to note that they're not elaborated) - rust-lang#127075 (rustc_data_structures: Explicitly check for 64-bit atomics support)
- rust-lang#127101 (remove redundant match statement from dataflow const prop)
- rust-lang#127102 (Rename fuchsia builder and bump Fuchsia)
- rust-lang#127103 (Move binder and polarity parsing into
parse_generic_ty_bound
) - rust-lang#127108 (unify
dylib
andbin_helpers
and createshared_helpers::parse_value_from_args
)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#127075 - glaubitz:copy-and-paste-fix, r=SparrowLii
rustc_data_structures: Explicitly check for 64-bit atomics support
Instead of keeping a list of architectures which have native support for 64-bit atomics, just use #[cfg(target_has_atomic = "64")] and its inverted counterpart to determine whether we need to use portable AtomicU64 on the target architecture.
// MIPS, PowerPC and SPARC platforms with 32-bit pointers do not |
---|
// have AtomicU64 type. |
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc", target_arch = "sparc")))] |
// Use portable AtomicU64 for targets without native 64-bit atomics |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong comment position, should be placed before line 156.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment applies to both the following statements, see the comment from the previous version.
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.