Skip to content

We could be smarter about implementing Copy/Clone #56

@emilio

Description

@emilio

Testcase:

template<typename T>
struct Foo {
    char bar[50];
};

vs.

struct Foo {
    char bar[50];
};

We're conservative here, but we could be smarter if we know the struct has no template parameters, since all the arrays (even the big ones) implement magically Copy, so we can do:

impl Clone for MyStruct { fn clone(&self) -> Self { *self } }

But this wouldn't work for templated structs, where we derive it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions