Skip to content

Allocation was incorrectly marked as Clone#98

Merged
Jasper-Bekkers merged 1 commit intomainfrom
no-clone
Jan 26, 2022
Merged

Allocation was incorrectly marked as Clone#98
Jasper-Bekkers merged 1 commit intomainfrom
no-clone

Conversation

@Jasper-Bekkers
Copy link
Copy Markdown
Member

@Jasper-Bekkers Jasper-Bekkers commented Jan 26, 2022

Fixes #97

I'm pretty sure that the implementation of Clone for Allocation is unsafe, because you can clone it and call mapped_slice_mut on both, getting two &muts that alias.

This is entirely correct, so we're removing the Clone derives for Allocation.

@Jasper-Bekkers Jasper-Bekkers merged commit 3e7bab4 into main Jan 26, 2022
@MarijnS95 MarijnS95 deleted the no-clone branch January 26, 2022 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should Allocation really implement Clone?

2 participants