Files
rust/tests/ui/suggestions
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
..
2025-11-27 14:13:58 -05:00
2025-04-03 21:41:58 +00:00
2024-02-07 10:42:01 +08:00
2024-02-04 11:34:10 +08:00
2023-05-19 20:58:06 +02:00
2026-02-17 16:51:44 +00:00
2025-07-13 13:50:01 +00:00
2026-03-28 16:18:11 +09:00
2026-03-28 16:18:11 +09:00
2023-05-19 20:58:06 +02:00
2023-08-15 10:58:33 +00:00
2023-05-01 16:15:13 +08:00
2024-02-07 10:42:01 +08:00
2025-11-27 11:19:00 -05:00
2024-03-13 23:05:17 +00:00
2025-06-26 03:43:01 +00:00
2023-11-20 23:44:37 +00:00
2023-05-01 16:15:13 +08:00
2025-06-03 10:52:32 -07:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00