Commit 193a95d
authored
Rollup merge of rust-lang#134017 - compiler-errors:call-once-deduction, r=jieyouxu
Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction
We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that.
This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable.
Fixes rust-lang#134015File tree
2 files changed
+18
-8
lines changed- compiler/rustc_hir_typeck/src
- tests/ui/async-await/async-closures
2 files changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
458 | | - | |
459 | | - | |
| 457 | + | |
460 | 458 | | |
461 | 459 | | |
462 | 460 | | |
463 | 461 | | |
464 | | - | |
465 | | - | |
466 | | - | |
| 462 | + | |
467 | 463 | | |
468 | 464 | | |
469 | 465 | | |
470 | | - | |
| 466 | + | |
471 | 467 | | |
472 | 468 | | |
473 | 469 | | |
474 | 470 | | |
475 | 471 | | |
476 | 472 | | |
477 | 473 | | |
478 | | - | |
| 474 | + | |
479 | 475 | | |
480 | 476 | | |
481 | 477 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments