Matthias Krüger
536fc22917
Rollup merge of #119978 - compiler-errors:async-closure-captures, r=oli-obk
...
Move async closure parameters into the resultant closure's future eagerly
Move async closure parameters into the closure's resultant future eagerly.
Before, we used to desugar `async |p1, p2, ..| { body }` as `|p1, p2, ..| { || async { body } }`. Now, we desugar the above like `|p1, p2, ..| { async move { let p1 = p1; let p2 = p2; ... body } }`. This mirrors the same desugaring that `async fn` does with its parameter types, and the compiler literally uses the same code via a shared helper function.
This removes the necessity for E0708, since now expressions like `async |x: i32| { x }` will not give you confusing borrow errors.
This does *not* fix the case where async closures have self-borrows. This will come with a general implementation of async closures, which is still in the works.
r? oli-obk
2024-01-18 10:34:18 +01:00
..
2024-01-07 17:29:25 +03:00
2024-01-02 15:34:37 -05:00
2023-12-21 16:45:29 +05:30
2024-01-05 19:13:52 +03:00
2024-01-13 12:46:58 -05:00
2024-01-05 09:30:27 +00:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-11 09:03:26 +00:00
2024-01-16 17:12:10 +00:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-05 10:00:59 +00:00
2024-01-12 17:49:37 -08:00
2024-01-16 09:25:28 +01:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-13 20:06:03 +00:00
2023-12-20 22:53:56 -05:00
2024-01-13 22:05:46 +00:00
2024-01-13 17:19:46 +01:00
2024-01-17 00:43:44 +00:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-02 15:34:37 -05:00
2024-01-08 15:03:59 +00:00
2023-12-14 15:22:37 +01:00
2024-01-05 09:30:27 +00:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-16 10:52:28 +00:00
2024-01-13 12:46:58 -05:00
2024-01-12 14:11:16 +03:00
2024-01-12 13:59:47 -08:00
2024-01-11 09:03:26 +00:00
2024-01-02 15:34:37 -05:00
2024-01-09 19:25:54 +00:00
2024-01-13 12:46:58 -05:00
2023-12-21 16:45:29 +05:30
2024-01-09 21:08:16 +00:00
2024-01-07 17:29:25 +03:00
2024-01-02 15:34:37 -05:00
2023-12-16 19:56:50 -08:00
2024-01-09 21:08:16 +00:00
2024-01-13 12:46:58 -05:00
2024-01-05 19:13:52 +03:00
2023-12-23 00:09:37 +08:00
2024-01-02 15:34:37 -05:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-12 11:02:57 +01:00
2024-01-13 12:46:58 -05:00
2024-01-10 21:18:54 +01:00
2024-01-16 13:27:58 -08:00
2024-01-08 19:41:01 +01:00
2024-01-09 21:08:16 +00:00
2023-12-14 15:22:37 +01:00
2023-12-13 23:07:10 +00:00
2024-01-13 20:55:54 +00:00
2024-01-13 12:46:58 -05:00
2024-01-09 21:08:16 +00:00
2024-01-13 12:46:58 -05:00
2024-01-16 09:25:28 +01:00
2024-01-11 21:39:44 +08:00
2024-01-07 17:29:25 +03:00
2024-01-17 14:23:41 +00:00
2024-01-16 09:25:28 +01:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-05 10:00:59 +00:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2023-12-13 23:07:10 +00:00
2024-01-13 12:46:58 -05:00
2024-01-11 09:03:26 +00:00
2023-12-28 02:03:43 +01:00
2024-01-16 09:25:28 +01:00
2024-01-13 12:46:58 -05:00
2024-01-15 19:07:12 +01:00
2024-01-05 09:30:27 +00:00
2024-01-13 12:46:58 -05:00
2024-01-05 19:13:52 +03:00
2024-01-13 09:59:56 +11:00
2024-01-05 04:51:55 +00:00
2023-12-27 17:26:12 +00:00
2024-01-13 22:00:34 +00:00
2024-01-13 12:46:58 -05:00
2024-01-09 13:23:15 +01:00
2024-01-10 21:18:54 +01:00
2024-01-05 18:49:25 +01:00
2024-01-09 21:08:16 +00:00
2024-01-09 21:08:16 +00:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-10 21:18:54 +01:00
2024-01-13 12:46:58 -05:00
2024-01-11 16:55:10 +11:00
2024-01-14 04:37:45 +00:00
2024-01-15 21:24:13 +00:00
2024-01-13 12:46:58 -05:00
2024-01-04 02:02:57 +08:00
2024-01-16 13:27:58 -08:00
2024-01-05 09:30:27 +00:00
2024-01-02 15:34:37 -05:00
2024-01-13 12:46:58 -05:00
2023-12-18 23:55:47 +00:00
2024-01-02 15:34:37 -05:00
2023-12-16 01:28:05 +00:00
2024-01-13 12:46:58 -05:00
2024-01-05 21:56:32 +01:00
2024-01-18 10:34:17 +01:00
2024-01-05 09:30:27 +00:00
2024-01-13 12:46:58 -05:00
2024-01-03 10:00:15 -08:00
2024-01-13 12:46:58 -05:00
2024-01-08 15:25:55 -05:00
2024-01-05 09:30:27 +00:00
2023-12-26 17:57:33 +01:00
2024-01-13 12:46:58 -05:00
2024-01-15 08:44:49 +01:00
2024-01-13 12:46:58 -05:00
2023-12-14 18:10:38 +03:00
2024-01-07 17:29:25 +03:00
2024-01-07 17:29:25 +03:00
2024-01-05 10:56:59 +00:00
2024-01-02 15:34:37 -05:00
2024-01-02 15:34:37 -05:00
2024-01-16 17:12:10 +00:00
2023-12-19 13:35:37 -05:00
2024-01-13 12:46:58 -05:00
2023-12-30 18:17:28 +01:00
2024-01-13 12:46:58 -05:00
2024-01-05 10:00:59 +00:00
2024-01-13 12:46:58 -05:00
2024-01-13 12:46:58 -05:00
2024-01-16 13:33:04 +00:00
2024-01-13 12:46:58 -05:00
2024-01-13 09:59:56 +11:00
2023-12-26 23:48:55 +00:00
2024-01-05 10:00:59 +00:00
2024-01-17 20:21:20 +01:00
2024-01-13 12:46:58 -05:00
2024-01-02 14:17:56 +00:00
2024-01-13 12:46:58 -05:00
2024-01-05 10:00:59 +00:00
2024-01-13 12:46:58 -05:00
2023-12-26 04:07:38 +00:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-02 15:34:37 -05:00
2024-01-07 20:48:31 +01:00
2024-01-16 09:25:28 +01:00
2023-12-19 13:35:37 -05:00
2023-12-21 10:17:11 +08:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-02 15:34:37 -05:00
2023-12-15 16:12:27 +00:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-02 15:34:37 -05:00
2024-01-02 15:34:37 -05:00
2024-01-02 15:34:37 -05:00
2023-12-16 19:56:50 -08:00
2024-01-02 15:34:37 -05:00
2024-01-13 12:46:58 -05:00
2024-01-02 15:34:37 -05:00
2024-01-09 21:08:16 +00:00
2024-01-09 21:08:16 +00:00
2024-01-02 15:34:37 -05:00