-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Allow by-move binding for patterns with guards that don't reference the bindings #14252
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
/cc @rust-lang/lang |
Triage: still annoying. edit: a more trivial (but quite related) enhancement is to not emit E0008 for pattern guards that don't move anything, let alone the captures. Example. |
(Forward-)dupe of #15287, closing. |
3 tasks
lnicola
pushed a commit
to lnicola/rust
that referenced
this issue
Mar 13, 2023
internal: Handle fields called as method calls as the fields they resolve to Confusing PR title tbf but this makes it so `bar` in `foo.bar()` resolves to the field if it exists and no method with the same name exists. Improves UX slightly when incorrectly calling a field.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Mar 20, 2025
Remove Known problems section for `vec_box` since [issue](rust-lang/rust-clippy#3530 (comment)) > Vec<Box<T: Sized>> makes sense if T is a large type can be handled > The lint already checks that the type's size is lower than a threshold to avoid linting on large types. changelog: none
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have
This gives
In this situation it should be fine to defer the move until the guard has succeeded.
It's a bit frivolous because I could instead do
But I like having all the branching in one construct, especially when I'm implementing a spec which is written that way. And I don't want to add
mode
to the match scrutinee because none of the other cases care about it.See also #4649.
The text was updated successfully, but these errors were encountered: