Skip to content

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

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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