Skip to content

Do not generate implementation for clone for FAM#1664

Merged
emilio merged 1 commit into
rust-lang:masterfrom
honggoff:dont-clone-flexible-array-member
Nov 3, 2019
Merged

Do not generate implementation for clone for FAM#1664
emilio merged 1 commit into
rust-lang:masterfrom
honggoff:dont-clone-flexible-array-member

Conversation

@honggoff
Copy link
Copy Markdown
Contributor

@honggoff honggoff commented Nov 3, 2019

Flexible array members are represented in the generated binding by a
struct __IncompleteArrayField<T>. Since such members do not contain any
information about how big they are, it is impossible to automatically
clone or copy them, either in C or rust.

It looks like the implementation for Copy has already been removed with #1477. This change removes the remaining implementation for Clone.

Fixes #1431.

Flexible array members are represented in the generated binding by a
struct __IncompleteArrayField<T>. Since such members do not contain any
information about how big they are, it is impossible to automatically
clone or copy them, either in C or rust.

Fixes rust-lang#1431.
Copy link
Copy Markdown
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@emilio emilio merged commit ec85170 into rust-lang:master Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__IncompleteArrayField shouldn't implement Clone / Copy.

3 participants