Skip to content

Chapter 3 - Section Marker Traits - MyStruct needs #[derive(Copy, Clone)] #5

@glafrance

Description

@glafrance

In Chapter 3, section Marker Traits, the provided example code has a struct MyStruct, and in main() clone() is called on an instance of MyStruct.

But for this code to compile, it is necessary to derive the Copy and Clone traits:

#[derive(Copy, Clone)]
struct MyStruct;

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