Skip to content

Commit a57fc3a

Browse files
committed
Auto merge of #153770 - JonathanBrouwer:rollup-522Yrag, r=JonathanBrouwer
Rollup of 10 pull requests Successful merges: - rust-lang/rust#153726 (Add optional CI job to build the compiler with the parallel frontend) - rust-lang/rust#153763 (Don't add empty target features for target-cpu=native on macOS) - rust-lang/rust#153432 (Fix some comments about dataflow analysis.) - rust-lang/rust#153529 (Fix LegacyKeyValueFormat report from docker build: pr) - rust-lang/rust#153694 (fix(query): Pass Query Key to `value_from_cycle_error`) - rust-lang/rust#153717 (unused_macro_rules switched used and unused comments) - rust-lang/rust#153736 (add test that an incomplete feature emits a warning) - rust-lang/rust#153748 (editorconfig: css uses tabs) - rust-lang/rust#153750 (rustc-dev-guide subtree update) - rust-lang/rust#153762 (actually make the is-fn test test what it says it tests)
2 parents bacde4f + 01682d0 commit a57fc3a

11 files changed

Lines changed: 77 additions & 17 deletions

File tree

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c78a29473a68f07012904af11c92ecffa68fcc75
1+
eda4fc7733ee89e484d7120cafbd80dcb2fce66e

src/autodiff/installation.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
11
# Installation
22

3-
In the near future, `std::autodiff` should become available in nightly builds for users. As a contributor however, you will still need to build rustc from source. Please be aware that the msvc target is not supported at the moment, all other tier 1 targets should work. Please open an issue if you encounter any problems on a supported tier 1 target, or if you successfully build this project on a tier2/tier3 target.
3+
In the near future, `std::autodiff` should become available for users via rustup. As a rustc/enzyme/autodiff contributor however, you will still need to build rustc from source.
4+
For the meantime, you can download up-to-date builds to enable `std::autodiff` on your latest nightly toolchain, if you are using either of:
5+
**Linux**, with `x86_64-unknown-linux-gnu` or `aarch64-unknown-linux-gnu`
6+
**Windows**, with `x86_64-llvm-mingw` or `aarch64-llvm-mingw`
7+
8+
You can also download slightly outdated builds for **Apple** (aarch64-apple), which should generally work for now.
9+
10+
If you need any other platform, you can build rustc including autodiff from source. Please open an issue if you want to help enabling automatic builds for your prefered target.
11+
12+
## Installation guide
13+
14+
If you want to use `std::autodiff` and don't plan to contribute PR's to the project, then we recommend to just use your existing nightly installation and download the missing component. In the future, rustup will be able to do it for you.
15+
For now, you'll have to manually download and copy it.
16+
17+
1) On our github repository, find the last merged PR: [`Repo`]
18+
2) Scroll down to the lower end of the PR, where you'll find a rust-bors message saying `Test successful` with a `CI` link.
19+
3) Click on the `CI` link, and grep for your target. E.g. `dist-x86_64-linux` or `dist-aarch64-llvm-mingw` and click `Load summary`.
20+
4) Under the `CI artifacts` section, find the `enzyme-nightly` artifact, download, and unpack it.
21+
5) Copy the artifact (libEnzyme-22.so for linux, libEnzyme-22.dylib for apple, etc.), which should be in a folder named `enzyme-preview`, to your rust toolchain directory. E.g. for linux: `cp ~/Downloads/enzyme-nightly-x86_64-unknown-linux-gnu/enzyme-preview/lib/rustlib/x86_64-unknown-linux-gnu/lib/libEnzyme-22.so ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib`
22+
23+
Apple support was temporarily reverted, due to downstream breakages. If you want to download autodiff for apple, please look at the artifacts from this [`run`].
24+
25+
## Installation guide for Nix user.
26+
27+
This setup was recommended by a nix and autodiff user. It uses [`Overlay`]. Please verify for yourself if you are comfortable using that repository.
28+
In that case you might use the following nix configuration to get a rustc that supports `std::autodiff`.
29+
```nix
30+
{
31+
enzymeLib = pkgs.fetchzip {
32+
url = "https://ci-artifacts.rust-lang.org/rustc-builds/ec818fda361ca216eb186f5cf45131bd9c776bb4/enzyme-nightly-x86_64-unknown-linux-gnu.tar.xz";
33+
sha256 = "sha256-Rnrop44vzS+qmYNaRoMNNMFyAc3YsMnwdNGYMXpZ5VY=";
34+
};
35+
36+
rustToolchain = pkgs.symlinkJoin {
37+
name = "rust-with-enzyme";
38+
paths = [pkgs.rust-bin.nightly.latest.default];
39+
nativeBuildInputs = [pkgs.makeWrapper];
40+
postBuild = ''
41+
libdir=$out/lib/rustlib/x86_64-unknown-linux-gnu/lib
42+
cp ${enzymeLib}/enzyme-preview/lib/rustlib/x86_64-unknown-linux-gnu/lib/libEnzyme-22.so $libdir/
43+
wrapProgram $out/bin/rustc --add-flags "--sysroot $out"
44+
'';
45+
};
46+
}
47+
```
448

