Commit graph

3484 commits

Author SHA1 Message Date
Mads Marquart
522e47fd60 miri: use tikv-jemalloc-sys from sysroot
This allows LTO to work when compiling jemalloc, which should yield a
small performance boost, and makes miri's behaviour here match clippy
and rustdoc.
2025-11-24 10:00:23 +01:00
Matthias Krüger
d48305fa5b
Rollup merge of #149077 - Muscraft:annotate-snippets-simd, r=davidtwco
feat: Enable annotate-snippets' simd feature

`annotate-snippets` `simd` feature enables the use of `memchr` when searching for `char`/`str`. This should hopefully improve performance when [`annotate-snippets` is passed large `source`](https://github.com/rust-lang/rust/pull/148188#issuecomment-3550280300).
2025-11-22 18:41:22 +01:00
bors
5934b06557 Auto merge of #148831 - clubby789:cargo-update-11-11-25, r=jieyouxu
Bump compiler dependencies

https://github.com/rust-lang/rust/pull/145849#issuecomment-3394832713
This manually downgrades the `wasip`/`wit-bindgen`/`getrandom` deps to avoid pulling in a binary blob, but it would be good to pin this automatically in a way which doesn't cause these blobs to be pulled in.
2025-11-22 00:00:06 +00:00
Guillaume Gomez
629a283b98
Rollup merge of #149043 - aDotInTheVoid:is-this-real-is-this-out-of-spite-does-it-matter, r=GuillaumeGomez
rustdoc-json: add rlib path to ExternalCrate to enable robust crate resolution

Historically, it's not been possible to robustly resolve a cross-crate item in rustdoc-json. If you had a `Id` that wasn't in `Crate::index` (because it was defined in a different crate), you could only look it up it `Crate::paths`. But there, you don't get the full information, only an `ItemSummary`. This tells you the `path` and the `crate_id`.

But knowing the `crate_id` isn't enough to be able to build/find the rustdoc-json output with this item. It's only use is to get a `ExternalCrate` (via `Crate::external_crates`). But that only tells you the `name` (as a string). This isn't enough to uniquely identify a crate, as there could be multiple versions/features [^1] [^2].

This was originally proposed to be solved via `@LukeMathWalker's` `--orchestrator-id` proposal (https://github.com/rust-lang/compiler-team/issues/635). But that requires invasive changes to cargo/rustc. This PR instead implements `@Urgau's` proposal to re-use the path to a crate's rmeta/rlib as a unique identifer. Callers can use that to determine which package it corresponds to in the language of the build-system above rustc. E.g. for cargo, `cargo rustdoc --message-format=json --output-format=json -Zunstable-options`).

(Once you've found the right external crate's rustdoc-json output, you still need to resolve the path->id in that crate. But that's """just""" a matter of walking the module tree. We should probably still make that nicer (by, for example, allowing sharing `Id`s between rustdoc-json document), but that's a future concern)

For some notes from RustWeek 2025, where this was designed, see https://hackmd.io/0jkdguobTnW7nXoGKAxfEQ

CC `@obi1kenobi` (who wants this for cargo-semver-checks [^3]), `@epage` (who's conversations on what and wasn't possible with cargo informed taking this approach to solve this problem)

r? `@GuillaumeGomez`

## TODO:

- [x] Docs: [Done](e4cdd0c24a..457ed4edb1)
- [x] Tests: [Done](2e1b954dc5..4d00c1a7ee)

[^1]: https://github.com/rust-lang/compiler-team/issues/635#issue-1714254865 § Problem
[^2]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Identifying.20external.20crates.20in.20Rustdoc.20JSON/with/352701211
[^3]: https://github.com/obi1kenobi/cargo-semver-checks/issues/638
2025-11-21 21:34:26 +01:00
Jamie Hill-Daniel
36bdffea59 Bump compiler dependencies 2025-11-21 16:11:00 +00:00
Matthias Krüger
37dc26c816
Rollup merge of #149071 - ferrocene:pvdrz/remote-test-client-timeout-tests, r=jieyouxu
Add test scaffolding for the `remote-test-client`

r? ``@jieyouxu``
2025-11-20 11:15:55 +01:00
Matthias Krüger
34b3c9dd4d
Rollup merge of #148261 - aDotInTheVoid:no-sync-for-smir, r=celinval
rustc_public: Make Id types !Send / !Sync

These types are Id's to a table stored in TLS, so using them from another tread will either panic, or give wrong results.

Therefor, I've added a ~~`ReferencesTls`~~`ThreadLocalIndex`  marker type, which ensures types arn't `Send`/`Sync`.

This is a breaking change for users of the `rustc_public` crate.

~~It also changes how `DefId` and similar are `Serialize`d. It would be possible to preserve the old behavior if that's needed, but I couldn't see any tests for these.~~ EDIT: Not anymore: https://github.com/rust-lang/rust/pull/148261#discussion_r2476111612

Zulip Discussion: https://rust-lang.zulipchat.com/#narrow/channel/320896-project-stable-mir/topic/WDYM.20.22should.20not.20.20be.20shared.20across.20threads.22/with/547374171
2025-11-20 11:15:52 +01:00
Alona Enraght-Moony
e7b84604cb rustc_public: Make Id types !Send / !Sync
These types are Id's to a table stored in TLS, so using them from
another tread will either panic, or give wrong results.

Therefor, I've added a `ThreadLocalIndex` marker type, which ensures types
arn't `Send`/`Sync`.

This is a breaking change for users of the `rustc_public` crate.

Zulip Discussion: https://rust-lang.zulipchat.com/#narrow/channel/320896-project-stable-mir/topic/WDYM.20.22should.20not.20.20be.20shared.20across.20threads.22/with/547374171
2025-11-19 19:46:18 +00:00
Alona Enraght-Moony
8c569c1416 run-make-support: re-export rustdoc_json_types
This is useful for allowing writing run-make tests that test
rustdoc-json.
2025-11-19 19:36:43 +00:00
Christian Poveda
cdd88963c8
Add test scaffolding for the remote-test-client 2025-11-19 12:14:34 -05:00
Scott Schafer
60427ac5be
feat: Enable annotate-snippets' simd feature 2025-11-18 19:07:18 -07:00
Ralf Jung
eafd125d1f update lockfile 2025-11-17 13:34:27 +01:00
Scott Schafer
463c6cea68
chore: Update annotate-snippets to 0.12.9 2025-11-15 14:45:21 -07:00
Alex Crichton
8043cf3a82 Update wasm-component-ld to 0.5.19
Same as 147495, just keeping it up-to-date.
2025-11-14 12:57:00 -08:00
bors
7a72c5459d Auto merge of #148896 - Kobzol:revert-146627, r=madsmtm
Revert "Rollup merge of #146627 - madsmtm:jemalloc-simplify, r=jdonszelmann"

This reverts commit 5dc3c19417, reversing
changes made to 11339a0ef5.

Reverts https://github.com/rust-lang/rust/pull/146627 due to a [perf regression](https://github.com/rust-lang/rust/pull/148851#issuecomment-3525797560).

r? `@Zalathar`
2025-11-13 21:15:20 +00:00
Jakub Beránek
ccd87959ed
Revert "Rollup merge of #146627 - madsmtm:jemalloc-simplify, r=jdonszelmann"
This reverts commit 5dc3c19417, reversing
changes made to 11339a0ef5.
2025-11-13 10:29:26 +01:00
Yotam Ofek
e921e28c7a Upgrade stringdex to 0.0.3 2025-11-13 10:15:30 +02:00
Mads Marquart
65f0b7aad4 Fix building rustdoc and clippy with jemalloc feature 2025-11-11 20:16:16 +01:00
Mads Marquart
dd2159e75d Simplify jemalloc setup
Using the new `override_allocator_on_supported_platforms` feature in
`tikv-jemalloc-sys v0.6.1` we can avoid the manual statics.
2025-11-11 20:16:15 +01:00
bors
ceb7df7e6f Auto merge of #147029 - neuschaefer:memchr-2.7.6, r=marcoieni
Update memchr to 2.7.6

memchr 2.7.6 contains a bugfix for aarch64_be.

Note: I'm not sure about how dependency updates are managed in rust.git. If something should go through another branch or will happen automatically, please let me know.
2025-11-07 21:58:38 +00:00
Scott Schafer
457cbb06a1
chore: Update annotate-snippets to 0.12.8 2025-11-05 09:00:58 -07:00
Matthias Krüger
1ca21edce4
Rollup merge of #148340 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? ``@Manishearth``

Cargo.lock update due to Clippy version bump
2025-11-01 08:25:48 +01:00
Matthias Krüger
8cc32c377d
Rollup merge of #148263 - clubby789:bump-libc, r=ehuss
Unpin `libc` and `rustix` in `compiler` and `rustbook`

Closes rust-lang/rust#147501
2025-11-01 08:25:46 +01:00
clubby789
c169ea03ab Unpin libc in compiler and rustbook 2025-10-31 19:13:45 +00:00
Philipp Krones
be5093efcb
Update Cargo.lock 2025-10-31 19:15:50 +01:00
Jieyou Xu
2b9b7bb3d4
Revert "Auto merge of #146186 - dpaoliello:cc, r=jieyouxu"
This reverts commit bc1d7273df, reversing
changes made to c9537a94a6.
2025-10-30 22:46:35 +08:00
bors
bc1d7273df Auto merge of #146186 - dpaoliello:cc, r=jieyouxu
Update cc-rs to 1.2.39

For my purposes, contains fixes when compiling the Rust compiler for Arm64EC.

Checked the commits since 1.2.16, and I don't see anything else that may affect Rust?

`find-msvc-tools` was also factored out from `cc` to allow updating the use in `rustc_codegen_ssa` (finding the linker when running the Rust compiler) to be separate from the use in `rustc_llvm` (building LLVM as part of the Rust compiler).
2025-10-28 13:25:45 +00:00
Daniel Paoliello
826c925128 Update cc-rs to 1.2.39 2025-10-27 10:10:48 -07:00
Scott Schafer
354b9779bf
chore: Update to the latest annotate-snippets 2025-10-24 12:50:19 -06:00
Scott Schafer
926d4535cd
refactor: Move to anstream + anstyle for styling 2025-10-20 12:13:25 -06:00
bors
f46475914d Auto merge of #147660 - notriddle:stringdex-002, r=GuillaumeGomez
rustdoc-search: stringdex 0.0.2

Two index format tweaks that reduce the size of the standard library, compiler, and wordnet dictionary when I test it.

CC rust-lang/rust#146048

FF Profiler output: https://share.firefox.dev/4onH5xP

Preview: https://notriddle.com/rustdoc-html-demo-12/stringdex-002/std/index.html
2025-10-17 15:42:33 +00:00
bors
a41214f9bd Auto merge of #147779 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

`Cargo.lock` update, because `clippy_utils` is now also using `itertools`
2025-10-17 07:57:20 +00:00
Philipp Krones
4b0cfb6a83
Update Cargo.lock 2025-10-16 20:38:32 +02:00
Ralf Jung
2f04473551 update lockfile 2025-10-15 23:30:28 +02:00
Diggory Blake
c6a952159f
Restrict sysroot crate imports to those defined in this repo.
It's common to import dependencies from the sysroot via `extern crate`
rather than use an explicit cargo dependency, when it's necessary to use
the same dependency version as used by rustc itself. However, this is
dangerous for crates.io crates, since rustc may not pull in the
dependency on some targets, or may pull in multiple versions. In both
cases, the `extern crate` fails to resolve.

To address this, re-export all such dependencies from the appropriate
`rustc_*` crates, and use this alias from crates which would otherwise
need to use `extern crate`.
2025-10-15 13:17:25 +01:00
Michael Howell
fdeb3633d9 rustdoc-search: stringdex 0.0.2
Two index format tweaks that reduce the size of the standard
library, compiler, and wordnet dictionary when I test it.
2025-10-13 21:12:21 -07:00
Matthias Krüger
6c71fcb8e2
Rollup merge of #147495 - alexcrichton:update-wasm-component-ld, r=Mark-Simulacrum
Update wasm-component-ld to 0.5.18

Keeping it up-to-date with upstream for the latest bug fixes and such related to wasm-tools-implemented internals.
2025-10-12 19:07:46 +02:00
Zalathar
8f0815602c compiletest: Isolate APIs used by rustdoc-gui-test 2025-10-09 14:34:01 +11:00
Alex Crichton
4b6bc9a66b Update wasm-component-ld to 0.5.18
Keeping it up-to-date with upstream for the latest bug fixes and such
related to wasm-tools-implemented internals.
2025-10-08 13:20:42 -07:00
Matthias Krüger
68656b7579
Rollup merge of #147422 - jyn514:license-diff, r=Kobzol
collect-license-metadata: Print a diff of the expected output

Previously, `x test collect-license-metadata` gave the following message on errors:
```
gathering license information from REUSE (this might take a minute...)
finished gathering the license information from REUSE in 78.69s
loading existing license information
The existing /home/runner/work/ferrocene/ferrocene/license-metadata.json
file is out of date.
Run ./x run collect-license-metadata to update it.
Error: The existing
/home/runner/work/ferrocene/ferrocene/license-metadata.json file doesn't
match what REUSE reports.
Bootstrap failed while executing `test collect-license-metadata`
```

Notable, this doesn't actually say what went wrong. Print a diff in addition so it's more clear what broke:
```
...
                "license": {
                   "copyright": [
+                    "2010 The Rust Project Developers",
                     "2016, 2017, 2018, 2019, 2020, 2021 AXE Consultants. All Rights",
+                    "License. Subject to the terms and conditions of this",
                     "Notice",
-                    "The Ferrocene Developers"
+                    "The Ferrocene Developers",
+                    "[yyyy] [name of copyright owner]"
                   ],
...
```

Currently, this prints the entire text of the JSON file as context. That's not ideal, but it's rare for this to fail, so I think it's ok for now.

I considered using `assert_json_diff` instead of `similar`, but its errors are a lot harder to read IMO, even though they are better at omitting unnecessary context:

```
Diff: json atoms at path ".files.children[0].children[10].license.copyright[0]" are not equal:
    lhs:
        "2016 The Fuchsia Authors"
    rhs:
        "2019 The Crossbeam Project Developers"

json atoms at path ".files.children[0].children[10].license.spdx" are not equal:
    lhs:
        "BSD-2-Clause AND (Apache-2.0 OR MIT)"
    rhs:
        "Apache-2.0 OR MIT"

json atom at path ".files.children[0].children[10].children" is missing from lhs

json atoms at path ".files.children[0].children[10].name" are not equal:
    lhs:
        "library/std/src/sys/sync/mutex/fuchsia.rs"
    rhs:
        "library/std/src/sync/mpmc"
...
```
2025-10-07 19:39:09 +02:00
Jynn Nelson
bc930cd2d1 collect-license-metadata: Print a diff of the expected output
Previously, `x test collect-license-metadata` gave the following message
on errors:
```
gathering license information from REUSE (this might take a minute...)
finished gathering the license information from REUSE in 78.69s
loading existing license information
The existing /home/runner/work/ferrocene/ferrocene/license-metadata.json
file is out of date.
Run ./x run collect-license-metadata to update it.
Error: The existing
/home/runner/work/ferrocene/ferrocene/license-metadata.json file doesn't
match what REUSE reports.
Bootstrap failed while executing `test collect-license-metadata`
```

Notable, this doesn't actually say what went wrong.
Print a diff in addition so it's more clear what broke:
```
...
                "license": {
                   "copyright": [
+                    "2010 The Rust Project Developers",
                     "2016, 2017, 2018, 2019, 2020, 2021 AXE Consultants. All Rights",
+                    "License. Subject to the terms and conditions of this",
                     "Notice",
-                    "The Ferrocene Developers"
+                    "The Ferrocene Developers",
+                    "[yyyy] [name of copyright owner]"
                   ],
...
```

Currently, this prints the entire text of the JSON file as context.
That's not ideal, but it's rare for this to fail, so I think it's ok for
now.

I considered using `assert_json_diff` instead of `similar`, but its
errors are a lot harder to read IMO, even though they are better at
omitting unnecessary context:

```
Diff: json atoms at path ".files.children[0].children[10].license.copyright[0]" are not equal:
    lhs:
        "2016 The Fuchsia Authors"
    rhs:
        "2019 The Crossbeam Project Developers"

json atoms at path ".files.children[0].children[10].license.spdx" are not equal:
    lhs:
        "BSD-2-Clause AND (Apache-2.0 OR MIT)"
    rhs:
        "Apache-2.0 OR MIT"

json atom at path ".files.children[0].children[10].children" is missing from lhs

json atoms at path ".files.children[0].children[10].name" are not equal:
    lhs:
        "library/std/src/sys/sync/mutex/fuchsia.rs"
    rhs:
        "library/std/src/sync/mpmc"
...
```
2025-10-06 19:10:12 -04:00
Philipp Krones
8c4be66084
Update Cargo.lock 2025-10-06 18:10:44 +02:00
bors
8d72d3e1e9 Auto merge of #147002 - notriddle:stringdex3, r=GuillaumeGomez
rustdoc-search: stringdex update with more packing

Before:

    18M  build/x86_64-unknown-linux-gnu/doc/search.index/
    57M  build/x86_64-unknown-linux-gnu/compiler-doc/search.index/

After:

    16M  build/x86_64-unknown-linux-gnu/doc/search.index/
    49M  build/x86_64-unknown-linux-gnu/compiler-doc/search.index/

CC rust-lang/rust#146063
2025-09-28 13:29:26 +00:00
Erick Tryzelaar
d42acf522f Include additional hashes in src/stage0
This patch changes `bump-stage0` to include:

* The sha256 hash of the channel manifest used to create `src/stage0`.
* The rust and rustfmt git commit in `src/stage0`.
* Hashes of all the artifacts, like the source tarball, in `src/stage0`.

Combined this will allow for:

* Projects that bootstrap their own compiler, such as Fuchsia, or users
  of [bootstrap], to build their compilers offline without needing to
  communicate with static.rust-lang.org.

* Auditors to detect if the channel manifest, and all the artifacts
  inside the manifest, were modified after it was used to generate
  `src/stage0`. Furthermore, if they did find modified artifacts, they
  could determine if the Rust Signing Key was compromised by checking if
  any modified file was signed properly.

Finally, it allows regeneration of `src/stage0` when specifying both the
day of the build for rust, and the day of the build for rustfmt, which
can allow a maintainer to regenerate `src/stage0` to verify nothing
changed.

[bootstrap]: https://github.com/dtolnay/bootstrap
[mrustc]: https://github.com/thepowersgang/mrustc
2025-09-27 08:43:22 -04:00
J. Neuschäfer
5a3b82b64f Update memchr to 2.7.6
memchr 2.7.6 contains a bugfix for aarch64_be
2025-09-26 17:53:49 +02:00
Michael Howell
5bec161ce1 rustdoc-search: stringdex update with more packing
Before:

    18M  build/x86_64-unknown-linux-gnu/doc/search.index/
    57M  build/x86_64-unknown-linux-gnu/compiler-doc/search.index/

After:

    16M  build/x86_64-unknown-linux-gnu/doc/search.index/
    49M  build/x86_64-unknown-linux-gnu/compiler-doc/search.index/
2025-09-24 11:31:54 -07:00
Matthias Krüger
8f11c4dadb
Rollup merge of #146784 - dpaoliello:findmsvc, r=wesleywiser
[win] Use find-msvc-tools instead of cc to find the linker and rc on Windows

`find-msvc-tools` was factored out from `cc` to allow updating the use in `rustc_codegen_ssa` (finding the linker when running the Rust compiler) and `rustc_windows_rc` (finding the Windows Resource Compiler when running the Rust compiler) to be separate from the use in `rustc_llvm` (building LLVM as part of building the Rust compiler).
2025-09-23 18:13:53 +02:00
Matthias Krüger
ba9d057804
Rollup merge of #146731 - Muscraft:svg-test-terminal-url, r=jdonszelmann
test: Use SVG for terminal url test

I came across the test for `-Zterminal-urls` and found its output a bit hard to read. So, I decided to switch it to an SVG test, as I found it easier to differentiate the link and link text.

Note: `anstyle-svg` needed to be upgraded to at least `0.1.8` to support links in SVGs, so I went ahead and upgraded it to the latest version (`0.1.11`).
2025-09-23 18:13:52 +02:00
Daniel Paoliello
4da59355fd [win] Use find-msvc-tools instead of cc to find the linker and rc on Windows 2025-09-19 12:00:30 -07:00
Scott Schafer
82eed00d39
chore(compiletest): Use newest anstyle-svg version 2025-09-19 12:28:44 -06:00