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

Detect possibly non-Rust closure syntax during parse #47763

Closed
wants to merge 1 commit into from

Commits on Jan 26, 2018

  1. Detect possibly non-Rust closure syntax during parse

    Other languages have a similar, but not quite the same to Rust, syntax
    for closures:
    
    ```
    {|<args>| <stmts> }
    ```
    
    Even worse, the above code *is* valid Rust if and only if there's only
    one statement, as the block would resolve to the single statement
    closure within it. This means that seemingly correct code will fail when
    adding a new statement, making modifying something that looks unrelated
    cause "value not found in this scope" and "trait bound not satisfied"
    errors. Because of this, make the parser detect the specific case where
    the code is incorrect *and* failing, and emit a warning explaining the
    correct syntax.
    estebank committed Jan 26, 2018
    Configuration menu
    Copy the full SHA
    e093191 View commit details
    Browse the repository at this point in the history