Skip to content

Confusing error message wording for moving out of non-copy slices. #36407

Closed
@solson

Description

@solson

https://is.gd/iH1SwT

let x = vec![String::from("foo")].into_boxed_slice();
let y = x[0];

// error: cannot move out of type `[std::string::String]`, a non-copy fixed-size array [--explain E0508]

It refers to the slice as a fixed-sized array. This can also be reproduced with a Vec<String> by indexing (*x)[0] instead of indexing x[0].

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions