bors
e8403a892b
Auto merge of #11200 - y21:issue9695, r=Jarcho
...
[`unused_async`]: don't lint if paths reference async fn without immediate call
Fixes #9695
Fixes #9359
Clippy shouldn't lint unused `async` if there are paths referencing them if that path isn't the receiver of a function call, because that means that the function might be passed to some other function:
```rs
async fn f() {} // No await statements, so unused at this point
fn requires_fn_future<F: Future<Output = ()>>(_: fn() -> F) {}
requires_fn_future(f); // `f`'s asyncness is actually not unused.
```
(This isn't limited to just passing the function as a parameter to another function, it could also first be stored in a variable and later passed to another function as an argument)
This requires delaying the linting until post-crate and collecting path references to local async functions along the way.
changelog: [`unused_async`]: don't lint if paths reference async fn that require asyncness
2023-07-22 20:40:48 +00:00
..
2022-10-06 09:44:38 +02:00
2023-07-20 03:11:35 -05:00
2023-07-14 13:36:16 +02:00
2023-07-22 06:28:05 -05:00
2023-07-22 06:28:05 -05:00
2023-07-20 10:55:30 +00:00
2023-07-02 14:59:02 +02:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2023-07-21 17:26:58 -05:00
2023-07-21 17:26:58 -05:00
2023-07-13 12:44:57 +00:00
2023-03-10 10:53:50 +01:00
2022-12-01 18:29:38 +01:00
2023-07-13 12:44:57 +00:00
2023-07-02 14:59:02 +02:00
2022-10-06 09:44:38 +02:00
2023-07-14 13:36:16 +02:00
2022-10-06 09:44:38 +02:00
2022-09-09 13:36:26 +02:00
2023-07-13 12:44:57 +00:00
2022-11-21 20:51:52 +01:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-07-13 12:44:57 +00:00
2023-07-02 14:59:02 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2022-12-01 18:29:38 +01:00
2023-03-21 15:38:51 +00:00
2022-12-01 18:29:38 +01:00
2023-06-02 11:41:57 +02:00
2022-10-23 15:18:45 +02:00
2023-07-13 12:44:57 +00:00
2023-02-16 17:05:56 -07:00
2023-07-13 12:44:57 +00:00
2022-08-11 19:42:16 +02:00
2023-07-14 13:36:16 +02:00
2023-07-22 06:28:05 -05:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-04-21 22:27:20 +00:00
2023-03-24 14:26:19 +01:00
2022-06-30 10:50:09 +02:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2022-12-17 14:12:54 +01:00
2023-07-14 13:36:16 +02:00
2023-07-13 12:44:57 +00:00
2023-04-11 15:31:08 +02:00
2022-12-01 18:51:05 +03:00
2023-07-14 13:36:16 +02:00
2022-11-17 13:45:59 +11:00
2023-07-13 12:44:57 +00:00
2023-03-08 08:51:50 +00:00
2022-06-04 13:34:07 +02:00
2023-07-13 12:44:57 +00:00
2023-02-16 17:05:56 -07:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-07-02 14:59:02 +02:00
2023-07-02 14:59:02 +02:00
2022-11-21 20:51:52 +01:00
2023-07-19 02:08:33 -05:00
2023-07-13 12:44:57 +00:00
2023-07-02 14:59:02 +02:00
2023-02-10 14:01:19 +01:00
2023-07-13 12:44:57 +00:00
2023-01-28 09:51:50 +00:00
2023-03-10 10:53:50 +01:00
2023-07-01 07:08:01 -04:00
2023-07-13 12:44:57 +00:00
2023-01-14 00:29:56 -07:00
2023-07-02 14:59:02 +02:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2023-07-02 14:59:02 +02:00
2023-07-14 13:36:16 +02:00
2023-07-02 14:59:02 +02:00
2023-07-12 19:54:55 -05:00
2023-07-14 13:36:16 +02:00
2023-07-13 12:44:57 +00:00
2022-11-18 06:16:20 +00:00
2023-06-22 18:34:23 +00:00
2023-07-13 12:44:57 +00:00
2021-12-06 12:33:31 +01:00
2023-07-14 13:36:16 +02:00
2022-11-21 20:51:52 +01:00
2023-07-13 12:44:57 +00:00
2023-05-20 15:39:26 +02:00
2023-05-05 17:45:49 +02:00
2023-02-25 19:28:50 -05:00
2023-07-20 16:17:24 -05:00
2023-07-13 12:44:57 +00:00
2023-05-20 15:39:26 +02:00
2023-03-14 17:18:26 +00:00
2023-07-13 12:44:57 +00:00
2023-07-21 06:45:30 -05:00
2023-07-01 07:08:01 -04:00
2022-10-06 09:44:38 +02:00
2023-07-13 12:44:57 +00:00
2022-11-21 20:51:52 +01:00
2022-11-21 20:51:52 +01:00
2023-04-11 15:31:08 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-02-15 08:56:18 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-06-02 11:41:57 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-02 14:59:02 +02:00
2021-10-07 11:21:30 +02:00
2023-07-22 20:40:48 +00:00
2023-07-21 17:26:58 -05:00
2023-07-13 12:44:57 +00:00
2023-07-03 22:25:36 +02:00
2023-07-13 12:44:57 +00:00
2022-05-21 13:24:00 +02:00
2023-05-05 17:45:49 +02:00
2023-03-24 14:26:19 +01:00
2023-04-23 13:28:56 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-03-24 14:26:19 +01:00
2023-03-02 23:46:44 +04:00
2023-07-13 12:44:57 +00:00
2023-06-30 18:01:28 +02:00
2023-05-05 17:45:49 +02:00
2023-04-23 13:28:56 +02:00
2022-11-18 06:16:20 +00:00
2023-07-13 12:44:57 +00:00
2023-07-01 07:08:01 -04:00
2023-07-13 12:44:57 +00:00
2023-04-11 15:31:08 +02:00
2023-07-13 12:44:57 +00:00
2023-07-02 14:59:02 +02:00
2023-05-20 15:39:26 +02:00
2023-07-02 14:59:02 +02:00
2023-07-14 13:36:16 +02:00
2023-05-29 09:23:43 +10:00
2023-03-10 10:53:50 +01:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-06-01 06:14:06 +00:00
2023-05-05 17:45:49 +02:00
2023-07-02 14:59:02 +02:00
2023-07-14 13:36:16 +02:00
2022-08-31 09:24:45 -04:00
2023-07-13 12:44:57 +00:00
2023-03-24 14:26:19 +01:00
2022-12-28 18:52:36 +01:00
2023-02-16 17:05:56 -07:00
2023-07-14 13:36:16 +02:00
2023-04-23 13:28:56 +02:00
2022-12-28 18:52:36 +01:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2022-11-21 20:51:52 +01:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-03-02 23:46:44 +04:00
2022-06-16 17:39:06 +02:00
2022-11-21 20:39:29 +00:00
2023-05-05 17:45:49 +02:00
2023-02-16 17:05:56 -07:00
2023-07-13 12:44:57 +00:00
2023-03-24 14:26:19 +01:00
2023-07-14 13:36:16 +02:00
2023-07-03 22:25:36 +02:00
2023-03-10 10:53:50 +01:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-04-23 13:28:56 +02:00
2023-01-27 21:09:08 +01:00
2022-11-17 13:45:59 +11:00
2023-07-13 12:44:57 +00:00
2021-12-06 12:33:31 +01:00
2023-07-12 22:19:01 +03:00
2023-07-14 13:36:16 +02:00
2022-10-23 15:18:45 +02:00
2023-03-21 15:38:51 +00:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-01-28 09:51:50 +00:00
2023-03-10 10:53:50 +01:00
2022-11-17 13:45:59 +11:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2022-05-05 15:12:52 +01:00
2023-04-23 13:28:56 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-02 14:59:02 +02:00
2023-07-13 12:44:57 +00:00
2022-01-23 19:31:32 +08:00
2022-12-01 18:29:38 +01:00
2023-07-21 18:14:03 -07:00
2022-12-17 14:12:54 +01:00
2023-07-14 13:36:16 +02:00
2023-07-21 17:26:58 -05:00
2023-07-02 14:59:02 +02:00
2023-03-28 01:14:28 +00:00
2023-05-20 15:39:26 +02:00
2023-07-01 07:08:01 -04:00
2023-07-05 18:29:43 +00:00
2023-07-10 18:12:41 +02:00
2023-02-10 14:01:19 +01:00
2023-07-17 14:03:00 +00:00
2023-02-25 17:43:19 -05:00
2023-02-16 17:05:56 -07:00
2023-07-14 13:36:16 +02:00
2023-07-16 19:37:42 +02:00
2022-04-30 13:51:49 +02:00
2023-07-14 13:36:16 +02:00
2023-07-20 09:04:08 -03:00
2023-07-13 12:44:57 +00:00
2022-06-16 17:39:06 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-05-05 17:45:49 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-01 07:08:01 -04:00
2023-07-13 12:44:57 +00:00
2023-04-27 17:18:12 +00:00
2022-10-29 16:04:10 -05:00
2023-07-13 12:44:57 +00:00
2022-10-06 09:44:38 +02:00
2023-07-13 12:44:57 +00:00
2022-05-21 13:24:00 +02:00
2021-12-06 12:33:31 +01:00
2023-07-13 12:44:57 +00:00
2023-07-01 07:08:01 -04:00
2023-05-05 17:45:49 +02:00
2023-07-02 14:59:02 +02:00
2023-07-18 05:15:50 +00:00
2023-07-14 13:36:16 +02:00
2023-05-05 17:45:49 +02:00
2022-10-06 09:44:38 +02:00
2023-06-26 23:12:03 +00:00
2023-04-26 15:27:32 +00:00
2023-07-14 13:36:16 +02:00
2023-07-13 12:44:57 +00:00
2022-12-01 18:51:20 +03:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2022-12-01 18:51:20 +03:00
2023-07-22 14:33:36 +02:00
2023-07-14 13:36:16 +02:00
2022-11-21 20:51:52 +01:00
2022-12-01 18:29:38 +01:00
2023-01-12 19:48:13 +01:00
2023-07-13 12:44:57 +00:00
2023-01-28 09:51:50 +00:00
2023-07-13 12:44:57 +00:00
2023-07-02 14:59:02 +02:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2023-07-14 13:36:16 +02:00
2023-07-03 19:48:27 +02:00
2023-07-13 12:44:57 +00:00
2023-07-13 12:44:57 +00:00
2023-07-14 13:36:16 +02:00
2022-10-06 09:44:38 +02:00
2023-02-22 17:04:58 +00:00