Commit Graph

173882 Commits

Author SHA1 Message Date
bors 281c97c324 Auto merge of #156518 - estebank:match-rustfmt, r=mejrs
[style] rustfmt `match`es with comments in or-patterns

Using https://github.com/rust-lang/rustfmt/pull/6893, I reformatted the whole codebase. The result is that `match`es that *should have* been formatted under normal circumstances but are getting skipped now got their expected format. These match expressions were being entirely skipped because they contain or-patterns with comments in between patterns, causing rustfmt to bail out entirely. The or-patterns with comments themselves remain untouched, but now the match arm bodies and other patterns without comments do get formatted under that PR.

Because the fix in rustfmt isn't landed yet, I reworked some of the or-patterns with comments so that formatting doesn't regress. Tried doing this only in larger blocks that are more likely to regress in the meantime.

(Introduced and) removed a bunch of stray backticks \` likely left after an editor autoclosed the intended closing \`, resulting in <code>\`name\`\`</code> in comments.
2026-05-17 01:27:37 +00:00
bors d3cd04068e Auto merge of #152449 - GuillaumeGomez:rustdoc-bang-attr-macro, r=lolbinarycat,mejrs
rustdoc: properly support macros with multiple kinds



Since it seems like I can't reopen https://github.com/rust-lang/rust/pull/145458, opening this one. Although, it's the same PR minus the last new commit to handle a comment that was left unresolved in the original PR. All relevant details are still in the original PR though.

It's an alternative (and likely a take-over) of https://github.com/rust-lang/rust/pull/148005 since lang-team rejected the idea to add documentation on macro branches, making the multiple files approach less suitable.

This implements rust-lang/rust#145153 in rustdoc. This PR voluntarily doesn't touch anything related to intra-doc links, I'll send a follow-up if needed.

So now about the implementation itself: this is a weird case where a macro can be different things at once but still only gets one file generated. I saw two ways to implement this:
1. Handle `ItemKind::Macro` differently and iter through its `MacroKinds` values.
2. Add new placeholder variants in the `ItemKind` enum, which means that when we encounter them in rendering, we need to ignore them. It also makes the `ItemKind` enum bigger (and also needs more code to be handled). Another downside is that it needs to be handled in the JSON output.

Now there was an interesting improvement that came with this PR in the `html::render::print_item::item_module` function: I simplified its implementation and split the different parts in a `HashMap` where the key is the item type. So then, we can just iterate through the keys and open/close the section at each iteration instead of keeping an `Option<section>` around.

From RFCs:
* https://github.com/rust-lang/rust/pull/144579
* https://github.com/rust-lang/rust/pull/145208

derive:

<img width="442" height="327" alt="Screenshot From 2026-04-18 03-11-40" src="https://github.com/user-attachments/assets/f69587a0-8a2b-4080-bc8a-b63dd18f21c1" />

attr:

<img width="442" height="327" alt="Screenshot From 2026-04-18 03-11-31" src="https://github.com/user-attachments/assets/bf9b235a-9d2f-435c-a91e-167562df6b68" />

both:

<img width="442" height="327" alt="Screenshot From 2026-04-18 03-11-50" src="https://github.com/user-attachments/assets/b7e8b3c6-eb99-495b-bdf9-17ba8fb4da0d" />

r? @notriddle
2026-05-16 18:54:36 +00:00
Eric Huss e795c2e4df Remove broken dilos apt repo
CI is currently down because apt is unable to access the repo at
dilos.org. It is failing inside the fortanix install script which tries
to run apt-get with the error:

```
5.679 E: Failed to fetch https://apt.dilos.org/dilos/dists/dilos2/InRelease  403  Forbidden [IP: 116.202.240.188 443]
```

These lines in the Dockerfile were added when Solaris builds were merged
into dist-various-2 in https://github.com/rust-lang/rust/pull/45001.
However, Solaris builds were split off in
https://github.com/rust-lang/rust/pull/138699. In that PR, these lines
adding the dilos repository weren't removed.

AFAICT, these are no longer necessary.
2026-05-16 06:53:31 -07:00
Jonathan Brouwer 6708081d6b Rollup merge of #156587 - GuillaumeGomez:assoc-items-macro-expansion, r=Urgau
Correctly handle associated items in rustdoc macro expansion

Fixes rust-lang/rust#156075.

The bug was simply that it didn't cover associated items.

r? @Urgau
2026-05-15 20:11:48 +02:00
Guillaume Gomez 85dfedade1 Correctly handle associated items in rustdoc macro expansion 2026-05-15 00:42:17 +02:00
Guillaume Gomez 1f5737c853 Rollup merge of #156564 - nnethercote:LevelSpec, r=GuillaumeGomez
Lint level cleanups

Some naming improvements, some type safety improvements, and some simplifications. Details in individual commits.

r? @GuillaumeGomez
2026-05-14 16:51:08 +02:00
Guillaume Gomez 6f222b3f90 Rollup merge of #146220 - weihanglo:rustdoc-emit, r=GuillaumeGomez
feat(rustdoc): stabilize `--emit` flag

### [---> FCP <---](https://github.com/rust-lang/rust/pull/146220#issuecomment-3740447985)

## Stabilization Report: `rustdoc --emit`

**Feature:** `rustdoc --emit`
**Tracking issue:** rust-lang/rust#83784
**Stabilization PR:** rust-lang/rust#146220

### What we are stabilizing

This stabilizes the `rustdoc --emit` flag, which controls what types of output rustdoc produces. The flag accepts a comma-separated list of the following emit types:

- `html-static-files` --- Shared static files with content-hashed filenames for safe caching.
- `html-non-static-files` --- Per-crate documentation files with deterministic filenames.
- `dep-info[=<path>]` --- A Makefile-compatible `.d` file listing all source files loaded during documentation generation. Same as rustc's dep-info files.

When `--emit` is not specified, the default behavior is `--emit=html-static-files,html-non-static-files` (i.e., full HTML documentation output, no dep-info).

### What we are not stabilizing

* Interaction between other unstable options, such as `-Zrustdoc-mergeable-info` and `--output-format=doctest`
* Available options and the default options when `--emit` not specified.
* Extension of per-type emit paths for options currently missing that.

### Motivation

#### Cargo

The primary consumer is Cargo, which needs `--emit=dep-info=<path>` to precisely track the input dependencies of a rustdoc invocation (see the [`-Zrustdoc-depinfo`] unstable Cargo feature). Without dep-info, Cargo cannot detect changes to files pulled in via `#[path = "..."]` or similar mechanisms and leads to stale documentation in incremental builds.

