rust/tests
bors c86f3ac24f Auto merge of #120717 - compiler-errors:cap-closure-kind, r=oli-obk
For async closures, cap closure kind, get rid of `by_mut_body`

Right now we have three `AsyncFn*` traits, and three corresponding futures that are returned by the `call_*` functions for them. This is fine, but it is a bit excessive, since the future returned by `AsyncFn` and `AsyncFnMut` are identical. Really, the only distinction we need to make with these bodies is "by ref" and "by move".

This PR removes `AsyncFn::CallFuture` and renames `AsyncFnMut::CallMutFuture` to `AsyncFnMut::CallRefFuture`. This simplifies MIR building for async closures, since we don't need to build an extra "by mut" body, but just a "by move" body which is materially different.

We need to do a bit of delicate handling of the ClosureKind for async closures, since we need to "cap" it to `AsyncFnMut` in some cases when we only care about what body we're looking for.

This also fixes a bug where `<{async closure} as Fn>::call` was returning a body that takes the async-closure receiver *by move*.

This also helps align the `AsyncFn` traits to the `LendingFn` traits' eventual designs.
2024-03-20 11:40:45 +00:00
..
assembly
auxiliary
codegen
codegen-units
coverage
coverage-run-rustdoc
debuginfo
incremental
mir-opt Fix ABI for FnMut/Fn impls for async closures 2024-03-19 16:59:24 -04:00
pretty
run-make
run-make-fulldeps
run-pass-valgrind
rustdoc
rustdoc-gui
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui Auto merge of #122029 - estebank:drive-by-ui-test, r=oli-obk 2024-03-19 22:11:59 +00:00
ui Auto merge of #120717 - compiler-errors:cap-closure-kind, r=oli-obk 2024-03-20 11:40:45 +00:00
ui-fulldeps
COMPILER_TESTS.md