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

Permit attributes on 'if' expressions #69201

Merged
merged 11 commits into from
Mar 9, 2020

Commits on Mar 4, 2020

  1. Permit attributes on 'if' expressions

    Previously, attributes on 'if' expressions (e.g. #[attr] if true {})
    were disallowed during parsing. This made it impossible for macros to
    perform any custom handling of such attributes (e.g. stripping them
    away), since a compilation error would be emitted before they ever had a
    chance to run.
    
    This PR permits attributes on 'if' expressions ('if-attrs' from here on).
    Both built-in attributes (e.g. `#[allow]`, `#[cfg]`) are supported.
    
    We still do *not* accept attributes on 'other parts' of an if-else
    chain. That is, the following code snippet still fails to parse:
    
    ```rust
    if true {} #[attr] else if false {} else #[attr] if false {} #[attr]
    else {}
    ```
    Aaron1011 committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    f63b88c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e912d9d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e9ec47b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9a299e4 View commit details
    Browse the repository at this point in the history
  5. Remove recovery test

    Aaron1011 committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    b00f674 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e11cdfd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7f19358 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1b681d6 View commit details
    Browse the repository at this point in the history
  9. Extent pretty-print test

    Aaron1011 committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    37c2c38 View commit details
    Browse the repository at this point in the history
  10. Fix tabs

    Aaron1011 committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    66b152c View commit details
    Browse the repository at this point in the history
  11. Update stderr

    Aaron1011 committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    e50fd5a View commit details
    Browse the repository at this point in the history