Cargo also uses the selective emission mechanism (`html-static-files` / `html-non-static-files`) when the unstable [`-Zrustdoc-mergeable-info`] feature is active. It skips writing shared static files and search index during per-crate doc generation and defer them to a final merge phase.

Under stable usage, Cargo passes all three emit types together.

#### docs.rs

docs.rs is the other major consumer. It uses selective emission to avoid redundantly copying toolchain-wide static files for every crate, which has historically been a source of breakage. See the tracking rust-lang/rust#83784 and the about page for more <https://docs.rs/about/download>.

### Tests

- `tests/run-make/emit-shared-files` --- Verifies selective emission of static vs non-static files.
- `tests/run-make/rustdoc-dep-info` --- Verifies dep-info generation, including explicit path and `--out-dir` interaction.
- `tests/run-make/rustdoc-scrape-examples-dep-info` --- Verifies dep-info works with scrape-examples.
- `tests/run-make/rustdoc-default-output/` --- Verifies `--help` output shows `[html-static-files,html-non-static-files,dep-info]`

[`-Zrustdoc-depinfo`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#rustdoc-depinfo
[`-Zrustdoc-mergeable-info`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#rustdoc-mergeable-info
2026-05-14 16:51:07 +02:00
Nicholas Nethercote 530a73f17e Prevent invalid LevelSpec values
`LevelSpec` has two related fields, `level` and `lint_id`. This commit
makes the fields private (and introduces getters) to ensure they are set
together using only valid combinations.

The commit also introduces `is_allow` and `is_expect` methods because
those are useful.
2026-05-14 16:28:50 +10:00
Nicholas Nethercote f439907325 Streamline Level::from_{attr,symbol}
These methods return `Option<(Self, Option<LintExpectationId>)>`. But
all the call sites except one don't look at the
`Option<LintExpectationId>`.

This commit simplifies these methods to not return the
`Option<LintExpectationId>`. This means they no longer need to be passed
a closure to compute an `AttrId` (which is usually discarded anyway).
The commit also renames `from_attr` as `from_opt_symbol`, because it
takes an `Option<Symbol>`, not an `Attribute`.

These changes simplify all the call sites that don't need the
`Option<LintExpectationId>`, and also the one call site that does (in
`LintLevelsBuilder::add`): that call site no longer needs to do an
awkward destructuring, and can instead build the appropriate
`LintExpectationId` directly.
2026-05-14 16:28:50 +10:00
许杰友 Jieyou Xu (Joe) 76d07a61f3 Rollup merge of #156531 - Zalathar:no-pass-override, r=jieyouxu
compiletest: Rename `//@ ignore-pass` to `//@ no-pass-override`

By convention, compiletest directives starting with `ignore-*` normally cause the test itself to be skipped under certain conditions.

The `//@ ignore-pass` directive was the only exception to that convention. The new name should hopefully do a better job of communicating its effect, which is to cause the `--pass` flag to not override the test's `build-pass` or `run-pass` directive.

The `//@ no-pass-override` directive is mainly useful for tests that expect warnings produced during codegen.

---
r? jieyouxu
2026-05-14 13:24:34 +08:00
许杰友 Jieyou Xu (Joe) 772f42b5b7 Rollup merge of #156450 - Zalathar:colon-or-not, r=jieyouxu
compiletest: Enforce that directives are consistently used with or without a colon

With the notable exception of `//@ pp-exact`, all directives expect to either always be used *with* a colon, or always be used *without* a colon. For example:

- `//@ uses-colon: value`
- `//@ no-colon` or `//@ no-colon (remark)`

Currently we just silently discard directives that use the wrong syntax, which is not great.

This PR therefore makes `parse_name_directive` and `parse_name_value_directive` panic if the wrong syntax is encountered.

The parser for `pp-exact` has been adjusted to check for the colon before deciding which parse method to call.

r? jieyouxu
2026-05-14 13:24:33 +08:00
Nicholas Nethercote ccfac5469a Rename LevelAndSource
It is misnamed, given that it has three fields: `level`, `lint_id`, and
`src`. (Presumably the `lint_id` was added later.)

This commit renames it as `LevelSpec`. (I also considered `LevelInfo`
but that's very generic. `Spec` has pre-existing uses in
`LintLevelsProvider::current_specs` and `LintSet::specs` and
`ShallowLintLevelMap::specs`.)

Related things renamed as well:
- `level` -> `level_spec` (where appropriate)
- `lint_levels` -> `lint_level_specs`
- `get_lint_level` -> `get_lint_level_spec`
- `level_and_source` -> `level_spec`
- `CodegenLintLevels` -> `CodegenLintLevelSpecs`
- `raw_lint_id_level` -> `raw_lint_level_spec`
- `lint_level_at_node` -> `lint_level_spec_at_node`
- `reveal_actual_level` -> `reveal_actual_level_spec`
- `probe_for_lint_level` -> `probe_for_lint_level_spec`

This clears up a lot of `Level` vs. `LevelSpec` ambiguity. E.g. no more
`level.level` expressions.
2026-05-14 13:20:57 +10:00
Jonathan Brouwer be6fdeed82 Rollup merge of #156540 - cyrgani:unbox-rustdoc, r=GuillaumeGomez
use `deref_patterns` in `rustdoc` instead of `box_patterns`

Part of https://github.com/rust-lang/rust/issues/156110.
2026-05-14 00:35:40 +02:00
Jonathan Brouwer 0f950ce670 Rollup merge of #156413 - fmease:rustdoc-ltd-improvs, r=GuillaumeGomez
rustdoc: Correctness & perf improvements to link-to-definition

Rewrite the way we resolve type-dependent paths (incl. method calls) in `SpanMapVisitor`. Instead of trying to (re)find the enclosing body owner each time we encounter such a node, potentially calling `typeck_body` several times per body, keep track of the "active" `BodyId` in the visitor and cache the corresponding `TypeckResults`. The "active" `BodyId` is updated in `visit_nested_body` (add) and in `visit_item` (remove).

This fixes a class of ICEs where we tried to look up the definition of type-relative paths located in non-body items nested in bodies, in the overarching body which is never correct. rustdoc@main has a hack to fix this issue for paths specifically found in assoc types in impls.

Fixes rust-lang/rust#147882. Fixes rust-lang/rust#147057. Fixes rust-lang/rust#155327. Fixes rust-lang/rust#149089. Fixes rust-lang/rust#150153. Fixes rust-lang/rust#156418.
Supersedes rust-lang/rust#147911.

---

`--generate-link-to-definition` is not enabled by default, so we can't perf this as is. Instead, I'm benching them against PR rust-lang/rust#156348 in PR https://github.com/rust-lang/rust/pull/156355 using the same parent commit for the try-builds. For context, LTD is *extremely* costly as the perf run for the baseline PR shows: https://github.com/rust-lang/rust/pull/156348#issuecomment-4411427326.

"Absolute results": https://github.com/rust-lang/rust/pull/156355#issuecomment-4421922342.
"Relative results": [https://perf.rust-lang.org/compare.html?...](https://perf.rust-lang.org/compare.html?start=68c2bff6cb08a87e59246064a6a9f37098e22c3f&end=78d15de5525370011388c8f63847e873c4de14ed&stat=instructions%3Au).

Excerpt of the relative results:

Primary:

Benchmark | Profile | Scenario | Backend | Target | % Change | Significance Threshold | Significance Factor
---|---|---|---|---|---|---|---
nalgebra-0.33.0 | doc | full | llvm | x64 | -5.82% | 0.20% | 29.09x
diesel-2.2.10 | doc | full | llvm | x64 | -3.41% | 0.20% | 17.05x
image-0.25.6 | doc | full | llvm | x64 | -2.03% | 0.20% | 10.16x
regex-automata-0.4.8 | doc | full | llvm | x64 | -1.94% | 0.20% | 9.71x
cargo-0.87.1 | doc | full | llvm | x64 | -1.64% | 0.20% | 8.21x
clap_derive-4.5.32 | doc | full | llvm | x64 | -1.63% | 0.20% | 8.14x
cranelift-codegen-0.119.0 | doc | full | llvm | x64 | -1.48% | 0.20% | 7.41x
syn-2.0.101 | doc | full | llvm | x64 | -1.07% | 0.20% | 5.35x
ripgrep-14.1.1 | doc | full | llvm | x64 | -0.96% | 0.20% | 4.78x
stm32f4-0.15.1 | doc | full | llvm | x64 | -0.80% | 0.20% | 4.01x
serde-1.0.219 | doc | full | llvm | x64 | -0.67% | 0.20% | 3.33x
hyper-1.6.0 | doc | full | llvm | x64 | -0.66% | 0.20% | 3.30x
eza-0.21.2 | doc | full | llvm | x64 | -0.55% | 0.20% | 2.74x
unicode-normalization-0.1.24 | doc | full | llvm | x64 | -0.49% | 0.20% | 2.45x
serde_derive-1.0.219 | doc | full | llvm | x64 | -0.45% | 0.20% | 2.26x
typenum-1.18.0 | doc | full | llvm | x64 | -0.42% | 0.20% | 2.08x
bitmaps-3.2.1 | doc | full | llvm | x64 | -0.32% | 0.20% | 1.61x

Secondary:

Benchmark | Profile | Scenario | Backend | Target | % Change | Significance Threshold | Significance Factor
---|---|---|---|---|---|---|---
deep-vector | doc | full | llvm | x64 | -23.96% | 0.20% | 119.78x
large-workspace | doc | full | llvm | x64 | -2.16% | 0.20% | 10.81x
deeply-nested-multi | doc | full | llvm | x64 | -1.35% | 0.20% | 6.75x
serde-1.0.219-threads4 | doc | full | llvm | x64 | -0.67% | 0.20% | 3.33x
wg-grammar | doc | full | llvm | x64 | -0.32% | 0.20% | 1.62x
tt-muncher | opt | full | llvm | x64 | -0.31% | 0.20% | 1.56x

nalgebra-0.33.0:

Query/Function | Time (%) | Time (s) | Time delta | Executions | Executions delta | Hits | Hits delta
---|---|---|---|---|---|---|---
Totals | 109.57% | 2.185 | -0.138 (-5.9%) | 1614146 | -5602 (-0.3%) | 16983840 | -1436455 (-7.8%)
typeck_root | 15.75% | 0.344 | -0.105 (-23.4%) | 1704 | -954 (-35.9%) | 393 | -6758 (-94.5%)
...|...|...|...|...|...|...|...
2026-05-14 00:35:38 +02:00
Jonathan Brouwer 0eeba4bccd Rollup merge of #156552 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? Manishearth

`Cargo.lock` update due to patch version bump in `ui_test`.

One day early, as I won't have access to my laptop from tomorrow till Sunday
2026-05-14 00:35:35 +02:00
bors ff9a9ea07b Auto merge of #138995 - oli-obk:split-resolver, r=petrochenkov
Split the node_id_to_def_id table into a per-owner table

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/138995)*

My goal is to split all the resolver tables that get passed to act lowering into per-owner tables, so that all information that ast lowering needs from the resolver is separated by owners. This should allow us to fully split ast lowering to have one query invocation per owner that steal the individual resolver results for each owner.

part of https://github.com/rust-lang/rust-project-goals/issues/620
2026-05-13 19:02:46 +00:00
Philipp Krones 30e15b541f Merge commit 'b147b68c9bbc5ad44aea4220e6f68fd281f19c64' into clippy-subtree-update 2026-05-13 19:52:47 +02:00
Jonathan Brouwer ea715cbaba Rollup merge of #156543 - bjorn3:rustbook_windows_sys_0_61, r=ehuss
Update rustbook dependencies to remove windows-targets dependency

Part of https://github.com/rust-lang/rust/issues/156459
2026-05-13 15:16:20 +02:00
bjorn3 56e973fa08 Update rustbook dependencies to remove windows-targets dependency 2026-05-13 13:20:33 +02:00
cyrgani 6e99c68516 use deref_patterns in rustdoc 2026-05-13 10:57:41 +00:00
Jonathan Brouwer 91b85f6119 Rollup merge of #156513 - RalfJung:miri, r=RalfJung
miri subtree update

Unblocks https://github.com/rust-lang/rust/pull/156493.

---

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/f2730828d60db345864d49d7ab253b796e9948e1.

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

r? @ghost
2026-05-13 11:46:39 +02:00
Jonathan Brouwer 9f1929d738 Rollup merge of #156504 - paradoxicalguy:windows-path-remap, r=bjorn3
bootstrap: remap windows-style OUT_DIR paths

### problem:
on windows, some paths embedded into debuginfo / metadata may internally use `\` separators, while the existing `RUSTC_DEBUGINFO_MAP` remapping only covers the `/` form of `self.build.out`.

### fix:
add an additional remap entry for the windows style `\` variant of `self.build.out`.

### result:
improves path remapping consistency on windows, in turn helping with reproducibility.

r? @bjorn3
2026-05-13 11:46:38 +02:00
Zalathar cda9a68248 Rename //@ ignore-pass to //@ no-pass-override
By convention, compiletest directives starting with `ignore-*` normally cause
the test itself to be skipped under certain conditions.

The `//@ ignore-pass` directive was the only exception to that convention. The
new name should hopefully do a better job of communicating its effect, which is
to cause the `--pass` flag to not override the test's `build-pass` or
`run-pass` directive.

The `//@ no-pass-override` directive is mainly useful for tests that expect
warnings produced during codegen.
2026-05-13 17:24:59 +10:00
Oli Scherer 66a2b8565f Make UnordItems::flat_map take UnordItems as args, too 2026-05-13 08:47:29 +02:00
Zalathar 38d2c11584 Enforce that directives are consistently used with or without a colon 2026-05-13 15:52:33 +10:00
Esteban Küber 701e4942ed Remove a bunch of stray backticks
Thanks VSCode!
2026-05-13 02:40:58 +00:00
León Orell Valerian Liehr e205784d77 Don't try to resolve type-dependent paths in anon consts 2026-05-13 03:56:00 +02:00
León Orell Valerian Liehr efaf441d7b Don't special-case ExprKind::Call
Don't unnecessarily try to obtain the type-dependent definition of callees
in `visit_expr`, just let `visit_qpath` handle callees.
This means that for callees that are

* `Resolved` paths (the majority of callees) we don't try to `typeck` the
  enclosing body which should improve perf if the body doesn't contain
  any type-dependent definitions.
* actually `TypeRelative` paths we don't resolve them twice (with
  slightly different spans)
2026-05-13 03:51:46 +02:00
León Orell Valerian Liehr bfcaf513b4 Don't create a path with zero segments 2026-05-13 03:51:45 +02:00
León Orell Valerian Liehr f5ad60c7da Inline non-self-descriptive fn infer_id 2026-05-13 03:51:45 +02:00
León Orell Valerian Liehr b0eb4ffb00 Don't check if the resolution of TypeRelative paths is Err because it always is
`rustc_resolve` doesn't resolve type-relative paths since that's the job
of HIR ty lowering and HIR typeck. `segment.res` comes from
`rustc_resolve` and is thus always `Res::Err`.
So just try to obtain the `TypeckResults` immediately since they contain
the actual resolution as deduced by HIR typeck.
2026-05-13 03:51:45 +02:00
León Orell Valerian Liehr 2493ef1503 rustdoc: SpanMapVisitor: Cache TypeckResults 2026-05-13 03:51:44 +02:00
Guillaume Gomez 376e0c0ba4 Improve search.js code readability and add missing test case 2026-05-13 00:37:03 +02:00
Ralf Jung d2803c5776 update lockfile and proc_macro_deps 2026-05-12 22:45:14 +02:00
Ralf Jung 39a25b31d1 Merge pull request #5034 from RalfJung/ci-rebalance
move some checks off of the macos runner
2026-05-12 20:10:59 +00:00
Ralf Jung 57f718e60a Merge pull request #5023 from WhySoBad/network-socket-epoll-edge-on-empty
Handle short reads and writes for TCP sockets
2026-05-12 20:00:58 +00:00
lcnr 3fb166fb6f tiny PR 2026-05-12 21:58:50 +02:00
Ralf Jung 7eff1908c6 move some checks off of the macos runner 2026-05-12 21:40:15 +02:00
WhySoBad 96ac80a016 Remove socket readiness after short reads/writes 2026-05-12 21:32:35 +02:00
Abhinav Srivastav bdd0dcd70e bootstrap: remap windows-style OUT_DIR paths 2026-05-13 00:23:51 +05:30
Ralf Jung e3f7882d73 fix configuring features for main './miri test' run 2026-05-12 20:17:30 +02:00
Ralf Jung 82a32a1e87 tests: use println to avoid reordering in GHA output 2026-05-12 20:17:30 +02:00
Ralf Jung e8499b7fa2 Merge pull request #5030 from elichai/_mm512_permutex2var_epi8
Add _mm512_permutex2var_epi8 shim support
2026-05-12 16:12:45 +00:00
Ralf Jung 0bc649104e stub out confstr for macOS temp_dir 2026-05-12 17:02:36 +02:00
Ralf Jung 1c6ac11d0a implement GetTempPathW on Windows 2026-05-12 16:51:00 +02:00
Elichai Turkel f6c0d329a1 Add _mm512_permutex2var_epi8 shim support 2026-05-12 12:53:44 +03:00
Ralf Jung a33a737846 add test for env::temp_dir 2026-05-12 09:49:46 +02:00
Ralf Jung ffddc8397e Merge pull request #5009 from WhySoBad/network-socket-fix-shutdown
Remove `TcpStream::peer_addr` check for network sockets, test epoll readiness for `shutdown`
2026-05-12 06:40:10 +00:00
Jonathan Brouwer 8cfae220da Rollup merge of #156393 - RalfJung:core-miri-tests, r=tgross35
enable more f16/f128 tests in Miri

See the individual commit messages for details.

The last commit is a drive-by comment fix that was not worth its own PR.
r? @tgross35
2026-05-12 07:03:55 +02:00
Jonathan Brouwer f244bd79d6 Rollup merge of #154754 - Kobzol:build-manifest-enzyme, r=Mark-Simulacrum,ZuseZ4
Add Enzyme to build-manifest and rustup

This PR adds the autodiff component (Enzyme) to build-manifest, and thus also to (nightly) Rustup.

It is marked as nightly-only and as -preview.

After this PR lands, unless I messed something up, starting with the following nightly, the following should work (on supported targets):

```bash
rustup +nightly component add enzyme
RUSTFLAGS="-Zautodiff=Enable" cargo +nightly build
```

CC @ZuseZ4

r? @Mark-Simulacrum

closes: https://github.com/rust-lang/rust/issues/145899
2026-05-12 07:03:54 +02:00