about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-08-13Auto merge of #144722 - ywxt:parallel-reproducibile, r=SparrowLiibors-0/+22
Fix parallel rustc not being reproducible due to unstable sorts of items Currently, A tuple `(DefId, SymbolName)` is used to determine the order of items in the final binary. However `DefId` is expected as non-deterministic, which leads to some not reproducible issues under parallel compilation. (See https://github.com/rust-lang/rust/issues/140425#issuecomment-3111802148) Theoretically, we don't need the sorting because the order of these items is already deterministic. However, codegen tests reply on the same order of items between in binary and source. So here we added a new option `codegen-source-order` to indicate whether sorting based on the order in source. For codegen tests, items are sorted according to the order in the source code, whereas in the normal path, no sorting is performed. Specially, for codegen tests, in preparation for parallel compilation potentially being enabled by default in the future, we use `Span` replacing `DefId` to make the order deterministic. This PR is purposed to fix rust-lang/rust#140425, but seemly works on rust-lang/rust#140413 too. This behavior hasn't added into any test until we have a test suit for the parallel frontend. (See https://github.com/rust-lang/rust/pull/143953) Related discussion: [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Async.20closures.20not.20reproducible.28.23140425.29) https://github.com/rust-lang/rust/pull/144576 Update rust-lang/rust#113349 r? `@oli-obk` cc `@lqd` `@cramertj` `@matthiaskrgr` `@Zoxc` `@SparrowLii` `@bjorn3` `@cjgillot` `@joshtriplett`
2025-08-13Rollup merge of #145320 - Kobzol:fix-cranelift-codegen-dist, r=shepmasterJakub Beránek-1/+5
Allow cross-compiling the Cranelift dist component Should help unblock https://github.com/rust-lang/rust/pull/145252 (https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/macos-13.20shutting.20down/with/534032174).
2025-08-13Rollup merge of #145269 - epage:test-env, r=jhprattJakub Beránek-4/+4
Deprecate RUST_TEST_* env variables Like with rust-lang/rust#139224, this is a documentation-only deprecation for now. Over time, we can - warn and then remove on use of unstable environment variables - warn on use of stable environment variables (no plan to remove due to compatibility) Longer term, we expect test runners, like `cargo test`, to provide the necessary mechanisms for environmental or persistent configuration (e.g. using cargo config which supports `.cargo/config.toml` as well as environment variables). This would include: - `RUST_TEST_THREADS` - `RUST_TEST_NOCAPTURE` - `RUST_TEST_SHUFFLE` (unstable) - `RUST_TEST_SHUFFLE_SEED` (unstable) The primary outcomes for this change are - Reducing the scope of what is expected for custom test harnesses to implement - Reduce the mechanisms that test runners, like `cargo test`, are expected to track when they are being bypassed to protect against negative interactions, e.g. `RUST_TEST_NOCAPTURE=1` when json output is being read. For testing-devex FCP, see rust-lang/testing-devex-team#10 Fixes rust-lang/testing-devex-team#10 History ------- At each step, I could not find evidence of design discussions on whether to support CLI, env, or both. The first env variable seems to come from the fact that it was being forked out of an existing env variable that had a much wider scope. At best, this seems like a way to offer a more persistent configuration for these flags but environment variables hidden away in libtest is a bit clunky and this seems like the wrong layer to handle this problem. **Originally:** `RUST_THREADS` was respected by the Rust runtime and libextra/test got this for free **2013:** rust-lang/rust#7335 suggested splitting `RUST_TEST_TASKS` out of `RUST_THREADS`. In that issue and the implementation (rust-lang/rust#8823). **2014:** rust-lang/rust#13374 ask for support to disable capturing of stdout/stderr. `--nocapture` and `RUST_TEST_NOCAPTURE` were added together. **2015:** rust-lang/rust#23525 renamed `RUST_TEST_TASKS` to `RUST_TEST_THREADS` **2016:** rust-lang/rust#25636 asked to configure `RUST_TEST_THREADS` via `--test-threads` which was implemented in rust-lang/rust#35414 **2021:** rust-lang/rust#85440 asked for test randomization which was implemented in rust-lang/rust#89082, adding `--shuffle` / RUST_TEST_SHUFFLE` and `--shuffle-seed SEED` / `RUST_TEST_SHUFFLE_SEED` Potentially relevant issues --------------------------- - rust-lang/rust#74845
2025-08-13Rollup merge of #144870 - Kivooeo:file_prefix-stabilize, r=tgross35Jakub Beránek-1/+1
Stabilize `path_file_prefix` feature This stabilises `Path::file_prefix`, following the FCP in [tracking issue ](https://github.com/rust-lang/rust/issues/86319) (FCP ended almost a year ago, so if it's needed for proccess we could rerun it) Closes: https://github.com/rust-lang/rust/issues/86319
2025-08-13Fix pgo testsywxt-0/+6
2025-08-13Fix parallel rustc not being reproducible due to unstable sorting of items.ywxt-0/+16
2025-08-12Auto merge of #145295 - Kobzol:unify-stages, r=jieyouxubors-266/+241
Consolidate stage directories and group logs in bootstrap My post-stage-0-redesign bootstrap fixes aren't done yet, but I think that enough steps have been migrated to the new system that it makes sense to actually modify the directories on disk, and what gets printed when bootstrap runs, so that it actually corresponds to the new system. Before, the printed stages didn't always make sense. This PR: - Fixes the numbering of `stageN` directories in the build directory. It was not corresponding to the correct stages before; notice that I did not modify `bootstrap/README.md`, as it was essentially describing what happens after this PR (first commit). - Unifies all steps that output a build group to use the `Builder::msg` method. It's probably not the final stage, and some of the test steps might not be fully accurate yet, because I didn't fix test step numbering yet, but I think that it's a clear improvement from before, and now that everything uses the same method, we can easily make changes across the board, to ensure that it stays unified (second commit). r? `@jieyouxu` try-job: dist-x86_64-msvc try-job: dist-x86_64-linux
2025-08-12Allow cross-compiling the Cranelift dist componentJakub Beránek-1/+5
2025-08-12Add change tracker entryJakub Beránek-0/+5
2025-08-12Replace `stage0-tools-bin` with `stage1-tools-bin`Jakub Beránek-5/+5
2025-08-12Auto merge of #144678 - jdonszelmann:no-mangle-extern, r=bjorn3bors-3/+3
Make no_mangle on foreign items explicit instead of implicit for a followup PR I'm working on I need some foreign items to mangle. I could add a new attribute: `no_no_mangle` or something silly like that but by explicitly putting `no_mangle` in the codegen fn attrs of foreign items we can default it to `no_mangle` and then easily remove it when we don't want it. I guess you'd know about this r? `@bjorn3.` Shouldn't be too hard to review :) Builds on rust-lang/rust#144655 which should merge first.
2025-08-12Resolve review remarksJakub Beránek-9/+5
2025-08-12Rollup merge of #145291 - Zalathar:no-warning, r=KobzolStuart Cook-1/+1
bootstrap: Only warn about `rust.debug-assertions` if downloading rustc The changes in rust-lang/rust#145149 had the unwanted side-effect of causing bootstrap to *always* warn about `rust.debug-assertions = true`, even if rustc isn't going to be downloaded anyway. cc ``@Shourya742`` ``@Kobzol``
2025-08-12Rollup merge of #145273 - estebank:not-not, r=samueltardieuStuart Cook-56/+144
Account for new `assert!` desugaring in `!condition` suggestion `rustc` in https://github.com/rust-lang/rust/pull/122661 is going to change the desugaring of `assert!` to be ```rust match condition { true => {} _ => panic!(), } ``` which will make the edge-case of `condition` being `impl Not<Output = bool>` while not being `bool` itself no longer a straightforward suggestion, but `!!condition` will coerce the expression to be `bool`, so it can be machine applicable. Transposing https://github.com/rust-lang/rust-clippy/pull/15453/ to the rustc repo. r? `````@samueltardieu`````
2025-08-12Rollup merge of #145263 - rustbot:docs-update, r=ehussStuart Cook-0/+0
Update books ## rust-lang/reference 6 commits in 1be151c051a082b542548c62cafbcb055fa8944f..59b8af811886313577615c2cf0e045f01faed88b 2025-08-10 18:21:53 UTC to 2025-08-08 01:00:04 UTC - Add LoongArch32 to inline-assembly documentation (rust-lang/reference#1942) - Update `no_builtins` to use the attribute template (rust-lang/reference#1909) - Update `global_allocator` to use the attribute template (rust-lang/reference#1919) - Update `windows_subsystem` to use the attribute template (rust-lang/reference#1920) - Remove note on accepted invalid `should_panic` syntax (rust-lang/reference#1955) - specify relative drop order of pattern bindings (rust-lang/reference#1953) ## rust-lang/rust-by-example 1 commits in bd1279cdc9865bfff605e741fb76a0b2f07314a7..adc1f3b9012ad3255eea2054ca30596a953d053d 2025-08-08 12:02:24 UTC to 2025-08-08 12:02:24 UTC - Update Chinese translations in `zh.po` (rust-lang/rust-by-example#1950)
2025-08-12Rollup merge of #145253 - Kobzol:pr-check-2-doc-stage-1, r=jieyouxuStuart Cook-3/+3
Document compiler and stdlib in stage1 in `pr-check-2` CI job This restores the original behavior pre-https://github.com/rust-lang/rust/pull/145011 (I thought that stage 2 makes more sense here, but it made the job ~30m slower, which is bad). Let's see what will be the "new" duration, it should be ~55 minutes. r? ```````@jieyouxu```````
2025-08-12Rollup merge of #145251 - tiif:support_trait, r=BoxyUwUStuart Cook-1/+6
Support using #[unstable_feature_bound] on trait This is needed to unblock https://github.com/rust-lang/rust/pull/145095 r? ```````@BoxyUwU```````
2025-08-12Rollup merge of #145249 - Stypox:_span-to-_trace, r=joshtriplettStuart Cook-12/+12
Rename entered trace span variables from `_span` to `_trace` This PR just changes the name of `EnteredTraceSpan` variables used to automatically close tracing spans when going out of scope. This renaming was needed because `_span` could possibly be confused with the `Span` type in rustc, so I used `_trace` as suggested in https://github.com/rust-lang/rust/pull/144727#discussion_r2247267670.
2025-08-12Rollup merge of #145238 - estebank:attr-overhaul, r=jdonszelmannStuart Cook-0/+2
Tweak invalid builtin attribute output - Add link to reference/docs when possible - More accurate suggestions by supporting multiple alternative suggestions ``` error: malformed `crate_type` attribute input --> $DIR/crate-type-macro-call.rs:1:1 | LL | #![crate_type = foo!()] | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: for more information, visit <https://doc.rust-lang.org/reference/linkage.html> help: the following are the possible correct uses | LL - #![crate_type = foo!()] LL + #![crate_type = "bin"] | LL - #![crate_type = foo!()] LL + #![crate_type = "cdylib"] | LL - #![crate_type = foo!()] LL + #![crate_type = "dylib"] | LL - #![crate_type = foo!()] LL + #![crate_type = "lib"] | = and 4 other candidates ```
2025-08-12Rollup merge of #145216 - eval-exec:fix-145125-enum-rustdoc, r=fmeaseStuart Cook-5/+3
rustdoc: correct negative-to-implicit discriminant display This PR want to fix rust-lang/rust#145125 In: https://github.com/rust-lang/rust/blob/7f7b8ef27d86c865a7ab20c7c42f50811c6a914d/compiler/rustc_middle/src/ty/util.rs#L33-L38 the `Discr`'s `val` field is `u128`, so we can't use `discr.val as i128` to represent `Discr`'s signed value. We should use `Discr`'s `Display` trait to display signed value. https://github.com/rust-lang/rust/blob/7f7b8ef27d86c865a7ab20c7c42f50811c6a914d/compiler/rustc_middle/src/ty/util.rs#L60-L73
2025-08-12Rollup merge of #144921 - lolbinarycat:rustdoc-intra-doc-gfm-141866, ↵Stuart Cook-2/+14
r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang/rust#141866
2025-08-12Rollup merge of #144386 - camsteffen:imploftrait, r=fmeaseStuart Cook-121/+101
Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
2025-08-12Rollup merge of #131477 - madsmtm:sdkroot-via-env-var, r=nnethercoteStuart Cook-1/+1
Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var Fixes https://github.com/rust-lang/rust/issues/80817, fixes https://github.com/rust-lang/rust/issues/96943, and generally simplifies our linker invocation on Apple platforms. Part of https://github.com/rust-lang/rust/issues/129432. ### Necessary background on trampoline binaries The developer binaries such as `/usr/bin/cc` and `/usr/bin/clang` are actually trampolines (similar in spirit to the Rust binaries in `~/.cargo/bin`) which effectively invokes `xcrun` to get the current Xcode developer directory, which allows it to find the actual binary under `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/*`. This binary is then launched with the following environment variables set (but none of them are set if `SDKROOT` is set explicitly): - `SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk` - `LIBRARY_PATH=/usr/local/lib` (appended) - `CPATH=/usr/local/include` (appended) - `MANPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man:` (prepended) This allows the user to type e.g. `clang foo.c` in their terminal on macOS, and have it automatically pick up a suitable Clang binary and SDK from either an installed Xcode.app or the Xcode Command Line Tools. (It acts roughly as-if you typed `xcrun -sdk macosx clang foo.c`). ### Finding a suitable SDK All compilation on macOS is cross-compilation using SDKs, there are no system headers any more (`/usr/include` is gone), and the system libraries are elsewhere in the file system (`/usr/lib` is basically empty). Instead, the logic for finding the SDK is handled by the `/usr/bin/cc` trampoline (see above). But relying on the `cc` trampoline doesn't work when: - Cross-compiling, since a different SDK is needed there. - Invoking the linker directly, since the linker doesn't understand `SDKROOT`. - Linking build scripts inside Xcode (see https://github.com/rust-lang/rust/issues/80817), since Xcode prepends `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin` to `PATH`, which means `cc` refers to the _actual_ Clang binary, and we end up with the wrong SDK root specified. Basically, we cannot rely on the trampoline at all, so the last commit removes the special-casing that was done when linking with `cc` for macOS (i.e. the most common path), so that **we now always invoke `xcrun` (if `SDKROOT` is not explicitly specified) to find the SDK root**. Making sure this is non-breaking has a few difficulties though, namely that the user might not have Xcode installed, and that the compiler driver may not understand the `-isysroot` flag. These difficulties are explored below. #### No Xcode There are several compiler drivers which work without Xcode by bundling their own SDK, including `zig cc`, Nixpkgs' `clang` and Homebrew's `llvm` package. Additionally, `xcrun` is rarely available when cross-compiling from non-macOS and instead the user might provide a downloaded SDK manually with `-Clink-args=...`. We do still want to _try_ to invoke `xcrun` if possible, since it is usually the SDK that the user wants (and if not, the environment should override `xcrun`, such as is done by Nixpkgs). But we do not want failure to invoke `xcrun` to stop the linking process. This is changed in the second-to-last commit. #### `SDKROOT` vs. `-isysroot` The exact reasoning why we do not always pass the SDK root when linking on macOS eludes me (the git history dead ends in rust-lang/rust#100286), but I suspect it's because we want to support compiler drivers which do not support the `-isysroot` option. To make sure that such use-cases continue to work, we now pass the SDK root via the `SDKROOT` environment variable. This way, compiler drivers that support setting the SDK root (such as Clang and GCC) can use it, while compiler drivers that don't (presumably because they figure out the SDK in some other way) can just ignore it. One small danger here would be if there's some compiler driver out there which works with the `-isysroot` flag, but not with the `SDKROOT` environment variable. I am not aware of any? In a sense, this also shifts the blame; if a compiler driver does not understand `SDKROOT`, it won't work with e.g. `xcrun -sdk macosx15.0 $tool` either, so it can more clearly be argued that this is incorrect behaviour on the part of the tool. Note also that this overrides the behaviour discussed above (`/usr/bin/cc` sets some extra environment variables), I will argue that is fine since `MANPATH` and `CPATH` is useless when linking, and `/usr/local/lib` is empty on a default system at least since macOS 10.14 (it might be filled by extra libraries installed by the user, but I'll argue that if we want it to be part of the default library search path, we should set it explicitly so that it's also set when linking with `-Clinker=ld`). ### Considered alternatives - Invoke `/usr/bin/cc` instead of `cc`. - This breaks many other use-cases though where overriding `cc` in the PATH is desired. - Look up `which cc`, and do special logic if in Xcode toolchain. - Seems brittle, and besides, it's not the `cc` in the Xcode toolchain that's wrong, it's the `/usr/bin/cc` behaviour that is a bit too magical. - Invoke `xcrun --sdk macosx cc`. - This completely ignores `SDKROOT`, so we'd still have to parse that first to figure out if it's suitable or not, but would probably be workable. - Maybe somehow configure the linker with extra flags such that it'll be able to link regardless of linking for macOS or e.g. iOS? Though I doubt this is possible. - Bundle the SDK, similar to `zig-cc`. - Comes with it's own host of problems. ### Testing Tested that this works with the following `-Clinker=...`: - [x] Default (`cc`) - [x] `/usr/bin/ld` - [x] Actual Clang from Xcode (`/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang`) - [x] `/usr/bin/clang` (invoked via `clang` instead of `cc`) - [x] Homebrew's `llvm` package (ignores `SDKROOT`, uses their own SDK) - [x] Homebrew's `gcc` package (`SDKROOT` is preferred over their own SDK) - [x] ~Macports `clang`~ Couldn't get it to build - [x] Macports `gcc` (`SDKROOT` is preferred over their own SDK) - [x] Zig CC installed via. homebrew (ignores both `-isysroot` and `SDKROOT`, uses their own SDK) - [x] Nixpkgs `clang` (ignores `SDKROOT`, uses their own SDK) - [x] Nixpkgs `gcc` (ignores `SDKROOT`, uses their own SDK) - [x] ~[`cosmocc`](https://github.com/jart/cosmopolitan)?~ Doesn't accept common flags (like `-arch`) CC ```````@BlackHoleFox``````` ```````@thomcc```````
2025-08-12make no_mangle explicit on foreign itemsJana Dönszelmann-3/+3
2025-08-12Change format of messages in `Builder::fmt`Jakub Beránek-2/+3
2025-08-12Unify all groups in bootstrap to use `Builder::msg`Jakub Beránek-239/+206
2025-08-12Consolidate stageN directories in the build directoryJakub Beránek-18/+24
Now stageN-X corresponds to stage N X, as it should.
2025-08-12bootstrap: Only warn about `rust.debug-assertions` if downloading rustcZalathar-1/+1
2025-08-11Propagate TraitImplHeader to hirCameron Steffen-63/+70
2025-08-11Extract ast TraitImplHeaderCameron Steffen-58/+31
2025-08-11Account for new `assert!` desugaring in `!condition` suggestionEsteban Küber-56/+144
`rustc` is going to change the desugaring of `assert!` to be ```rust match condition { true => {} _ => panic!(), } ``` which will make the edge-case of `condition` being `impl Not<Output = bool>` while not being `bool` itself no longer a straightforward suggestion, but `!!condition` will coerce the expression to be `bool`, so it can be machine applicable.
2025-08-11Pass Apple SDK root to compiler driver via SDKROOT env varMads Marquart-1/+1
This is more in-line with what Apple's tooling expects, and allows us to better support custom compiler drivers (such as certain Homebrew and Nixpkgs compilers) that prefer their own `-isysroot` flag. Effectively, we now invoke the compiler driver as-if it was invoked as `xcrun -sdk $sdk_name $tool`.
2025-08-11Deprecate RUST_TEST_* env variablesEd Page-4/+4
This is a documentation-only deprecation for now. Over time, we can - warn and then remove on use of unstable environment variables - warn on use of stable environment variables (no plan to remove due to compatibility) Longer term, we expect test runners, like `cargo test`, to provide the necessary mechanisms for environmental or persistent configuration (e.g. using cargo config which supports `.cargo/config.toml` as well as environment variables). This would include: - `RUST_TEST_THREADS` - `RUST_TEST_NOCAPTURE` - `RUST_TEST_SHUFFLE` (unstable) - `RUST_TEST_SHUFFLE_SEED` (unstable) The primary outcomes for this change are - Reducing the scope of what is expected for custom test harnesses to implement - Reduce the mechanisms that test runners, like `cargo test`, are expected to track when they are being bypassed to protect against negative interactions, e.g. `RUST_TEST_NOCAPTURE=1` when json output is being read.
2025-08-11fix clippy testEsteban Küber-0/+2
2025-08-11Auto merge of #145254 - GuillaumeGomez:rollup-7bp43pv, r=GuillaumeGomezbors-4/+6
Rollup of 4 pull requests Successful merges: - rust-lang/rust#144966 ( Improve suggestion for "missing function argument" on multiline call) - rust-lang/rust#145111 (remove some unused private trait impls) - rust-lang/rust#145221 (Fix Cargo cross-compilation (take two)) - rust-lang/rust#145247 (Update `sysinfo` version to `0.37.0`) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-11Update booksrustbot-0/+0
2025-08-11Auto merge of #145207 - Kobzol:codegen-backend-clif-dist, r=jieyouxubors-30/+45
Ship correct Cranelift library in its dist component The first commit adds a post-dist UI test to check that Cranelift can be used with the extracted dist x64 Linux archive. The original codegen copy logic in the Cranelift dist step was a bit redundant, and I didn't notice in https://github.com/rust-lang/rust/pull/144787 that it's copying the codegen backend from the build compiler's sysroot, rather than the target compiler's sysroot. The second commit modifies the logic to directly access the built codegen file (there is no need to search for it in the compiler's sysroot, in fact when you run just `x dist rustc_codegen_cranelift`, it shouldn't "taint" the sysroot with the codegen backend! Which it did before https://github.com/rust-lang/rust/pull/144787) and copy it to the tarball under a normalized name. Thus we get around any similar potential issues in the future, and make previously implicit logic more explicit. This also fixes running just `x dist rustc_codegen_cranelift` without enabling `cranelift` in `rust.codegen-backends`, which should have been enabled by https://github.com/rust-lang/rust/pull/144787, but it didn't work fully, because the dist step tried to copy the codegen backend from the compiler's sysroot, but it didn't contain the codegen backend if it was not enabled by `rust.codegen-backends`. Fixes: https://github.com/rust-lang/rust/issues/145201 try-job: dist-x86_64-linux
2025-08-11don't emit rustdoc::broken_intra_doc_links for stuff like [!NOTE]binarycat-2/+14
2025-08-11Document compiler and stdlib in stage1 in `pr-check-2` CI jobJakub Beránek-3/+3
2025-08-11Rollup merge of #145247 - GuillaumeGomez:update-sysinfo, r=KobzolGuillaume Gomez-4/+4
Update `sysinfo` version to `0.37.0` Some small performance improvements and internal cleanups.
2025-08-11Rollup merge of #145221 - Kobzol:cargo-dist-fix-2, r=jieyouxuGuillaume Gomez-0/+2
Fix Cargo cross-compilation (take two) In https://github.com/rust-lang/rust/pull/145083, I fixed the case of manually invoking `x dist cargo`, but I realized that `x install` creates the `tool::Cargo` step through the `from_build_frompiler` constructor, which doesn't go through `get_tool_target_compiler`. So we just prepare both the host and target stdlibs directly before building Cargo. Ideally we would get rid of `from_build_compiler`, but that will require refactoring the dist and test steps, which is upcoming. Hopefully fixes https://github.com/rust-lang/rust/issues/145059 for good.
2025-08-11Update rustc dev guidetiif-1/+6
2025-08-11Turn _span into _trace as trace span nameStypox-12/+12
_span could possibly be confused with the Span type in rustc
2025-08-11Update `sysinfo` version to `0.37.0`Guillaume Gomez-4/+4
2025-08-11Auto merge of #145215 - Kobzol:rust-backtrace, r=marcoienibors-0/+3
Enable RUST_BACKTRACE=1 on CI We should really see the backtrace if something in bootstrap fails on CI. https://github.com/rust-lang/rust/pull/145011#issuecomment-3172664934 doesn't show many details.
2025-08-11Auto merge of #145011 - Kobzol:bootstrap-doc, r=jieyouxubors-243/+514
Enforce in bootstrap that doc must have stage at least 1 Following with the bootstrap cleanups, this time around `doc` steps. Should be pretty straightforward, because the supporting infrastructure was already there. The only thing I found a bit fishy is using `Mode::ToolBootstrap` as a "catch-all" mode for non-rustc-private steps in `tool_doc!`, but I don't think that we need to distinguish the tools in some special way when documenting them, apart from supporting `rustc_private`. Before, `x doc` more or less defaulted to what we call stage 2 now. Now it is properly stage 1, so e.g. `x doc compiler` documents the compiler using the stage0/beta rust(do)c. r? `@jieyouxu` try-job: dist-aarch64-msvc
2025-08-11Rollup merge of #145149 - ↵Stuart Cook-306/+439
Shourya742:2025-07-08-convert-config-method-invoke-inside-parse-functions, r=Kobzol Make config method invoke inside parse use dwn_ctx This PR is part of a series of config refactorings. It removes calls from config methods to solid functions defined in `config.rs`. After this, we will remove the default dependencies in the config. r? ```@Kobzol```
2025-08-11Rollup merge of #143949 - clarfonthey:const-arith-ops, r=AmanieuStuart Cook-6/+3
Constify remaining traits/impls for `const_ops` Tracking issue: rust-lang/rust#143802 This is split into two commits for ease of reviewability: 1. Updates the `forward_ref_*` macros to accept multiple attributes (in anticipation of needing `rust_const_unstable` attributes) and also *require* attributes in these macros. Since the default attribute only helps for the initial implementations, it means it's easy to get wrong for future implementations, as shown for the saturating implementations which were incorrect before. 2. Actually constify the traits/impls. A few random other notes on the implementation specifically: * I unindented the attributes that were passed to the `forward_ref_*` macro calls because in some places rustfmt wanted them to be unindented, and in others it was allowed because they were themselves inside of macro bodies. I chose the consistent indenting even though I (personally) think it looks worse. ---- As far as the actual changes go, this constifies the following additional traits: * `Neg` * `Not` * `BitAnd` * `BitOr` * `BitXor` * `Shl` * `Shr` * `AddAssign` * `SubAssign` * `MulAssign` * `DivAssign` * `RemAssign` * `BitAndAssign` * `BitOrAssign` * `BitXorAssign` * `ShlAssign` * `ShrAssign` In terms of constified implementations of these traits, it adds the reference-forwarded versions of all the arithmetic operators, which are defined by the macros in `library/core/src/internal_macros.rs`. I'm not going to fully enumerate these because we'd be here all day, but sufficed to say, it effectively allows adding an `&` to one or both sides of an operator for primitives. Additionally, I constified the implementations for `Wrapping`, `Saturating`, and `NonZero` as well, since all of them forward to already-const-stable methods. (potentially via intrinsics, to avoid extra overhead) There are three "non-primitive" types which implement these traits, listed below. Note that I put "non-primitive" in quotes since I'm including `Wrapping`, `Saturating`, and `NonZero`, which are just wrappers over primitives. * `Duration` (arithmetic operations) * `SystemTime` (arithmetic operations) * `Ipv4Addr` (bit operations) * `Ipv6Addr` (bit operations) Additionally, because the methods on `SystemTime` needed to make these operations const were not marked const, a separate tracking issue for const-stabilising those methods is rust-lang/rust#144517. Stuff left out of this PR: * `Assume` (this could trivially be made const, but since the docs indicate this is still under heavy design, I figured I'd leave it out) * `Instant` (this could be made const, but cannot reasonably be constructed at constant time, so, isn't useful) * `SystemTime` (will submit separate PR) * SIMD types (I'm tackling these all at once later; see rust-lang/portable-simd#467) <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_CONCERN-ISSUE_START --> > [!NOTE] > # Concerns (0 active) > > - ~~[May break Clippy](https://github.com/rust-lang/rust/pull/143949#issuecomment-3081466077)~~ resolved in [this comment](https://github.com/rust-lang/rust/pull/143949#issuecomment-3083628215) > > *Managed by ```@rustbot`—see`` [help](https://forge.rust-lang.org/triagebot/concern.html) for details.* <!-- TRIAGEBOT_CONCERN-ISSUE_END --> <!-- TRIAGEBOT_END -->
2025-08-10Rollup merge of #145121 - ↵Jacob Pratt-0/+14
lambdageek:dist-must-keep-llvm-third-party-siphash, r=Kobzol bootstrap: `x.py dist rustc-src` should keep LLVM's siphash Fixes rust-lang/rust#145117
2025-08-10Fix Cargo cross-compilation (take two)Jakub Beránek-0/+2