Skip to content

Complete closure expression by expected type #8676

@flodiebold

Description

@flodiebold

In a place where something implementing Fn/FnMut/FnOnce is expected, we should complete |x0, x1| $0 and move |x0, x1| $0, with the correct number of parameters of course.

This isn't completely trivial because it's not about the expected type, but about a trait bound on it. We should probably carry them over from type checking somehow; a simpler approach for now might be to only make it work if we're in a function parameter.

We might also want to make | a completion trigger character then.

CC #8629

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-completionautocompletionA-tytype system / type inference / traits / method resolutionE-hardS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions