about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-08-29Auto merge of #145997 - matthiaskrgr:rollup-tsgylre, r=matthiaskrgrbors-83/+30
Rollup of 4 pull requests Successful merges: - rust-lang/rust#145675 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#1 of Batch rust-lang/rust#2]) - rust-lang/rust#145676 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#2 of Batch rust-lang/rust#2]) - rust-lang/rust#145982 (compiletest: Reduce the number of `println!` calls that don't have access to `TestCx`) - rust-lang/rust#145984 (`TokenStream` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-29Auto merge of #145902 - Kobzol:dist-docs-build-compiler, r=jieyouxubors-80/+127
Avoid more rustc rebuilds in cross-compilation scenarios This is a continuation of https://github.com/rust-lang/rust/pull/145874. It adds a `compiler_for_std` function, which is a slimmed down version of `compiler_for`, which is much simpler, and designed to be used only for the standard library. The build, dist and doc steps somtimes work with a stage2 std for a given target. That currently requires building a stage2 host compiler. However, if we uplift the stage1 libstd anyway, that is wasteful, in particular when we are cross-compiling. The last two commits progressively make the stage 2 host rustc build avoidance more and more aggressive. I think that if we decide that it is fine to ship stage1 libstd everywhere, then it makes sense to go all the way. When we ship stuff, we always build it with the stage 1 compiler (e.g. we ship stage 2 rustc which is built with stage 1 rustc). Libstd is the only component where stage N is built with the stage N compiler. So I think that shipping stage 1 libstd is "enough", and we could thus optimize what gets built on CI. r? `@jieyouxu`
2025-08-29Rollup merge of #145982 - Zalathar:logv, r=jieyouxuMatthias Krüger-83/+30
compiletest: Reduce the number of `println!` calls that don't have access to `TestCx` In order to stop using `#![feature(internal_output_capture)]` in compiletest, we need to be able to capture the console output of individual tests run by the executor. The approach I have planned is to have all test runners print “console” output into a trait object that is passed around as part of `TestCx`, since almost all test-runner code has easy access to that context. So `println!("foo")` will become `writeln!(self.stdout, "foo")`, and so on. In order to make that viable, we need to avoid unnecessary printing in places that don't have easy access to `TestCx`. To do so, we can either get rid of unnecessary print statements, or rearrange the code to make the context available. This PR uses both approaches. r? jieyouxu
2025-08-29Don't print captures in `TestCx::normalize_platform_differences`Zalathar-7/+4
This appears to have been leftover debugging code. If the capture information turns out to have still been useful, we can find a way to emit it in a way that doesn't interfere with overhauling compiletests's output capture system.
2025-08-29Move module `compute_diff` into `compiletest::runtest`Zalathar-5/+4
The code in this module is always called in the context of running an individual tests, and sometimes prints output that needs to be captured. Moving this module into `runtest` will make it easier to find and audit all of the print statements that need to be updated when overhauling output-capture.
2025-08-29Change the `logv` function into a `TestCx` method.Zalathar-23/+19
When working on a new output-capture system, this will make it easier to obtain a capturing stream from the test context.
2025-08-29Don't bother logging an arbitrary subset of the compiletest configZalathar-48/+3
Running `./x --verbose` will still print out the command-line arguments, and setting `RUST_LOG=compiletest` will now log the full config instead of a subset.
2025-08-29Rollup merge of #145947 - nnethercote:workspace-members-2, r=KobzolStuart Cook-21/+21
Add more to the `[workspace.dependencies]` section in the top-level `Cargo.toml` Following on from rust-lang/rust#145740. r? `@Kobzol`
2025-08-28Rollup merge of #145920 - Zalathar:failure-stdout, r=jieyouxuGuillaume Gomez-1/+7
bootstrap: Explicitly mark the end of a failed test's captured output While working on some compiletest stuff, I noticed that when bootstrap prints a failed test's captured output, there's no indication of where that output actually ends. In addition to indicating where the captured output ends, this end marker also makes it easier to see the relevant test name when scrolling upwards in terminal output.
2025-08-28Rollup merge of #142472 - GuillaumeGomez:doc-attribute-attribute, r=fmeaseGuillaume Gomez-26/+126
Add new `doc(attribute = "...")` attribute Fixes rust-lang/rust#141123. The implementation and purpose of this new `#[doc(attribute = "...")]` attribute is very close to `#[doc(keyword = "...")]`. Which means that luckily for us, most of the code needed was already in place and `@Noratrieb` nicely wrote a first draft that helped me implement this new attribute very fast. Now with all this said, there is one thing I didn't do yet: adding a `rustdoc-js-std` test. I added GUI tests with search results for attributes so should be fine but I still plan on adding one for it once documentation for builtin attributes will be written into the core/std libs. You can test it [here](https://rustdoc.crud.net/imperio/doc-attribute-attribute/foo/index.html). cc `@Noratrieb` `@Veykril`
2025-08-28Create new `Item::is_fake_item` method as equivalent to check for ↵Guillaume Gomez-2/+13
`is_primitive`, `is_keyword` and `is_attribute` methods
2025-08-28Add documentation for `doc(attribute = "...")` attributeGuillaume Gomez-1/+18
2025-08-28Add new `doc(attribute = "...")` attributeGuillaume Gomez-25/+97
2025-08-28Rollup merge of #145953 - robertbastian:master, r=ManishearthStuart Cook-6/+6
Update `icu_list` to 2.0 This updates the `icu_list` crate, which is used for error formatting, from 1.5 to 2.0.
2025-08-28Rollup merge of #145926 - Zalathar:no-libtest, r=jieyouxuStuart Cook-90/+53
compiletest: Remove several remnants of the old libtest-based executor I noticed a few bits of low-hanging cleanup that are possible now that the non-libtest executor is well and truly established.
2025-08-28Add `rustc-demangle` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-08-28Add `rustc-hash` to `[workspace.dependencies]`.Nicholas Nethercote-2/+2
2025-08-28Add `indexmap` to `[workspace.dependencies]`.Nicholas Nethercote-2/+2
2025-08-28Add `tempfile` to `[workspace.dependencies]`.Nicholas Nethercote-3/+3
2025-08-28Add `serde_json` to `[workspace.dependencies]`.Nicholas Nethercote-11/+11
2025-08-28Add `libc` to `[workspace.dependencies]`.Nicholas Nethercote-2/+2
2025-08-28Use default locale fallback dataRobert Bastian-1/+1
2025-08-28Bump icu_list to 2.0Robert Bastian-5/+5
2025-08-28Auto merge of #145891 - nikic:llvm-21.1.0, r=cuviperbors-0/+0
Update to LLVM 21.1.0
2025-08-27Auto merge of #145851 - lolbinarycat:rustdoc-optimize, r=GuillaumeGomezbors-17/+17
rustdoc: a few micro-optimizations targeted at build_impl Unsure if these will be anything substantial, but the first one at least should git rid of quite a few branches, second one unsure if it's worth it. r? `@GuillaumeGomez`
2025-08-27Auto merge of #145909 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo submodule 3 commits in 623d536836b4cde09ce38609232a024d5b25da81..a6c58d43051d01d83f55a3e61ef5f5b2b0dd6bd9 2025-08-22 19:05:52 +0000 to 2025-08-26 23:05:12 +0000 - test: avoid hardcoded target spec json (rust-lang/cargo#15880) - test(add): Cover some frontmatter corner cases (rust-lang/cargo#15886) - Add more context to publish-failed error message (rust-lang/cargo#15879) r? ghost
2025-08-27Remove several remnants of the old libtest-based executorZalathar-90/+53
2025-08-27Rollup merge of #145885 - madsmtm:lldb-inherit-tcc, r=KobzolMatthias Krüger-0/+29
Inherit TCC in debuginfo tests on macOS macOS has a system for propagating folder permissions, which LLDB disables when spawning processes, which in turn causes debuginfo tests to spam the user with repeated pop-ups asking for permissions. See the code comment for details, as well as the following video for an example of how this looks in practice: https://github.com/user-attachments/assets/1e54f5b8-9130-4b59-8e92-1db1e58fb361 I stumbled upon the incantation to fix this (`settings set target.inherit-tcc true`) while investigating slowdowns when spawning newly created binaries due to XprotectService, see [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/build.20scripts.20slow.20on.20macOS.3F). This would allow me to no longer have a `build.build-dir = "/Users/madsmtm/rust-build"` workaround in my `bootstrap.toml`.
2025-08-27Rollup merge of #145740 - nnethercote:workspace-members, r=KobzolMatthias Krüger-6/+6
Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml` It lets us avoid a lot of repetition of crate versions, etc. I've just done a few as a start. Many more can be done in follow-ups. r? `@Kobzol`
2025-08-27Explicitly mark the end of a failed test's captured outputZalathar-1/+7
2025-08-27Use std uplifting more oftenJakub Beránek-40/+20
2025-08-27Use `compiler_for_std` in `dist::Std`Jakub Beránek-59/+59
2025-08-27Add `compiler_for_std`Jakub Beránek-3/+13
2025-08-27Add metadata to `dist::JsonDocs`Jakub Beránek-1/+17
2025-08-27Add snapshot test for rustc docsJakub Beránek-0/+41
2025-08-27Rollup merge of #145904 - Kobzol:riscv-musl-platform-support, r=jieyouxuMatthias Krüger-1/+1
Move `riscv64-gc-unknown-linux-musl` from Tier 2 with Host tools to Tier 2 It is not shipped with host tools, so it was located in the wrong group. The musl target is [here](https://github.com/rust-lang/rust/blob/467c89cd0b1c579edc247808c35941677918d29d/src/ci/docker/host-x86_64/dist-various-2/Dockerfile#L126) - no host tools. Noticed in https://github.com/rust-lang/docker-rust/pull/247.
2025-08-27Rollup merge of #145335 - clarfonthey:wtf8-core-alloc, r=Mark-SimulacrumMatthias Krüger-0/+1
Move WTF-8 code from std into core and alloc This is basically a small portion of rust-lang/rust#129411 with a smaller scope. It *does not*\* affect any public APIs; this code is still internal to the standard library. It just moves the WTF-8 code into `core` and `alloc` so it can be accessed by `no_std` crates like `backtrace`. > \* The only public API this affects is by adding a `Debug` implementation to `std::os::windows::ffi::EncodeWide`, which was not present before. This is due to the fact that `core` requires `Debug` implementations for all types, but `std` does not (yet) require this. Even though this was ultimately changed to be a wrapper over the original type, not a re-export, I decided to keep the `Debug` implementation so it remains useful. Like we do with ordinary strings, the tests are still located entirely in `alloc`, rather than splitting them into `core` and `alloc`. ---- Reviewer note: for ease of review, this is split into three commits: 1. Moving the original files into their new "locations" 2. Actually modifying the code to compile. 3. Removing aesthetic changes that were made so that the diff for commit 2 was readable. You can review commits 1 and 3 to verify these claims, but commit 2 contains the majority of the changes you should care about. ---- API changes: `impl Debug for std::os::windows::ffi::EncodeWide`
2025-08-27Add `itertools` to `[workspace.dependencies]`.Nicholas Nethercote-2/+2
2025-08-27Add `tracing` to `[workspace.dependencies]`.Nicholas Nethercote-4/+4
2025-08-26Update cargo submoduleWeihang Lo-0/+0
2025-08-26Auto merge of #145906 - samueltardieu:rollup-p8ibzhz, r=samueltardieubors-74/+103
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`) - rust-lang/rust#145790 (Improve dist for gnullvm hosts) - rust-lang/rust#145792 (Use attribute name in message for "outer attr used as inner attr" errors) - rust-lang/rust#145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags) - rust-lang/rust#145876 (Enable building/disting standard library in stage 0) - rust-lang/rust#145887 (bootstrap: Don't panic if codegen-backends is set to empty) - rust-lang/rust#145888 (platform-support: Fix LoongArch32 host column) - rust-lang/rust#145892 (add a flag to codegen fn attrs for foreign items) - rust-lang/rust#145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-26Rollup merge of #145892 - jdonszelmann:codegen-fn-attrs-foreign-item, r=bjorn3Samuel Tardieu-4/+3
add a flag to codegen fn attrs for foreign items r? `@ghost` refiled to rerun CI
2025-08-26Rollup merge of #145888 - heiher:fix-platform-support-loong32, r=jieyouxuSamuel Tardieu-2/+2
platform-support: Fix LoongArch32 host column
2025-08-26Rollup merge of #145887 - GuillaumeGomez:bootstrap-codegen-backends, r=KobzolSamuel Tardieu-12/+10
bootstrap: Don't panic if codegen-backends is set to empty It fixes a bug we encountered in our last GCC backend sync: https://github.com/rust-lang/rustc_codegen_gcc/actions/runs/17214525469/job/48834700055?pr=753#step:18:595 In short, we used to have in `bootstrap.toml` an empty `rust.codegen-backends = []`, triggering the `unwrap`. We fixed it in https://github.com/rust-lang/rustc_codegen_gcc/pull/753/commits/ad99858fd9056bd29e96898be0f5e01ef527a092. r? `@Kobzol`
2025-08-26Rollup merge of #145876 - Kobzol:dist-std-build, r=jieyouxuSamuel Tardieu-26/+79
Enable building/disting standard library in stage 0 After the stage0 redesign, building a stage0 library no longer is a thing, because the stage0 compiler normally cannot build libstd anymore. However, there are valid use-cases for having the ability to quickly cross-compile libstd for different targets, when the stage0 compiler is e.g. a stable released version, and you want to cross-compile libstd from the same sources of that compiler. This PR allows that, as long as you set `build.local-rebuild = true`, which promises bootstrap that the stage0 compiler actually comes from in-tree sources, and can thus compile libstd. The change needed to enable this is very minimal, so I think that it is worth it to allow this use-case to work. Fixes: https://github.com/rust-lang/rust/issues/145587 Fixes: https://github.com/rust-lang/rust/issues/145859 Related issue: https://github.com/rust-lang/rust/issues/94781 r? `@jieyouxu`
2025-08-26Rollup merge of #145790 - mati865:gnullvm-improve-dist, r=KobzolSamuel Tardieu-30/+4
Improve dist for gnullvm hosts LLVM tools cross-compilation has been fixed by rust-lang/rust#145763 and LLVM downloading from CI no longer causes build error, so let's enable them both.
2025-08-26Rollup merge of #144499 - Enselic:ci-debuginfo-level-tests, r=davidtwcoSamuel Tardieu-0/+5
ci: Begin running ui tests with `rust.debuginfo-level-tests=1` To reduce risk of regressing on generating debuginfo e.g. in the form of ICE:s. This will also ensure that future ui tests work with different debuginfo levels. See https://github.com/rust-lang/rust/issues/61117. When I looked at run time for different CI jobs, **x86_64-gnu-debug** was far from the bottleneck, so it should be fine to make it perform more work. A handful of tests are failing so we need to force debuginfo=0 on those for now. We'll start small with debuginfo=1. We'll step up to debuginfo=2 once most (all?) tests can handle debuginfo=1. There are more failures with debuginfo=2 than with debuginfo=1.
2025-08-26Move `riscv64-gc-unknown-linux-musl` from Tier 2 with Host tools to Tier 2Jakub Beránek-1/+1
It is not shipped with host tools, so it was located in the wrong group.
2025-08-26Enable building/disting standard library in stage 0Jakub Beránek-26/+79
2025-08-26Auto merge of #145890 - GuillaumeGomez:subtree-update_cg_gcc_2025-08-26, ↵bors-0/+0
r=GuillaumeGomez GCC backend subtree update cc `@antoyo` r? ghost