Commit Graph

4133 Commits

Author SHA1 Message Date
bors 41985fb8b4 Auto merge of #141272 - Shourya742:2025-05-18-modularize-config-module, r=Kobzol
modularize the config module bootstrap

Currently, our `config` module is quite large over 3,000 lines, and handles a wide range of responsibilities. This PR aims to break it down into smaller, more focused submodules to improve readability and maintainability:

* **`toml`**: Introduces a dedicated `toml` submodule within the `config` module. Its sole purpose is to define configuration-related structs along with their corresponding deserialization logic. It also contains the `parse_inner` method, which serves as the central function for extracting relevant information from the TOML structs and constructing the final configuration.

* **`rust`, `dist`, `install`, `llvm`, `build`, `gcc`, and others**: Each of these modules contains TOML subsections specific to their domain, along with the logic necessary to convert them into parts of the final configuration struct.

* **`config/mod.rs`**: Contains shared types and enums used across multiple TOML subsections.

* **`config/config.rs`**: Houses the logic that integrates all the TOML subsections into the complete configuration struct.

r? `@kobzol`
2025-06-06 04:32:56 +00:00
bors 4b740a3b8b Auto merge of #140872 - bjorn3:elf_use_used_linker, r=nikic
Make #[used(linker)] the default on ELF too

`#[used]` currently is an alias for `#[used(linker)]` on all platforms except ELF based ones where it is an alias for `#[used(compiler)]`. The latter has surprising behavior and the LLVM LangRef explicitly states that it "should only be used in rare circumstances, and should not be exposed to source languages." [^2]

The reason `#[used]` still was an alias to `#[used(compiler)]` on ELF is because the gold linker has issues with it. Luckily gold has been deprecated with GCC 15 [^1] and seems to be unable to bootstrap rustc anyway [^3]. As such we shouldn't really care about supporting gold.

This would also allow re-enabling start-stop-gc with lld.

cc https://github.com/rust-lang/rust/issues/93798
Likely fixes https://github.com/rust-lang/rust/issues/85045

[^1]: https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html
[^2]: https://llvm.org/docs/LangRef.html#the-llvm-compiler-used-global-variable
[^3]: https://github.com/rust-lang/rust/issues/139425
2025-06-05 22:52:17 +00:00
bors 36cc2ce2e8 Auto merge of #138677 - shepmaster:consistent-elided-lifetime-syntax, r=traviscross,jieyouxu
Add a new `mismatched-lifetime-syntaxes` lint

