Skip to content

"error[E0507]: cannot move out of borrowed content" could suggest adding the Copy trait #49693

Closed
@learnopengles

Description

@learnopengles

For this error:

error[E0507]: cannot move out of borrowed content
--> file.rs:302:35
|
302 | let c = b.map(|entry| entry.symbol_kind);
| ^^^^^ cannot move out of borrowed content

error: aborting due to previous error

The compiler could suggest adding #[derive(Copy, Clone)] to the relevant enum. The error message on its own does not offer enough insight on how to fix the problem, from a non-proficient user's POV.

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.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