Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Clone impls for Buffer and Blob #113

Merged
merged 1 commit into from May 19, 2018
Merged

Conversation

@mbrubeck
Copy link
Contributor

mbrubeck commented May 17, 2018

Reverts #111.

I realized that allowing these types to be cloned makes it impossible to provide safe borrowed access to their contents, because one handle could mutate or clear the contents while they are borrowed through another handle.

Rust code that needs multiple pointers to a single buffer or blob should use Rc/Arc or &T instead.


This change is Reviewable

Allowing these types to be cloned makes it impossible to provide safe
borrowed access to their contents, because one handle could mutate or
clear the contents while they are borrowed through another handle.

Safe Rust code that needs to have multiple pointers to a single buffer
or blob should use Rc/Arc or &T pointers instead.
@waywardmonkeys
Copy link
Collaborator

waywardmonkeys commented May 19, 2018

@bors-servo
Copy link
Contributor

bors-servo commented May 19, 2018

📌 Commit f371fa6 has been approved by waywardmonkeys

@bors-servo
Copy link
Contributor

bors-servo commented May 19, 2018

Testing commit f371fa6 with merge 37ebe16...

bors-servo added a commit that referenced this pull request May 19, 2018
Remove Clone impls for Buffer and Blob

Reverts #111.

I realized that allowing these types to be cloned makes it impossible to provide safe borrowed access to their contents, because one handle could mutate or clear the contents while they are borrowed through another handle.

Rust code that needs multiple pointers to a single buffer or blob should use Rc/Arc or `&T` instead.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-harfbuzz/113)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 19, 2018

☀️ Test successful - status-travis
Approved by: waywardmonkeys
Pushing 37ebe16 to master...

@bors-servo bors-servo merged commit f371fa6 into servo:master May 19, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.