Skip to content
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

Fix return precedence in match guard #1528

Closed
dtolnay opened this issue Nov 5, 2023 · 0 comments · Fixed by #1530
Closed

Fix return precedence in match guard #1528

dtolnay opened this issue Nov 5, 2023 · 0 comments · Fixed by #1530
Labels

Comments

@dtolnay
Copy link
Owner

dtolnay commented Nov 5, 2023

With feature(if_let_guard), the following is valid Rust syntax.

fn ret_guard() {
    match 2 {
      x if let true = return => { x; }
      _ => {}
    }
}

Syn currently fails to parse it:

error: expected an expression
 --> dev/main.rs:3:30
  |
3 |       x if let true = return => { x; }
  |                              ^

Tracking issue: rust-lang/rust#51114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant