Skip to content

new array![] requires Copy on elements #179

Closed
@njaard

Description

@njaard
{
        let owned = String::new();
//|         ----- move occurs because `owned` has type `std::string::String`, which does not implement the `Copy` trait
        array![    owned];
//|     -----------^^^^^--
//|     |          |
//|     |          variable moved due to use in closure
//|     |          value used here after move
//|     value moved into closure here
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions