rust/tests
Matthias Krüger 53bf554de8
Rollup merge of #129072 - compiler-errors:more-powerful-async-closure-inference, r=lcnr
Infer async closure args from `Fn` bound even if there is no corresponding `Future` bound on return

In #127482, I implemented the functionality to infer an async closure signature when passed into a function that has `Fn` + `Future` where clauses that look like:

```
fn whatever(callback: F)
where
  F: Fn(Arg) -> Fut,
  Fut: Future<Output = Out>,
```

However, #127781 demonstrates that this is still incomplete to address the cases users care about. So let's not bail when we fail to find a `Future` bound, and try our best to just use the args from the `Fn` bound if we find it. This is *fine* since most users of closures only really care about the *argument* types for inference guidance, since we require the receiver of a `.` method call to be known in order to probe methods.

When I experimented with programmatically rewriting `|| async {}` to `async || {}` in #127827, this also seems to have fixed ~5000 regressions (probably all coming from usages `TryFuture`/`TryStream` from futures-rs): the [before](https://github.com/rust-lang/rust/pull/127827#issuecomment-2254061733) and [after](https://github.com/rust-lang/rust/pull/127827#issuecomment-2255470176) crater runs.

Fixes #127781.
2024-08-15 19:32:36 +02:00
..
assembly Rollup merge of #127905 - BKPepe:powerpc-muslspe, r=wesleywiser 2024-08-15 00:02:24 +02:00
auxiliary
codegen Rollup merge of #128348 - dingxiangfei2009:allow-shadow-call-stack-sanitizer, r=tmandry 2024-08-15 19:32:35 +02:00
codegen-units Fix and enable disabled codegen-units tests 2024-08-10 14:03:27 -04:00
coverage Finish blessing coverage/mcdc tests after LLVM 19 upgrade 2024-08-01 13:36:50 +10:00
coverage-run-rustdoc
crashes Auto merge of #128714 - camelid:wf-struct-exprs, r=BoxyUwU 2024-08-10 05:27:17 +00:00
debuginfo Use the enum2$ Natvis visualiser for repr128 C-style enums 2024-08-13 19:53:21 +01:00
incremental Do not normalize constants eagerly. 2024-07-31 00:59:12 +00:00
mir-opt Use the right type when coercing fn items to pointers 2024-08-13 16:23:20 -04:00
pretty
run-make Auto merge of #128936 - bjorn3:fix_thin_archive_reading, r=jieyouxu 2024-08-15 14:13:52 +00:00
run-pass-valgrind
rustdoc Rollup merge of #128394 - GuillaumeGomez:run-button, r=t-rustdoc 2024-08-12 17:09:15 +02:00
rustdoc-gui Rollup merge of #128394 - GuillaumeGomez:run-button, r=t-rustdoc 2024-08-12 17:09:15 +02:00
rustdoc-js Add test for Self not being a generic in search index 2024-08-04 12:49:28 -07:00
rustdoc-js-std
rustdoc-json Rollup merge of #128836 - its-the-shrimp:add_test_for_107278, r=aDotInTheVoid 2024-08-09 00:03:38 +02:00
rustdoc-ui Auto merge of #129060 - matthiaskrgr:rollup-s72gpif, r=matthiaskrgr 2024-08-14 06:43:26 +00:00
ui Rollup merge of #129072 - compiler-errors:more-powerful-async-closure-inference, r=lcnr 2024-08-15 19:32:36 +02:00
ui-fulldeps Bless test fallout 2024-08-03 07:57:31 -04:00
COMPILER_TESTS.md