-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Improve mutable-binding suggestion to include name #149101
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
This comment has been minimized.
This comment has been minimized.
12deedf to
12a2d73
Compare
This comment has been minimized.
This comment has been minimized.
12a2d73 to
ad4efba
Compare
|
currently quite swamped, sorry @rustbot reroll |
|
hey, i'm the one who opened this issue, thanks for taking the time to work on this ! that was not in the title, and i did not go in big details on it, but i did try to fix it in the |
|
@Morgane55440 Thank you for checking:) |
ad4efba to
b036344
Compare
b036344 to
d49075f
Compare
|
I chose to keep the ref mut suggestion for this case. fn main() {
match 1 {
x => {
x += 1;
}
}
let y = Some(0);
if let Some(x) = y {
x = 2;
}
}Although applying ref mut results in a compilation error, the error can be resolved afterward thanks to the additional suggestions (use deref, use mut). |
|
Thanks! @bors r+ |
Rollup of 11 pull requests Successful merges: - #148662 (alloc: Document panics when allocations will exceed max) - #148811 (core docs: rewrite `panic::Location::caller` with visual line/column numbers) - #149101 (Improve mutable-binding suggestion to include name) - #149477 (float::maximum/minimum: make docs more streamlined) - #149547 (library: Rename `IterRange*` to `Range*Iter`) - #149548 (Generate delegation error body when delegation is not resolved) - #149630 (Check identifiers defined in macros when suggesting identifiers hidden by hygiene) - #149647 (Add regression test for 141845) - #149661 (Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.) - #149666 (Add perma-unstable `--print=backend-has-zstd` for use by compiletest) - #149671 (interpret: test SNaN handling of float min/max and update comments) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 11 pull requests Successful merges: - rust-lang/rust#148662 (alloc: Document panics when allocations will exceed max) - rust-lang/rust#148811 (core docs: rewrite `panic::Location::caller` with visual line/column numbers) - rust-lang/rust#149101 (Improve mutable-binding suggestion to include name) - rust-lang/rust#149477 (float::maximum/minimum: make docs more streamlined) - rust-lang/rust#149547 (library: Rename `IterRange*` to `Range*Iter`) - rust-lang/rust#149548 (Generate delegation error body when delegation is not resolved) - rust-lang/rust#149630 (Check identifiers defined in macros when suggesting identifiers hidden by hygiene) - rust-lang/rust#149647 (Add regression test for 141845) - rust-lang/rust#149661 (Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.) - rust-lang/rust#149666 (Add perma-unstable `--print=backend-has-zstd` for use by compiletest) - rust-lang/rust#149671 (interpret: test SNaN handling of float min/max and update comments) r? `@ghost` `@rustbot` modify labels: rollup
resolve: #148467