rust/src
bors d9a2cc4dae Auto merge of #128506 - compiler-errors:by-move-body, r=cjgillot
Stop storing a special inner body for the coroutine by-move body for async closures

...and instead, just synthesize an item which is treated mostly normally by the MIR pipeline.

This PR does a few things:
* We synthesize a new `DefId` for the by-move body of a closure, which has its `mir_built` fed with the output of the `ByMoveBody` MIR transformation, and some other relevant queries.
* This has the `DefKind::ByMoveBody`, which we use to distinguish it from "real" bodies (that come from HIR) which need to be borrowck'd. Introduce `TyCtxt::is_synthetic_mir` to skip over `mir_borrowck` which is called by `mir_promoted`; borrowck isn't really possible to make work ATM since it heavily relies being called on a body generated from HIR, and is redundant by the construction of the by-move-body.
* Remove the special `PassManager` hacks for handling the inner `by_move_body` stored within the coroutine's mir body. Instead, this body is fed like a regular MIR body, so it's goes through all of the `tcx.*_mir` stages normally (build -> promoted -> ...etc... -> optimized) .
* Remove the `InstanceKind::ByMoveBody` shim, since now we have a "regular" def id, we can just use `InstanceKind::Item`. This also allows us to remove the corresponding hacks from codegen, such as in `fn_sig_for_fn_abi` .

Notable remarks:
* ~~I know it's kind of weird to be using `DefKind::Closure` here, since it's not a distinct closure but just a new MIR body. I don't believe it really matters, but I could also use a different `DefKind`... maybe one that we could use for synthetic MIR bodies in general?~~ edit: We're doing this now.
2024-08-27 23:30:24 +00:00
..
bootstrap Rollup merge of #128935 - lqd:needs-zstd, r=Kobzol 2024-08-27 01:46:50 -05:00
ci Rollup merge of #128935 - lqd:needs-zstd, r=Kobzol 2024-08-27 01:46:50 -05:00
doc Rollup merge of #129490 - randomPoison:trusty-os-support, r=Urgau 2024-08-27 01:46:52 -05:00
etc Generate completions after version updates 2024-08-18 22:52:54 -05:00
librustdoc Auto merge of #128506 - compiler-errors:by-move-body, r=cjgillot 2024-08-27 23:30:24 +00:00
llvm-project@2b259b3c20 Update to LLVM 19 rc 3 2024-08-20 11:50:47 +02:00
rustdoc-json-types rustdoc-json: Use FxHashMap from rustdoc_json_types 2024-08-15 13:12:11 +00:00
tools Rollup merge of #129634 - compiler-errors:tidy-2024, r=albertlarsan68 2024-08-27 18:59:28 +02:00
README.md
stage0 Bump src/stage0 with determinism 2024-07-30 15:16:35 -07:00
version Bump to 1.82 2024-07-20 10:30:39 -04:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.