-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Match ergonomics 2024: implement mutable by-reference bindings #123080
Conversation
Some changes occurred in match checking cc @Nadrieril Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in match lowering cc @Nadrieril |
From a process perspective, we don't have an accepted RFC for this so I think we need a lang team liaison. Either that or write a precise proposal that can be approved (the original proposal was positively received but didn't get proposer "we agree to do this" kind of approval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, thanks for doing this work!
This PR is doing a bunch of different things at once; for future PRs I would have found it much easier to review a series of commits each doing a single change, e.g. the first commit would have changed how ByRef
/BindingAnnotation
work, a second one would have removed BindingMode
etc and the last one would have added the new mut ref mut
/mut ref
possibility.
No need to change that now though, I've read through it. I like what you did with BindingAnnotation
; this looks good. r=me once the feature gate is marked "incomplete" and we get a liaison.
| - | ||
| | | ||
| first assignment to `a` | ||
| help: consider making this binding mutable: `mut a` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to extend this help message to suggest mut ref
as well when the feature is active. I'lll let you decide whether to include in this PR or do it separately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it separately, I'd rather the BindingAnnotation
/ByRef
changes land first so later PRs can make use of them
☔ The latest upstream changes (presumably #123121) made this pull request unmergeable. Please resolve the merge conflicts. |
fc0bc1d
to
51de637
Compare
This comment has been minimized.
This comment has been minimized.
51de637
to
025bc0e
Compare
This comment has been minimized.
This comment has been minimized.
025bc0e
to
2ab563f
Compare
2ab563f
to
f219129
Compare
f219129
to
e931595
Compare
This should be ready to go, now that we have a liaison (#123076 (comment)). @rustbot label -S-waiting-on-team S-waiting-on-review |
Let's goooo @bors r+ |
…eril Match ergonomics 2024: implement mutable by-reference bindings Implements the mutable by-reference bindings portion of match ergonomics 2024 (rust-lang#123076), with the `mut ref`/`mut ref mut` syntax, under feature gate `mut_ref`. r? `@Nadrieril` `@rustbot` label A-patterns A-edition-2024
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (45796d1): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.769s -> 668.043s (-0.11%) |
Implements the mutable by-reference bindings portion of match ergonomics 2024 (#123076), with the
mut ref
/mut ref mut
syntax, under feature gatemut_ref
.r? @Nadrieril
@rustbot label A-patterns A-edition-2024