Skip to content

std_detect: Use rustc-std-workspace-* to pull in compiler-builtins #145619

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

Merged
merged 2 commits into from
Aug 20, 2025

Conversation

joshtriplett
Copy link
Member

#145489 changed std_detect to no
longer depend on cfg-if, which meant it no longer indirectly pulled in
rustc-std-workspace-core via cfg-if. That caused it to no longer
depend on compiler-builtins.

Change std_detect to use rustc-std-workspace-core and
rustc-std-workspace-alloc, to integrate with the rustc workspace. This
also pulls in compiler-builtins via rustc-std-workspace-core.

Closes: #145594

rust-lang#145489 changed `std_detect` to no
longer depend on `cfg-if`, which meant it no longer indirectly pulled in
`rustc-std-workspace-core` via `cfg-if`. That caused it to no longer
depend on `compiler-builtins`.

Change `std_detect` to use `rustc-std-workspace-core` and
`rustc-std-workspace-alloc`, to integrate with the rustc workspace. This
also pulls in `compiler-builtins` via `rustc-std-workspace-core`.

Closes: rust-lang#145594
@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 19, 2025
@rust-log-analyzer

This comment has been minimized.

@Kobzol
Copy link
Member

Kobzol commented Aug 19, 2025

Oh, good catch! When I take a look e.g. at the unwind, which is also a dependency of std, it depends on core like this:

core = { path = "../rustc-std-workspace-core", package = "rustc-std-workspace-core" }

Why did you decide to use version = "1.0.0"?

@joshtriplett
Copy link
Member Author

Oh, good catch! When I take a look e.g. at the unwind, which is also a dependency of std, it depends on core like this:

core = { path = "../rustc-std-workspace-core", package = "rustc-std-workspace-core" }

Why did you decide to use version = "1.0.0"?

The path isn't strictly needed, given that the top-level workspace uses [patch] to replace the crate. And using a version and relying on that [patch] allows the crate to potentially build outside the Rust workspace. Whether that's ever needed or not is a separate question, but the two are equivalent so it seemed reasonable to allow for it.

@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2025

These commits modify the library/Cargo.lock file. Unintentional changes to library/Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@ehuss
Copy link
Contributor

ehuss commented Aug 19, 2025

r? @tgross35

@rustbot rustbot assigned tgross35 and unassigned Mark-Simulacrum Aug 19, 2025
@tgross35
Copy link
Contributor

Makes sense, I probably should have gotten this one in daf3534 as well.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 19, 2025

📌 Commit 4c948bc has been approved by tgross35

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 Aug 19, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 19, 2025
…=tgross35

`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins`

rust-lang#145489 changed `std_detect` to no
longer depend on `cfg-if`, which meant it no longer indirectly pulled in
`rustc-std-workspace-core` via `cfg-if`. That caused it to no longer
depend on `compiler-builtins`.

Change `std_detect` to use `rustc-std-workspace-core` and
`rustc-std-workspace-alloc`, to integrate with the rustc workspace. This
also pulls in `compiler-builtins` via `rustc-std-workspace-core`.

Closes: rust-lang#145594
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 19, 2025
…=tgross35

`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins`

rust-lang#145489 changed `std_detect` to no
longer depend on `cfg-if`, which meant it no longer indirectly pulled in
`rustc-std-workspace-core` via `cfg-if`. That caused it to no longer
depend on `compiler-builtins`.

Change `std_detect` to use `rustc-std-workspace-core` and
`rustc-std-workspace-alloc`, to integrate with the rustc workspace. This
also pulls in `compiler-builtins` via `rustc-std-workspace-core`.

Closes: rust-lang#145594
bors added a commit that referenced this pull request Aug 20, 2025
Rollup of 13 pull requests

Successful merges:

 - #139357 (Fix parameter order for `_by()` variants of `min` / `max`/ `minmax` in `std::cmp`)
 - #140314 (Rustdoc: typecheck scrape-examples.js)
 - #140794 (mention lint group in default level lint note)
 - #145006 (Clarify EOF handling for `BufRead::skip_until`)
 - #145252 (Demote x86_64-apple-darwin to Tier 2 with host tools)
 - #145359 (Fix bug where `rustdoc-js` tester would not pick the right `search.js` file if there is more than one)
 - #145381 (Implement feature `int_lowest_highest_one` for integer and NonZero types)
 - #145417 (std_detect: RISC-V platform guide documentation)
 - #145531 (Add runtime detection for APX-F and AVX10)
 - #145619 (`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins`)
 - #145622 (Remove the std workspace patch for `compiler-builtins`)
 - #145623 (Pretty print the name of an future from calling async closure)
 - #145626 (add a fallback implementation for the `prefetch_*` intrinsics )

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 84c5d20 into rust-lang:master Aug 20, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 20, 2025
rust-timer added a commit that referenced this pull request Aug 20, 2025
Rollup merge of #145619 - joshtriplett:use-the-right-core, r=tgross35

`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins`

#145489 changed `std_detect` to no
longer depend on `cfg-if`, which meant it no longer indirectly pulled in
`rustc-std-workspace-core` via `cfg-if`. That caused it to no longer
depend on `compiler-builtins`.

Change `std_detect` to use `rustc-std-workspace-core` and
`rustc-std-workspace-alloc`, to integrate with the rustc workspace. This
also pulls in `compiler-builtins` via `rustc-std-workspace-core`.

Closes: #145594
@joshtriplett joshtriplett deleted the use-the-right-core branch August 21, 2025 01:24
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 21, 2025
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#139357 (Fix parameter order for `_by()` variants of `min` / `max`/ `minmax` in `std::cmp`)
 - rust-lang/rust#140314 (Rustdoc: typecheck scrape-examples.js)
 - rust-lang/rust#140794 (mention lint group in default level lint note)
 - rust-lang/rust#145006 (Clarify EOF handling for `BufRead::skip_until`)
 - rust-lang/rust#145252 (Demote x86_64-apple-darwin to Tier 2 with host tools)
 - rust-lang/rust#145359 (Fix bug where `rustdoc-js` tester would not pick the right `search.js` file if there is more than one)
 - rust-lang/rust#145381 (Implement feature `int_lowest_highest_one` for integer and NonZero types)
 - rust-lang/rust#145417 (std_detect: RISC-V platform guide documentation)
 - rust-lang/rust#145531 (Add runtime detection for APX-F and AVX10)
 - rust-lang/rust#145619 (`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins`)
 - rust-lang/rust#145622 (Remove the std workspace patch for `compiler-builtins`)
 - rust-lang/rust#145623 (Pretty print the name of an future from calling async closure)
 - rust-lang/rust#145626 (add a fallback implementation for the `prefetch_*` intrinsics )

r? `@ghost`
`@rustbot` modify labels: rollup
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-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error: can't find crate for compiler_builtins
8 participants