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.
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).
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`.
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"
...
```
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"
...
```
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
[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).
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`).
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).
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.