The lang-team [discussed this](https://hackmd.io/nf4ZUYd7Rp6rq-1svJZSaQ) and I attempted to [summarize](https://github.com/rust-lang/rust/pull/120808#issuecomment-2701863833) their decision. The summary-of-the-summary is:

- Using two different kinds of syntax for elided lifetimes is confusing. In rare cases, it may even [lead to unsound code](https://github.com/rust-lang/rust/issues/48686)! Some examples:

    ```rust
    // Lint will warn about these
    fn(v: ContainsLifetime) -> ContainsLifetime<'_>;
    fn(&'static u8) -> &u8;
    ```

- Matching up references with no lifetime syntax, references with anonymous lifetime syntax, and paths with anonymous lifetime syntax is an exception to the simplest possible rule:

    ```rust
    // Lint will not warn about these
    fn(&u8) -> &'_ u8;
    fn(&'_ u8) -> &u8;
    fn(&u8) -> ContainsLifetime<'_>;
    ```

- Having a lint for consistent syntax of elided lifetimes will make the [future goal](https://github.com/rust-lang/rust/issues/91639) of warning-by-default for paths participating in elision much simpler.

---

This new lint attempts to accomplish the goal of enforcing consistent syntax. In the process, it supersedes and replaces the existing `elided-named-lifetimes` lint, which means it starts out life as warn-by-default.
2025-06-05 19:49:30 +00:00
bors 2f3d5a37f0 Auto merge of #142081 - matthiaskrgr:rollup-secpezz, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#141709 (jsondocck: Refactor directive handling)
 - rust-lang/rust#141974 (`tests/ui`: A New Order [4/N])
 - rust-lang/rust#141989 (rustdoc-json-type: Depend on `serde` and `serde_derive` seperately)
 - rust-lang/rust#142015 (Report the actual item that evaluation failed for)
 - rust-lang/rust#142026 (bootstrap: Fix file permissions when dereferencing symlinks)
 - rust-lang/rust#142032 (Fix parsing of frontmatters with inner hyphens)
 - rust-lang/rust#142036 (Update the `compiler-builtins` subtree)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-05 16:46:32 +00:00
Matthias Krüger 359984fa69
Rollup merge of #142032 - matthewjasper:frontmatter-lexing, r=fee1-dead
Fix parsing of frontmatters with inner hyphens

closes rust-lang/rust#141483

r? fee1-dead
2025-06-05 16:02:04 +02:00
Matthias Krüger 9a6f10d82a
Rollup merge of #141709 - aDotInTheVoid:split-for-docs, r=GuillaumeGomez
jsondocck: Refactor directive handling

Best reviewed commit by commit.

1. Moves directive handling into its own file. This makes it easier to link to in the dev-guide (https://github.com/rust-lang/rustc-dev-guide/pull/2422#discussion_r2112724234), but also makes the code nicer in it's own right
2. Renames command to directive. This is what compiletest uses, and it's nice to not have 2 words for this.

r? ``@GuillaumeGomez``
2025-06-05 16:02:00 +02:00
bors 6a80b8e4c7 Auto merge of #142070 - matthiaskrgr:rollup-e7lxtuo, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#140638 (UnsafePinned: also include the effects of UnsafeCell)
 - rust-lang/rust#141777 (Do not run PGO/BOLT in x64 Linux alt builds)
 - rust-lang/rust#141938 (update rust offload bootstrap)
 - rust-lang/rust#141962 (rustc-dev-guide subtree update)
 - rust-lang/rust#141965 (`tests/ui`: A New Order [3/N])
 - rust-lang/rust#141970 (implement new `x` flag: `--skip-std-check-if-no-download-rustc`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-05 13:44:43 +00:00
Matthias Krüger 0c371e20ad
Rollup merge of #141970 - onur-ozkan:skip-stage1-std, r=Kobzol
implement new `x` flag: `--skip-std-check-if-no-download-rustc`

One of our developers (``@RalfJung)`` [reported](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606)[#t-infra/bootstrap > Surprising stages for check build after stage reorg](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606) that working on both the compiler and the library simultaneously with RA enabled is extremely difficult because checking library creates a heavy load on machines (by building stage1 compiler) on each modification. `--skip-std-check-if-no-download-rustc` flag is intended to reduce this heavy load on their IDE integration as much as possible.

Fixes: rust-lang/rust#141955
2025-06-05 12:21:34 +02:00
Matthias Krüger 662e7599dc
Rollup merge of #141965 - Kivooeo:test-reform, r=jieyouxu
`tests/ui`: A New Order [3/N]

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ``@jieyouxu``
2025-06-05 12:21:33 +02:00
Matthias Krüger 1791bfb958
Rollup merge of #141962 - BoxyUwU:rdg-push, r=jieyouxu
rustc-dev-guide subtree update

r? ``@jieyouxu``
2025-06-05 12:21:32 +02:00
Matthias Krüger 7bce560b6c
Rollup merge of #141938 - ZuseZ4:offload-updates, r=Kobzol
update rust offload bootstrap

r? ``@ghost``
2025-06-05 12:21:31 +02:00
Matthias Krüger 7f12261d49
Rollup merge of #141777 - Kobzol:dist-linux-alt-no-pgo-bolt, r=marcoieni
Do not run PGO/BOLT in x64 Linux alt builds

Should unblock https://github.com/rust-lang/rust/pull/131077 and also reduce our CI costs. It seems to run ~1.5h on the x64 larger runner (free runner runs out of disk space, sadly).

Discussed [here](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Utility.20of.20the.20.60dist-x86_64-linux-alt.60.20job/with/521324477).

r? ``@marcoieni``

try-job: `dist-x86_64-linux*`
2025-06-05 12:21:30 +02:00
Matthias Krüger 65b423bfbc
Rollup merge of #140638 - RalfJung:unsafe-pinned-shared-aliased, r=workingjubilee
UnsafePinned: also include the effects of UnsafeCell

This tackles https://github.com/rust-lang/rust/issues/137750 by including an `UnsafeCell` in `UnsafePinned`, thus imbuing it with all the usual properties of interior mutability (no `noalias` nor `dereferenceable` on shared refs, special treatment by Miri's aliasing model). The soundness issue is not fixed yet because coroutine lowering does not use `UnsafePinned`.

The RFC said that `UnsafePinned` would not permit mutability on shared references, but since then, https://github.com/rust-lang/rust/issues/137750 has demonstrated that this is not tenable. In the face of those examples, I propose that we do the "obvious" thing and permit shared mutable state inside `UnsafePinned`. This seems loosely consistent with the fact that we allow going from `Pin<&mut T>` to `&T` (where the former can be aliased with other pointers that perform mutation, and hence the same goes for the latter) -- but the `as_ref` example shows that we in fact would need to add this `UnsafeCell` even if we didn't have a safe conversion to `&T`, since for the compiler and Miri, `&T` and `Pin<&T>` are basically the same type.

To make this possible, I had to remove the `Copy` and `Clone` impls for `UnsafePinned`.

Tracking issue: https://github.com/rust-lang/rust/issues/125735
Cc ``@rust-lang/lang`` ``@rust-lang/opsem``  ``@Sky9x``
I don't think this needs FCP since the type is still unstable -- we'll finally decide whether we like this approach when `UnsafePinned` is moved towards stabilization (IOW, this PR is reversible). However, I'd still like to make sure that the lang team is okay with the direction I am proposing here.
2025-06-05 12:21:29 +02:00
bors 7cc927ff7d Auto merge of #140466 - amandasystems:move-to-preprocessing-step, r=lcnr
Move placeholder handling to a proper preprocessing step

This commit breaks out the logic of placheolder rewriting into its own preprocessing step. It's one of the more boring
parts of #130227.

The only functional change from this is that the preprocessing step (where extra `r: 'static` constraints are added) is performed upstream of Polonius legacy, finally affecting Polonius. That is mostly a by-product, though.

This should be reviewable by anyone in the compiler team, so
r? rust-lang/compiler
2025-06-05 05:27:41 +00:00
onur-ozkan cda721a97f document `skip-std-check-if-no-download-rustc` in rustc-dev-guide
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-04 15:23:58 +03:00
bors e54dd40288 Auto merge of #141229 - tgross35:builtins-josh-subtree, r=Kobzol
Merge `compiler-builtins` as a Josh subtree

Use the Josh [1] utility to add `compiler-builtins` as a subtree, which
will allow us to stop using crates.io for updates. This is intended to
help resolve some problems when unstable features change and require
code changes in `compiler-builtins`, which sometimes gets trapped in a
bootstrap cycle.

This was done using `josh-filter` built from the r24.10.04 tag:

    git fetch https://github.com/rust-lang/compiler-builtins.git 233434412fe7eced8f1ddbfeddabef1d55e493bd
    josh-filter ":prefix=library/compiler-builtins" FETCH_HEAD
    git merge --allow-unrelated FILTERED_HEAD

The HEAD in the `compiler-builtins` repository is 233434412f ("fix an if
statement that can be collapsed").

[1]: https://github.com/josh-project/josh
2025-06-03 19:52:05 +00:00
bors 7eded778ab Auto merge of #136942 - Kobzol:stage0-sccache, r=jieyouxu
Use ccache for stage0 tool builds

Now after the stage0 redesign, we can actually start ccaching the build of the compiler itself. We can also cache the bootstrap tools, since these are also built with the stage0 compiler.

Stage0 compiler builds are now being cached: https://github.com/rust-lang/rust/actions/runs/15397246267#summary-43321151192 (`..bootstrap::core::build_steps::compile::Rustc	483.10s	40.41s	-91.6%`). It's not a gigantic win everywhere, but it should help. It seems to make the Linux jobs ~10 minute faster. It should be especially useful on PR builds after https://github.com/rust-lang/rust/pull/141948.

r? `@jieyouxu`

try-job: `x86_64-gnu-llvm-19*`
try-job: `x86_64-msvc*`
try-job: `x86_64-apple*`
try-job: `dist-x86_64-linux`
2025-06-03 13:09:57 +00:00
许杰友 Jieyou Xu (Joe) e058df17c8
Merge pull request #2451 from jieyouxu/rustc-pull 2025-06-03 20:19:44 +08:00
Jieyou Xu 88e0085b00 Merge from rustc 2025-06-03 20:17:50 +08:00
Jieyou Xu 91be3cb103 Preparing for merge from rustc 2025-06-03 20:16:00 +08:00
bors c911e7d730 Auto merge of #141210 - RalfJung:miri-std-doctests, r=saethlin
tools-aux ci runner: also cross-test doctests in Miri

Miri now supports running doctests across different targets. Let's use that to run the std doctests on aarch64-apple-darwin, i686-pc-windows-msvc.

try-job: x86_64-gnu-aux
2025-06-03 03:14:19 +00:00
bors c58f4830a2 Auto merge of #141750 - Noratrieb:gold-rush, r=bjorn3
Warn when gold was used as the linker

gold has been deprecated recently and is known to behave incorrectly around Rust programs, including miscompiling `#[used(linker)]`. Tell people to switch to a different linker instead.

closes rust-lang/rust#141748

r? bjorn3
2025-06-02 23:56:54 +00:00
bors 7a2568217a Auto merge of #141912 - Kobzol:rollup-wurlnsx, r=Kobzol
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#141767 (ci: use free runner for aarch64-gnu-llvm-19-1 PR job)
 - rust-lang/rust#141858 (Fix typo in `StructuralPartialEq` docs)
 - rust-lang/rust#141865 (Optionally don't steal the THIR)
 - rust-lang/rust#141874 (add f16_epsilon and f128_epsilon diagnostic items)
 - rust-lang/rust#141904 (test-float-parse: apply `cfg(not(bootstrap))`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-02 19:35:39 +00:00
bors 93a0856493 Auto merge of #141906 - chenyukang:rollup-k6v59ty, r=chenyukang
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#141884 (allow macro_use as first segment)
 - rust-lang/rust#141885 ([RTE-484] Update SGX maintainers)
 - rust-lang/rust#141892 (Fix false positive lint error from no_implicit_prelude attr)
 - rust-lang/rust#141894 (rustc-dev-guide subtree update)
 - rust-lang/rust#141895 (tshepang has a new email)
 - rust-lang/rust#141897 (Fix citool tests when executed locally)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-02 16:15:30 +00:00
Tshepang Mbambo 1d8f15e1f7
Merge pull request #2443 from smanilov/patch-21
Simplify long sentence
2025-06-02 17:30:02 +02:00
Stan Manilov c58ec21749 Simplify long sentence 2025-06-02 17:52:34 +03:00
León Orell Valerian Liehr 16525780ff
Merge pull request #2446 from fmease/fix-warning-blocks
Fix some warning blocks that contain Markdown
2025-06-02 16:27:47 +02:00
León Orell Valerian Liehr 6e608e5671
Fix some warning blocks that contain Markdown
Contents inside of an HTML element only get interpreted as Markdown
(as opposed to HTML) if its separated from the HTML tags with line breaks.
2025-06-02 16:21:59 +02:00
Tshepang Mbambo a08948f693
Merge pull request #2445 from smanilov/patch-23
Add title and toc to Async chapter
2025-06-02 16:18:44 +02:00
Tshepang Mbambo e289e75553
Merge pull request #2444 from smanilov/patch-22
Trivial: dedup word
2025-06-02 16:17:39 +02:00
Stan Manilov f362726205
Add title and toc to Async chapter
This is standard for other chapters.
2025-06-02 17:16:29 +03:00
Stan Manilov 64ccd09863
Trivial: dedup word 2025-06-02 17:02:34 +03:00
Jakub Beránek 3d1cba7bd7
Rollup merge of #141874 - usamoi:eps, r=tgross35
add f16_epsilon and f128_epsilon diagnostic items

cc https://github.com/rust-lang/rust/issues/116909
r? ``@tgross35``
2025-06-02 15:19:19 +02:00
Jakub Beránek e8e58652a4
Rollup merge of #141865 - Nadrieril:dont-steal-thir, r=oli-obk
Optionally don't steal the THIR

The THIR being stolen is a recurrent pain for authors of rustc drivers. This makes it optional, so that the `thir_body` query can still be used after analysis of the crate has completed.
2025-06-02 15:19:19 +02:00
Jakub Beránek 33a8bdd102
Rollup merge of #141858 - zacryol:spe-docs-typo, r=aDotInTheVoid
Fix typo in `StructuralPartialEq` docs

`equialent` => `equivalent`
2025-06-02 15:19:18 +02:00
Jakub Beránek 12566038b2
Rollup merge of #141767 - marcoieni:free-pr-job, r=Kobzol
ci: use free runner for aarch64-gnu-llvm-19-1 PR job
2025-06-02 15:19:17 +02:00
Yukang afd0380599
Rollup merge of #141897 - Kobzol:fix-citool-tests, r=marcoieni
Fix citool tests when executed locally

They couldn't be executed locally before due to some additional environment reads.

I also investigated the annoying rebuilds that we see on CI all the time, and they are caused by `ring`'s build script. It should be fixed in the next ring release (https://github.com/briansmith/ring/issues/2525), so we can just wait for that and then update `ring`.

r? `@marcoieni`
2025-06-02 20:57:44 +08:00
Yukang 81595902af
Rollup merge of #141895 - tshepang:new-address, r=jieyouxu
tshepang has a new email
2025-06-02 20:57:43 +08:00
Yukang 1a9be0c862
Rollup merge of #141894 - tshepang:rdg-push, r=jieyouxu
rustc-dev-guide subtree update

r? `@ghost`
2025-06-02 20:57:42 +08:00
Yukang f0267f227f
Rollup merge of #141892 - chenyukang:yukang-fix-141785-extern-crate, r=petrochenkov
Fix false positive lint error from no_implicit_prelude attr

Fixes rust-lang/rust#141785

r? `@petrochenkov`
2025-06-02 20:57:42 +08:00
Yukang d7a817beb2
Rollup merge of #141885 - raoulstrackx:raoul/rte-484-update_sgx_maintainers, r=Noratrieb
[RTE-484] Update SGX maintainers

`@mzohreva` is no longer with Fortanix. We need to change the SGX maintainers accordingly.
2025-06-02 20:57:41 +08:00
Yukang 4462c99c97
Rollup merge of #141884 - bvanjoi:issue-140255, r=petrochenkov
allow macro_use as first segment

Fixes rust-lang/rust#140255

This issue may raise a question: It's reasonable an external crate name or import target be legally named `macro_use`?
2025-06-02 20:57:41 +08:00
bors 3b3df39a7f Auto merge of #141814 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2025-06-02 12:56:24 +00:00
nora d9f28732d5
Merge pull request #2440 from rust-lang/tshepang-patch-1
distracting indirection
2025-06-02 12:55:31 +02:00
Tshepang Mbambo 39300c4b70
distracting indirection 2025-06-02 12:34:19 +02:00
Tshepang Mbambo 7d5bda0d8a
Merge pull request #2439 from rust-lang/tshepang-offline-love
use a relative path, so that this also works offline
2025-06-02 12:31:25 +02:00
Tshepang Mbambo 9ad4ab9bb5 use a relative path, so that this also works offline 2025-06-02 12:30:08 +02:00
Tshepang Mbambo f3e892f57a
Merge pull request #2386 from Lysxia/fix-link
Fix link to GatherBorrows
2025-06-02 12:08:03 +02:00
Tshepang Mbambo 08e9bce01c
Merge pull request #2435 from smanilov/patch-19
Add opaque type attributes
2025-06-02 11:55:19 +02:00
Tshepang Mbambo 4bfb215935
Merge pull request #2437 from rust-lang/rustc-pull
Rustc pull update
2025-06-02 11:47:49 +02:00