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

syntax: improve parameter without type suggestions #64959

Merged
merged 1 commit into from
Oct 3, 2019

Commits on Oct 2, 2019

  1. syntax: improve parameter without type suggestions

    This commit improves the suggestions provided when function parameters
    do not have types:
    
    - A new suggestion is added for arbitrary self types, which suggests
    adding `self: ` before the type.
    
    - Existing suggestions are now provided when a `<` is found where a `:`
    was expected (previously only `,` and `)` or trait items), this gives
    suggestions in the case where the unnamed parameter type is generic
    in a free function.
    
    - The suggestion that a type name be provided (e.g. `fn foo(HashMap<u32>)`
    -> `fn foo(HashMap: TypeName<u32>)`) will no longer occur when a `<` was
    found instead of `:`.
    
    - The ident will not be used for recovery when a `<` was found instead
    of `:`.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Oct 2, 2019
    Configuration menu
    Copy the full SHA
    2537a8a View commit details
    Browse the repository at this point in the history