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

Tweak conditions for E0026 and E0769 #75352

Merged
merged 1 commit into from
Aug 11, 2020

Commits on Aug 10, 2020

  1. Tweak conditions for E0026 and E0769

    When we have a tuple struct used with struct we don't want to suggest using
    the (valid) struct syntax with numeric field names. Instead we want to
    suggest the expected syntax.
    
    Given
    
    ```rust
    fn main() {
        match MyOption::MySome(42) {
            MyOption::MySome { x: 42 } => (),
            _ => (),
        }
    }
    ```
    
    We now emit E0769 "tuple variant `MyOption::MySome` written as struct variant"
    instead of E0026 "variant `MyOption::MySome` does not have a field named `x`".
    estebank committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    9149ec7 View commit details
    Browse the repository at this point in the history