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

clean up the Rc type and move it to libstd #9794

Merged
merged 2 commits into from
Oct 11, 2013
Merged

clean up the Rc type and move it to libstd #9794

merged 2 commits into from
Oct 11, 2013

Conversation

thestinger
Copy link
Contributor

I've left out a way to construct from a Send type until #9509 is resolved. I am confident that this interface can remain backwards compatible though, assuming we name the Pointer trait method borrow.

When there is a way to convert from Send (from_send), a future RAII-based Mut type can be used with this to implemented a mutable reference-counted pointer. For now, I've left around the RcMut type but it may drastically change or be removed.

@bill-myers
Copy link
Contributor

Note that this line is wrong, both in the existing Rust codebase and in this commit:
let _: ~T = transmute(self.ptr);

it should be:
let _: ~RcBox = transmute(self.ptr);

since it is and is created as an ~RcBox and not a ~T

@thestinger
Copy link
Contributor Author

@bill-myers: nice catch! fixed

@thestinger
Copy link
Contributor Author

@bill-myers: interestingly enough, because value is the first field in the struct, the mistake never actually caused any issues - but it should be fixed regardless, because that's way too fragile.

bors added a commit that referenced this pull request Oct 11, 2013
I've left out a way to construct from a `Send` type until #9509 is resolved. I am confident that this interface can remain backwards compatible though, assuming we name the `Pointer` trait method `borrow`.

When there is a way to convert from `Send` (`from_send`), a future RAII-based `Mut` type can be used with this to implemented a mutable reference-counted pointer. For now, I've left around the `RcMut` type but it may drastically change or be removed.
@bors bors closed this Oct 11, 2013
@bors bors merged commit 18be986 into rust-lang:master Oct 11, 2013
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.

3 participants