Skip to content

Destructure assist in function arguments doesn't respect nested structures #17525

Open
@2ndDerivative

Description

@2ndDerivative

I found this while working with nested function argument destructuring.

struct Outer<T>(T);
struct Inner {
    field: u32
}

fn stuff(Outer([...])) {
   ...
}

When typing "Inner" inside the Outer() brackets in fn stuff and accepting the assist for destructuring it will write this incorrect code:

fn stuff(Outer(Inner { field }: Inner))

instead of the correct

fn stuff(Outer(Inner { field }): Outer<Inner>)

I am not familiar with rust-analyzer's internals so I don't know how hard to fix it is but that's it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions