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

Suggest syntax when finding method on array #44970

Closed
wants to merge 1 commit into from

Commits on Oct 2, 2017

  1. Suggest syntax when finding method on array

    On a file like the following:
    
    ```rust
    fn main() {
        let a = [1, 2, 3];
        let _ = [i32; 3]::clone(&a);
    }
    ```
    
    it is a fair assumption that what was meant was to use an associated
    type on an array, so we suggest the correct syntax:
    
    ```
    error: expected one of `.`, `;`, `?`, or an operator, found `::`
     --> file.rs:3:21
      |
    3 |     let _ = [i32; 3]::clone(&a);
      |             --------^^
      |             |       |
      |             |       expected one of `.`, `;`, `?`, or an operator here
      |             help: did you mean to use an associated type?: `<[i32; 3]>::`
    ```
    estebank committed Oct 2, 2017
    Configuration menu
    Copy the full SHA
    ae6d470 View commit details
    Browse the repository at this point in the history