Skip to content

Ergonomic Clone Support #20539

@shadowcatzero

Description

@shadowcatzero

The following code errors with rust analyzer, but builds and runs with cargo:

#![feature(ergonomic_clones)]
// ...
let mut y = use || {
    // ...
};

specifically:

1. Syntax Error: expected expression [syntax-error] (on the 'u' in 'use')
2. Syntax Error: expected SEMICOLON [syntax-error] (on the space after 'use')

with nightly (2025-08-24) rust analyzer using rustup and rustaceanvim.

The other x.use syntax also fails as well, but the UseCloned trait works as expected.

It's an incomplete feature, so sorry if this is too early. I have no clue if those are supported or if it makes more sense to wait (couldn't find clear info on this). I thought I'd make this issue anyways in case someone else comes across this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-unstableunstable featureC-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions