]> git.lizzy.rs Git - rust.git/commit
std: Stabilize unit, bool, ty, tuple, arc, any
authorAlex Crichton <alex@alexcrichton.com>
Thu, 24 Jul 2014 02:10:12 +0000 (19:10 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sat, 26 Jul 2014 20:12:20 +0000 (13:12 -0700)
commite5da6a71a6a0b46dd3630fc8326e6d5906a1fde6
tree9ec196a49577039b0800125f2cef1f8afa925ece
parent7aa407958b8ab2aec16b0182f0103ad92380b5dc
std: Stabilize unit, bool, ty, tuple, arc, any

This commit applies stability attributes to the contents of these modules,
summarized here:

* The `unit` and `bool` modules have become #[unstable] as they are purely meant
  for documentation purposes and are candidates for removal.

* The `ty` module has been deprecated, and the inner `Unsafe` type has been
  renamed to `UnsafeCell` and moved to the `cell` module. The `marker1` field
  has been removed as the compiler now always infers `UnsafeCell` to be
  invariant. The `new` method i stable, but the `value` field, `get` and
  `unwrap` methods are all unstable.

* The `tuple` module has its name as stable, the naming of the `TupleN` traits
  as stable while the methods are all #[unstable]. The other impls in the module
  have appropriate stability for the corresponding trait.

* The `arc` module has received the exact same treatment as the `rc` module
  previously did.

* The `any` module has its name as stable. The `Any` trait is also stable, with
  a new private supertrait which now contains the `get_type_id` method. This is
  to make the method a private implementation detail rather than a public-facing
  detail.

  The two extension traits in the module are marked #[unstable] as they will not
  be necessary with DST. The `is` method is #[stable], the as_{mut,ref} methods
  have been renamed to downcast_{mut,ref} and are #[unstable].

  The extension trait `BoxAny` has been clarified as to why it is unstable as it
  will not be necessary with DST.

This is a breaking change because the `marker1` field was removed from the
`UnsafeCell` type. To deal with this change, you can simply delete the field and
only specify the value of the `data` field in static initializers.

[breaking-change]
31 files changed:
src/liballoc/arc.rs
src/liballoc/boxed.rs
src/liballoc/rc.rs
src/libcore/any.rs
src/libcore/atomics.rs
src/libcore/bool.rs
src/libcore/cell.rs
src/libcore/fmt/mod.rs
src/libcore/kinds.rs
src/libcore/lib.rs
src/libcore/should_not_exist.rs [deleted file]
src/libcore/tuple/mod.rs
src/libcore/tuple/unit.rs
src/libcore/ty.rs
src/libnative/io/helper_thread.rs
src/librustc/middle/typeck/variance.rs
src/librustrt/exclusive.rs
src/librustrt/mutex.rs
src/librustuv/access.rs
src/librustuv/rc.rs
src/libsync/comm/mod.rs
src/libsync/comm/sync.rs
src/libsync/lock.rs
src/libsync/mpmc_bounded_queue.rs
src/libsync/mpsc_intrusive.rs
src/libsync/mpsc_queue.rs
src/libsync/mutex.rs
src/libsync/raw.rs
src/libsync/spsc_queue.rs
src/test/compile-fail/borrowck-forbid-static-unsafe-interior.rs
src/test/compile-fail/typeck-unsafe-always-share.rs