549
## Build instructions
650

@@ -87,3 +131,6 @@ ninja
87131
```
88132
This will build Enzyme, and you can find it in `Enzyme/enzyme/build/lib/<LLD/Clang/LLVM/lib>Enzyme.so`. (Endings might differ based on your OS).
89133

134+
[`Repo`]: https://github.com/rust-lang/rust/
135+
[`run`]: https://github.com/rust-lang/rust/pull/153026#issuecomment-3950046599
136+
[`Overlay`]: https://github.com/oxalica/rust-overlay

src/backend/updating-llvm.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ Rust supports building against multiple LLVM versions:
66
* Tip-of-tree for the current LLVM development branch is usually supported within a few days.
77
PRs for such fixes are tagged with `llvm-main`.
88
* The latest released major version is always supported.
9-
* The one or two preceding major versions are usually supported.
9+
* The one or two preceding major versions are usually supported in the sense that they are expected
10+
to build successfully and pass most tests.
11+
However, fixes for miscompilations often do not get
12+
backported to past LLVM versions, so using rustc with older versions of LLVM comes with an
13+
increased risk of soundness bugs.
14+
We strongly recommend using the latest version of LLVM.
1015

1116
By default, Rust uses its own fork in the [rust-lang/llvm-project repository].
1217
This fork is based on a `release/$N.x` branch of the upstream project, where

src/building/how-to-build-and-run.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ Also, using `x` rather than `x.py` is recommended as:
110110
Notice that this is not absolute.
111111
For instance, using Nushell in VSCode on Win10,
112112
typing `x` or `./x` still opens `x.py` in an editor rather than invoking the program.
113-
:)
114113

115114
In the rest of this guide, we use `x` rather than `x.py` directly.
116115
The following command:

src/conventions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ if foo {
139139
}
140140
```
141141

142+
If you want to leave a note in the codebase, use `// FIXME` instead.
143+
142144
<a id="cio"></a>
143145

144146
## Using crates from crates.io

src/diagnostics/translation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ There are two ways of writing translatable diagnostics:
3131
("Simple" diagnostics being those that don't require a lot of logic in
3232
deciding to emit subdiagnostics and can therefore be represented as diagnostic structs).
3333
See [the diagnostic and subdiagnostic structs documentation](./diagnostic-structs.md).
34-
2. Using typed identifiers with `Diag` APIs (in
35-
`Diagnostic` or `Subdiagnostic` implementations).
34+
2. Using typed identifiers with `Diag` APIs (in `Diagnostic` or `Subdiagnostic` implementations).
3635

3736
When adding or changing a translatable diagnostic,
3837
you don't need to worry about the translations.

src/feature-gate-check.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nightly-only `#![feature(...)]` opt-in.
88
This chapter documents the implementation
99
of feature gating: where gates are defined, how they are enabled, and how usage is verified.
1010

