-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Add check for += typo in let chains
#147951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
(info for assigned reviewer or whoever wants pick this up for review, if you found that this is in good state as it, and there is nothing crucial that needed to be added or improved, and you want to rollup this, please, before doing so run bors try on aarch64-msvc-1, i have some kind of paranoia after this #147421 (comment), thanks) |
This comment has been minimized.
This comment has been minimized.
96dba30 to
e4d765b
Compare
|
A suggestion to improve readability: Add a layer of abstraction to this 535-line |
|
@aklaiber I'm quite unsure, but in my opinion this is a little outside the scope of the current PR |
e4d765b to
806b443
Compare
|
I will squash this commit before merge, just to make review easier for now |
|
I don't mind the extra commit so we can save another cycle of back and forth @bors r+ rollup |
…avidtwco Add check for `+=` typo in let chains Fixes rust-lang#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
Rollup of 7 pull requests Successful merges: - #147141 (Suggest making binding `mut` on `&mut` reborrow) - #147945 (Port `cfg!()` macro to the new attribute parsing system ) - #147951 (Add check for `+=` typo in let chains) - #148004 (fix: Only special case single line item attribute suggestions) - #148264 (reflect that type and const parameter can be intermixed) - #148363 (Fix `wasm_import_module` attribute cross-crate) - #148447 (Tweak E0401) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147951 - Kivooeo:plus-equal-let-chains, r=davidtwco Add check for `+=` typo in let chains Fixes #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
Fixes #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 += 1tolet y = 1but 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 upin 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 typor? diagnostics