Commit graph

3454 commits

Author SHA1 Message Date
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
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
bors
59043567a5 Auto merge of #146765 - Zalathar:rollup-ewh4s9o, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set)
 - rust-lang/rust#146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output)
 - rust-lang/rust#146541 (std: simplify host lookup)
 - rust-lang/rust#146615 (rustc_codegen_llvm: Feature Conversion Tidying)
 - rust-lang/rust#146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`)
 - rust-lang/rust#146663 (Allow windows resource compiler to be overridden)
 - rust-lang/rust#146691 (std: Fix WASI implementation of `remove_dir_all`)
 - rust-lang/rust#146709 (stdarch subtree update)
 - rust-lang/rust#146738 (Fix tidy spellchecking on Windows)
 - rust-lang/rust#146740 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-19 15:22:22 +00:00
Stuart Cook
5d404e05bc
Rollup merge of #146740 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to 5a142000d2.

Created using https://github.com/rust-lang/josh-sync.

r? ``@ghost``
2025-09-19 22:31:55 +10:00
bors
e10aa88911 Auto merge of #145737 - cjgillot:gvn-valueset, r=saethlin
GVN: stop hashing opaque values

GVN generates values that are not meant to be unified with any other. For instance `Opaque` (aka we don't know anything), non-deterministic constants and borrows.

The current algorithm generates a unique index, so the generated `Value` will be different from all the existing. This is wasteful, as we should not hash that `Value` at all.

This PR proposes to do this. This involves partially reimplementing a `FxIndexSet`, but yields a small but consistent perf improvement (https://github.com/rust-lang/rust/pull/145737#issuecomment-3276951054).
2025-09-19 12:15:03 +00:00
Ralf Jung
7af6e590a4 update lockfile 2025-09-18 23:33:38 +02:00
Philipp Krones
5d1619b3ec
Update Cargo.lock 2025-09-18 17:21:54 +02:00
Jynn Nelson
2adaa5dae2 Bump rustfix 0.8.1 -> 0.8.7
This commit can be replicated by running
`cargo update -p rustfix --precise 0.8.7 && x test ui --bless`.

---

The reasons this affects UI tests is as follows:
- The UI test suite runs rustc with
    `-Z deduplicate-diagnostics=no --error-format=json`,
  which means that rustc emits multiple errors containing identical
  suggestions. That caused the weird-looking code that had multiple `X: Copy` suggestions.
- Those suggestions are interpreted not by rustc itself, but by the
  `rustfix` library, maintained by cargo but published as a separate
  crates.io library and used by compiletest.
- Sometime between rustfix 0.8.1 and 0.8.7 (probably in cargo 14747, but
  it's hard to tell because rustfix's versioning doesn't match cargo's),
  rustfix got smarter and stopped applying duplicate suggestions.

Update rustfix to match cargo's behavior. Ideally, we would always share
a version of rustfix between cargo and rustc (perhaps with a path
dependency?), to make sure we are testing the behavior we ship. But for
now, just manually update it to match.

Note that the latest version of rustfix published to crates.io is 0.9.1,
not 0.8.7. But 0.9.1 is not the version used in cargo, which is 0.9.3.
Rather than trying to match versions exactly, I just updated rustfix to
the latest in the 0.8 branch.
2025-09-15 10:48:26 -07:00
Camille Gillot
3d0eda7af8 Introduce ValueSet. 2025-09-13 17:14:04 +00:00
Noratrieb
f157ce994e Add --print target-spec-json-schema
This schema is helpful for people writing custom target spec JSON. It
can provide autocomplete in the editor, and also serves as documentation
when there are documentation comments on the structs, as `schemars` will
put them in the schema.
2025-09-12 20:53:28 +02:00
Daniel Paoliello
458f3873d6 Bump miow to 0.60.1 2025-09-10 15:39:13 -07:00
Matthias Krüger
29cbf41517
Rollup merge of #146378 - alexcrichton:update-wasm-component-ld, r=lqd
Update wasm-component-ld to 0.5.17

Keeping this up-to-date as the project itself, and its dependencies, are updated.
2025-09-10 14:17:39 +02:00
Alex Crichton
6e36750c61 Update wasm-component-ld to 0.5.17
Keeping this up-to-date as the project itself, and its dependencies, are
updated.
2025-09-09 10:30:03 -07:00
Matthias Krüger
f46ddbab2f
Rollup merge of #146001 - bjorn3:update_getopts, r=davidtwco
Update getopts to remove unicode-width dependency

Pulls in https://github.com/rust-lang/getopts/pull/133. This saves 1.5MB on the vendored size of the standard library.
2025-09-09 17:32:21 +02:00
bors
be8de5d6a0 Auto merge of #146360 - Zalathar:rollup-qc2hhrd, r=Zalathar
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#139593 (add sitemap to rust docs)
 - rust-lang/rust#145819 (Port limit attributes to the new attribute parsing infrastructure)
 - rust-lang/rust#146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`)
 - rust-lang/rust#146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit)
 - rust-lang/rust#146195 (fix partial urlencoded link support)
 - rust-lang/rust#146300 (Implement `Sum` and `Product` for `f16` and `f128`.)
 - rust-lang/rust#146314 (mark `format_args_nl!` as `#[doc(hidden)]`)
 - rust-lang/rust#146324 (const-eval: disable pointer fragment support)
 - rust-lang/rust#146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.))
 - rust-lang/rust#146339 (Update books)
 - rust-lang/rust#146343 (Weakly export `platform_version` symbols)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-09 11:54:44 +00:00
Stuart Cook
3bd603b239
Rollup merge of #146195 - nixxo:urlencoding-fix, r=ehuss
fix partial urlencoded link support

Hello Rust community.
This is my first contribution, hope is useful.

While translating in Italian the rust book https://github.com/nixxo/rust-lang-book-it I noticed that the linkchecker tool was failing reporting broken links on some pages even if the link worked properly in the browser. Upon inspection I noticed that mdbook basically urlencoded the links, but not urlencoded the heading IDs resulting in a non-identical anchor/IDs pairing that linkchecker reports as non-valid.

looking at the source code for the linkchecker tool I noticed that urlencoding was done by the `small_url_encode` function in a partial way, as the name suggests. Replacing this function with a full urlencoding fixes the issue and the links are properly reported as valid.

- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs
- added tests

urlecoding provided by https://crates.io/crates/urlencoding
2025-09-09 14:35:03 +10:00
Stuart Cook
33318ed207
Rollup merge of #145819 - jdonszelmann:convert-limits, r=fmease
Port limit attributes to the new attribute parsing infrastructure

Doesn't pass tests, to be rebased on https://github.com/rust-lang/rust/pull/145792 which will solve that

r? `@fmease`
2025-09-09 14:35:01 +10:00
bors
fefce3cecd Auto merge of #146018 - lambdageek:add-winres-version, r=wesleywiser
compiler: Add Windows resources to rustc-main and rustc_driver

Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll

Invokes `rc.exe` directly, rather than using one of the crates from the ecosystem to avoid adding dependencies.

A new internal `rustc_windows_rc` crate has the common build script machinery for locating `rc.exe` and constructing the resource script
2025-09-09 03:56:41 +00:00
bors
e9b6085088 Auto merge of #146188 - dpaoliello:tracing, r=Kobzol
Update tracing and fix binary regression

Previous attempts (rust-lang/rust#127316, rust-lang/rust#134770) saw binary size regressions, this was root caused to <https://github.com/tokio-rs/tracing/pull/2553> which changed the behavior of the `max_level_info` feature flag to match the docs (i.e., that flag only applies for debug builds and `release_max_level_info` applies for release builds).

This change bumps the `tracing` version and sets both `max_level_info` and `release_max_level_info` when to match rustc's own `max_level_info`.
2025-09-09 00:47:03 +00:00
Jana Dönszelmann
6087d89004
fixup limit handling code 2025-09-08 15:07:12 -07:00
nixxo
8b58777968 fix partial urlencoded link support
- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs
- added tests

urlecoding provided by https://crates.io/crates/urlencoding
2025-09-08 11:08:40 -07:00
Daniel Paoliello
266f8c9c00 Update tracing, again 2025-09-08 09:23:37 -07:00
lcnr
f514586408 optimize CanonicalVarValues::instantiate 2025-09-08 14:17:56 +02:00
bors
ebdf2abea4 Auto merge of #146271 - niacdoial:improperctypes-refactor1, r=tgross35
lint ImproperCTypes: refactor linting architecture (part 1)

This is the first PR in an effort to split  rust-lang/rust#134697 into individually-mergeable parts.

This one focuses on properly packaging the lint and its tests, as well as properly separate the "linting" and "type-checking" code.

There is exactly one user-visible change: the safety of `Option<Box<FFISafePointee>>` is now the same in `extern` blocks and function definitions: it is safe.

r? `@tgross35` because you are already looking at the original
2025-09-07 04:17:27 +00:00
niacdoial
20f050b444
ImproperCTypes: redo state tracking
No changes should be visible by rustc users
This is just some architecture changes to the type checking to
facilitate FFI-safety decisions that depend on how the type is used
(the change here is not complete, there are still bits of "legacy" state
passing for this, but since this is a retconned commit, I can tell you
those bits will disappear before the end of the commit chain)
(there is at least one bit where the decision making code is weird, but
that this is because we do not want to change the lint's behaviour this
early in the chain)
2025-09-06 22:00:28 +02:00
Matthias Krüger
8fe82a0e9e
Rollup merge of #146263 - jieyouxu:check-bump-stage0, r=Kobzol
Fix `bump-stage0` build failure, and check-build `bump-stage0` in CI

This PR bumps the `toml` dependency of the `bump-stage0` tool to `0.8.23`, which AFAICT is the highest `toml` version that's present in the r-l/r workspace's `Cargo.lock` already (so we don't introduce _another_ `toml 0.x.*` series). I added some byte-buffer-to-string intermediary to workaround `toml 0.8.*` not having the `toml 0.9.*` `toml::from_slice` API.

To catch obvious build failures of the `src/tools/bump-stage0` tool early, before we find out it can't even build when we really need it to work.

Contexts:

- https://github.com/rust-lang/rust/pull/146250#issue-3388327410
- [#t-release > Bump stage0 rustfmt separately ("one-off") @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/Bump.20stage0.20rustfmt.20separately.20.28.22one-off.22.29/near/537916615)

Fixes rust-lang/rust#146252.
2025-09-06 13:03:17 +02:00
Matthias Krüger
020edbe4cf
Rollup merge of #127316 - klensy:tracing-bump, r=Kobzol
move pinned version from tracing_core to tracing

This PR removes pin from `tracing-core` and moves it to `tracing`, which regressed perf in > 0.1.37 versions.
2025-09-06 13:03:15 +02:00
Jieyou Xu
5f372fe7d1
bump-stage0: pick highest common toml version, add a workaround
- We pick the higest common `toml` version used in the r-l/r workspace
  to avoid introducing Yet Another `toml` `0.x` version, which happens
  to be `0.8.23` as of the time of writing.
- We introduce a byte-buffer-to-string workaround for the `toml 0.8.*`
  series that do not have the `toml 0.9.*` series's `toml::from_slice`
  API yet. Not efficient, but this is not perf-critical so it's fine.
2025-09-06 16:33:11 +08:00
Aleksey Kliger
095fa86a3b compiler: Add Windows resources to rustc-main and rustc_driver
Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll

Sets the product description to "Rust Compiler" or "Rust Compiler (channel)" for non-stable channels
2025-09-05 14:06:31 -04:00
bors
af00ff2ce6 Auto merge of #145911 - notriddle:stringdex-tweak-3, r=GuillaumeGomez
rustdoc-search: yet another stringdex optimization attempt

This one's uses a different tactic. It shouldn't significantly increase the amount of downloaded index data, but still reduces the amount of disk usage.

This one works by changing the suffix-only node representation to omit some data that's needed for checking. Since those nodes make up the bulk of the tree, it reduces the data they store, but also requires validating the match by fetching the name itself (but the names list is pretty small, and when I tried it with wordnet "indexing" it was about the same).

r? `@GuillaumeGomez`
2025-09-04 19:40:40 +00:00
klensy
267d3c8508 rustc_log: remove direct dep on tracing_core
required features reexported from tracing
2025-09-04 13:25:11 +03:00
klensy
17b27d8e6c unpin tracing_core 2025-09-04 13:24:42 +03:00