-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
or-patterns: disallow in let
bindings
#82048
Conversation
Actually, I'm going to rebase this to not be based on the other PR... no need... |
6434b34
to
2a5a28b
Compare
This comment has been minimized.
This comment has been minimized.
I think this is indeed better blocked on #81869 because the logic here should be shared with |
|
Hmm.. so this made sense initially, but as I'm thinking about it, it seems that they are different... Specifically, in the case of |
I mean, in both cases we parse |
Hmm... I see. I'll take a closer look when I implement the changes in #79278 (comment) |
This comment has been minimized.
This comment has been minimized.
1ed0c4a
to
a1c27c9
Compare
@petrochenkov I've pushed a commit which does a few things:
Please let me know what you think. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm skeptical about the decision to not stabilize What I would worry about more is nested let b @ P1 | P2: T = E; I'm not sure whether code like this is impossible with the currently implemented parsing priorities, this needs an investigation. |
This comment has been minimized.
This comment has been minimized.
📌 Commit e64138c has been approved by |
…petrochenkov or-patterns: disallow in `let` bindings ~~Blocked on rust-lang#81869 Disallows top-level or-patterns before type ascription. We want to reserve this syntactic space for possible future generalized type ascription. r? `@petrochenkov`
Failed in rollup: #82840 (comment) |
I think clippy should compile now. |
This comment has been minimized.
This comment has been minimized.
3dc2939
to
402a00a
Compare
@mark-i-m would you mind filing a ticket to change the unnecessary parens lint ahead of stabilization? I was recently touching this area and should be straightforward to make it not trigger for We should probably have lints, in rustc or clippy for |
@estebank I had thought I already fixed the lint in this PR, though I'm not sure why it was firing for clippy... |
@mark-i-m ah! Interesting. |
@bors r+ |
📌 Commit 402a00a has been approved by |
…petrochenkov or-patterns: disallow in `let` bindings ~~Blocked on rust-lang#81869 Disallows top-level or-patterns before type ascription. We want to reserve this syntactic space for possible future generalized type ascription. r? `@petrochenkov`
Rollup of 8 pull requests Successful merges: - rust-lang#81127 (Improve sift_down performance in BinaryHeap) - rust-lang#81879 (Added #[repr(transparent)] to core::cmp::Reverse) - rust-lang#82048 (or-patterns: disallow in `let` bindings) - rust-lang#82731 (Bump libc dependency of std to 0.2.88.) - rust-lang#82799 (Add regression test for rust-lang#75525) - rust-lang#82841 (Change x64 size checks to not apply to x32.) - rust-lang#82883 (Update Cargo) - rust-lang#82887 (Update CONTRIBUTING.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…petrochenkov or-patterns: disallow in `let` bindings ~~Blocked on rust-lang#81869 Disallows top-level or-patterns before type ascription. We want to reserve this syntactic space for possible future generalized type ascription. r? ``@petrochenkov``
Blocked on #81869Disallows top-level or-patterns before type ascription. We want to reserve this syntactic space for possible future generalized type ascription.
r? @petrochenkov