Jonathan Brouwer
fe32c706ed
Rollup merge of #156121 - thiago-fealves:suggest-collect-string, r=estebank
...
compiler: suggest `.collect()` when `String` is expected and `Iterator` is found
This commit adds a diagnostic suggestion to help users who forget to call `.collect()` when they have an iterator and the function or variable expects a `String`.
The logic checks if the expected type is `std::string::String` and if the found type implements the `Iterator` trait, if so the compiler provides a suggestion to add `.collect()`
Includes also a UI test to verify if the suggestion appears correctly
2026-05-17 15:52:35 +02:00
..
2026-05-09 17:50:35 +12:00
2026-03-09 18:31:29 -04:00
2026-03-10 09:35:03 -04:00
2026-03-16 17:58:49 +00:00
2026-03-14 22:40:28 +00:00
2026-02-28 21:13:48 +08:00
2026-02-28 21:13:48 +08:00
2026-02-28 21:13:48 +08:00
2026-04-25 11:47:34 -04:00
2026-04-25 11:47:34 -04:00
2026-04-15 00:59:25 -07:00
2026-04-15 00:59:25 -07:00
2026-04-15 00:59:25 -07:00
2026-04-15 00:59:25 -07:00
2026-01-26 17:34:31 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-03-31 21:32:31 +02:00
2026-03-31 21:32:31 +02:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-03-28 16:18:11 +09:00
2026-03-28 16:18:11 +09:00
2026-02-01 18:31:21 +00:00
2026-02-01 18:31:21 +00:00
2026-02-01 18:20:30 +00:00
2026-02-01 18:20:30 +00:00
2026-02-01 18:20:30 +00:00
2026-01-21 19:00:03 +03:00
2026-04-18 10:51:16 -07:00
2026-04-18 10:51:16 -07:00
2026-03-21 02:24:36 +00:00
2026-03-28 16:18:11 +09:00
2026-03-28 16:18:11 +09:00
2026-03-15 01:50:36 +00:00
2026-04-20 16:46:57 +06:00
2026-04-20 16:46:57 +06:00
2026-01-13 01:16:58 +00:00
2026-03-29 16:23:14 +08:00
2026-03-29 16:23:14 +08:00
2026-03-29 16:23:14 +08:00
2026-03-28 16:18:11 +09:00
2026-03-02 00:23:24 +01:00
2026-03-02 00:23:24 +01:00
2026-03-21 02:24:36 +00:00
2026-02-07 17:09:23 -05:00
2026-01-13 01:16:58 +00:00
2026-01-13 01:16:58 +00:00
2026-01-26 17:34:31 +00:00
2026-04-15 00:59:25 -07:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-03-28 16:18:11 +09:00
2026-03-28 16:18:11 +09:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-03-20 19:33:05 +00:00
2026-03-20 19:33:05 +00:00
2026-02-01 18:20:30 +00:00
2026-02-01 18:20:30 +00:00
2026-02-01 18:20:30 +00:00
2026-02-01 18:20:30 +00:00
2026-02-01 18:20:30 +00:00
2026-02-01 18:20:30 +00:00
2026-04-06 12:36:45 +08:00
2025-12-29 17:41:49 -08:00
2026-04-06 12:36:45 +08:00
2026-03-10 09:35:03 -04:00
2026-02-01 18:20:31 +00:00
2026-03-10 09:35:03 -04:00
2026-04-24 23:00:28 +09:00
2026-04-24 23:00:28 +09:00
2026-03-21 02:24:36 +00:00
2026-05-02 17:59:25 +02:00
2026-03-21 02:24:36 +00:00
2026-01-08 16:07:18 -05:00
2026-02-28 20:32:20 -08:00
2026-02-28 20:32:20 -08:00
2026-02-28 20:32:20 -08:00
2026-01-26 04:09:28 +05:30
2026-01-26 04:09:28 +05:30
2026-05-04 10:55:24 -03:00
2026-05-04 10:55:24 -03:00
2026-04-19 12:32:26 +08:00
2026-04-19 12:32:26 +08:00
2026-04-19 12:32:26 +08:00
2026-03-15 03:51:25 +00:00
2026-03-15 03:51:25 +00:00
2026-03-24 22:31:37 +09:00
2026-01-21 19:00:03 +03:00
2026-01-21 19:00:03 +03:00
2026-04-15 01:38:14 +00:00
2026-04-15 01:38:14 +00:00
2026-04-15 01:38:14 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2025-12-29 15:24:25 +08:00
2026-03-28 16:18:11 +09:00
2026-02-18 18:33:35 +00:00
2026-02-28 05:29:28 +00:00
2026-02-28 05:29:28 +00:00
2026-02-28 05:29:28 +00:00
2026-04-25 08:46:06 +09:00
2026-04-25 08:46:06 +09:00
2026-04-25 08:46:06 +09:00
2026-05-09 17:50:35 +12:00
2026-05-09 17:50:35 +12:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-04-19 12:32:26 +08:00