11-
<!-- data-check: Feb 2026 -->
11+
<!-- date-check: Feb 2026 -->
1212

1313
## Feature Definitions
1414

src/git.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ Both the upside and downside of this is that it simplifies the history.
383383
On the one hand, you lose track of the steps in which changes were made, but
384384
the history becomes easier to work with.
385385

386+
The easiest way to squash your commits in a PR on the `rust-lang/rust` repository is to use the `@bors squash` command in a comment on the PR.
387+
By default, [bors] combines all commit messages of the PR into the squashed commit message.
388+
To customize the commit message, use `@bors squash msg=<commit message>`.
389+
390+
391+
If you want to squash commits using local git operations, read on below.
392+
386393
If there are no conflicts and you are just squashing to clean up the history,
387394
use `git rebase --interactive --keep-base main`.
388395
This keeps the fork point of your PR the same, making it easier to review the diff of what happened
@@ -410,11 +417,6 @@ because they only represent "fixups" and not real changes.
410417
For example,
411418
`git rebase --interactive HEAD~2` will allow you to edit the two commits only.
412419

413-
For pull requests in `rust-lang/rust`, you can ask [bors] to squash by commenting
414-
`@bors squash` on the PR.
415-
By default, [bors] combines all commit messages in the PR.
416-
To customize the commit message, use `@bors squash [msg|message=<commit-message>]`.
417-
418420
[bors]: https://github.com/rust-lang/bors
419421

420422
### `git range-diff`

src/query.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dependencies of the local crate)
9090
Note that what determines the crate that a query is targeting is not the *kind* of query, but the *key*.
9191
For example, when you invoke `tcx.type_of(def_id)`, that could be a
9292
local query or an external query, depending on what crate the `def_id`
93-
is referring to (see the [`self::keys::Key`][Key] trait for more information on how that works).
93+
is referring to (see the [`self::keys::QueryKey`][QueryKey] trait for more information on how that works).
9494

9595
Providers always have the same signature:
9696

@@ -308,7 +308,7 @@ Let's go over these elements one by one:
308308
Also used as the name of a struct (`ty::queries::type_of`) that will be generated to represent
309309
this query.
310310
- **Query key type:** the type of the argument to this query.
311-
This type must implement the [`ty::query::keys::Key`][Key] trait, which
311+
This type must implement the [`ty::query::keys::QueryKey`][QueryKey] trait, which
312312
defines (for example) how to map it to a crate, and so forth.
313313
- **Result type of query:** the type produced by this query.
314314
This type should (a) not use `RefCell` or other interior mutability and (b) be
@@ -317,7 +317,7 @@ Let's go over these elements one by one:
317317
- **Query modifiers:** various flags and options that customize how the
318318
query is processed (mostly with respect to [incremental compilation][incrcomp]).
319319

320-
[Key]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/query/keys/trait.Key.html
320+
[QueryKey]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/query/keys/trait.QueryKey.html
321321
[incrcomp]: queries/incremental-compilation-in-detail.html#query-modifiers
322322

323323
So, to add a query:

src/tests/ci.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ The live results can be seen on [the GitHub Actions workflows page].
109109
At any given time, at most a single `auto` build is being executed.
110110
Find out more in [Merging PRs serially with bors](#merging-prs-serially-with-bors).
111111

112+
Normally, when an auto job fails, the whole CI workflow immediately ends. However, it can be useful to
113+
create auto jobs that are "non-blocking", or optional, to test them on CI for some time before blocking
114+
merges on them. This can be useful if those jobs can be flaky.
115+
116+
To do that, prefix such a job with `optional-`, and set `continue_on_error: true` for it in [`jobs.yml`].
117+
112118
[platform tiers]: https://forge.rust-lang.org/release/platform-support.html#rust-platform-support
113119
[auto]: https://github.com/rust-lang/rust/tree/automation/bors/auto
114120

0 commit comments

Comments
 (0)