]> git.lizzy.rs Git - rust.git/commit
refactor NonZero, Shared, and Unique APIs
authorAlexis Beingessner <a.beingessner@gmail.com>
Tue, 4 Apr 2017 16:31:03 +0000 (12:31 -0400)
committerAlexis Beingessner <a.beingessner@gmail.com>
Thu, 4 May 2017 18:56:02 +0000 (14:56 -0400)
commit6e2efe3aa477bdc8d7ccdb904523ad18d612bbb6
tree3a4b401ff3856ccfd94fb6cf22f04be44bdcfa08
parented1f26ddda15b2bcf613a257e813e8b02ee14dff
refactor NonZero, Shared, and Unique APIs

Major difference is that I removed Deref impls, as apparently LLVM has
trouble maintaining metadata with a `&ptr -> &ptr` API. This was cited
as a blocker for ever stabilizing this API. It wasn't that ergonomic
anyway.

* Added `get` to NonZero to replace Deref impl
* Added `as_ptr` to Shared/Unique to replace Deref impl
* Added Unique's `as_ref` and `as_mut` conveniences to Shared
* Added `::empty()` convenience constructor for Unique/Shared
* Deprecated `as_mut_ptr` on Shared in favour of `as_ptr`
* Improved documentation of types

Note that Shared now only refers to *mut, and not *const
src/libcore/nonzero.rs
src/libcore/ptr.rs