Files
rust/tests/ui/parser
Matthias Krüger 3de72f6802 Rollup merge of #147951 - Kivooeo:plus-equal-let-chains, r=davidtwco
Add check for `+=` typo in let chains

Fixes https://github.com/rust-lang/rust/issues/147664

it does affect only cases where variable exist in scope, because if the variable is not exist in scope, the suggestion will not make any sense

I wanted to add suggestion for case where variable does not in scope to fix `y += 1` to `let y = 1` but I guess it's too much (not too much work, but too much wild predict of what user wants)? if it's good addition in your opinion I can add this in follow up

in other things I guess impl is pretty much self-explanatory, if you see there is some possibilities to improve code or/and some _edge-cases_ that I could overlooked feel free to tell about it

ah, also about why I think this change is good and why I originally took it, so it seems to me that this is possible to make this typo (I explained this in comment a little), like, both `+` and `=` is the same button (in most of layouts) and for this reasons I didn't added something like `-=` it seems more harder to make this typo

r? diagnostics
2025-11-03 21:20:21 +01:00
..
2025-04-03 21:41:58 +00:00
2025-08-22 08:58:45 +02:00
2024-12-10 11:34:13 +08:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-08-28 20:05:04 +02:00
2025-08-28 20:05:04 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-05-05 21:44:48 +02:00
2023-05-05 21:44:48 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-07-25 20:38:54 +05:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-11-16 20:03:31 +00:00
2023-01-11 09:32:08 +00:00
2025-07-31 21:25:49 +05:00
2023-05-05 11:17:14 -04:00
2025-09-15 10:48:26 -07:00
2024-10-11 11:30:08 -04:00
2025-08-09 16:27:20 +05:00
2024-11-29 06:10:15 +11:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-10-01 22:45:16 +02:00
2023-10-04 01:35:07 +00:00
2023-10-04 01:35:07 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-07-01 15:29:29 +05:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-04-25 17:02:59 +05:00
2023-01-11 09:32:08 +00:00
2024-11-24 19:42:33 +01:00
2024-11-24 19:42:33 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-09-21 20:07:52 +03:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-19 02:25:55 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00