]> git.lizzy.rs Git - rust.git/commit
std: Second pass stabilization for `ptr`
authorAlex Crichton <alex@alexcrichton.com>
Fri, 19 Dec 2014 16:57:12 +0000 (08:57 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 29 Dec 2014 23:57:28 +0000 (15:57 -0800)
commit54452cdd68a18b7caa8def20bbd587b769f4cb67
treeb9f02c5e33a125d26866516c9fe1c54d9c6072f0
parent71123902e17ad339649f33423995eac78da40e3c
std: Second pass stabilization for `ptr`

This commit performs a second pass for stabilization over the `std::ptr` module.
The specific actions taken were:

* The `RawPtr` trait was renamed to `PtrExt`
* The `RawMutPtr` trait was renamed to `MutPtrExt`
* The module name `ptr` is now stable.
* These functions were all marked `#[stable]` with no modification:
  * `null`
  * `null_mut`
  * `swap`
  * `replace`
  * `read`
  * `write`
  * `PtrExt::is_null`
  * `PtrExt::offset`
* These functions remain unstable:
  * `as_ref`, `as_mut` - the return value of an `Option` is not fully expressive
                         as null isn't the only bad value, and it's unclear
                         whether we want to commit to these functions at this
                         time. The reference/lifetime semantics as written are
                         also problematic in how they encourage arbitrary
                         lifetimes.
  * `zero_memory` - This function is currently not used at all in the
                    distribution, and in general it plays a broader role in the
                    "working with unsafe pointers" story. This story is not yet
                    fully developed, so at this time the function remains
                    unstable for now.
  * `read_and_zero` - This function remains unstable for largely the same
                      reasons as `zero_memory`.
* These functions are now all deprecated:
  * `PtrExt::null` - call `ptr::null` or `ptr::null_mut` instead.
  * `PtrExt::to_uint` - use an `as` expression instead.
  * `PtrExt::is_not_null` - use `!p.is_null()` instead.
20 files changed:
src/liballoc/arc.rs
src/liballoc/heap.rs
src/liballoc/rc.rs
src/libcollections/dlist.rs
src/libcollections/slice.rs
src/libcollections/str.rs
src/libcore/prelude.rs
src/libcore/ptr.rs
src/libcore/slice.rs
src/libcore/str/mod.rs
src/librustc_trans/trans/builder.rs
src/librustc_trans/trans/value.rs
src/libstd/c_vec.rs
src/libstd/collections/hash/table.rs
src/libstd/io/extensions.rs
src/libstd/io/mod.rs
src/libstd/os.rs
src/libstd/prelude.rs
src/libstd/sys/common/net.rs
src/libstd/sys/unix/backtrace.rs