]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #41437 - cuviper:remove-unstable-deprecated, r=alexcrichton
authorbors <bors@rust-lang.org>
Sun, 23 Apr 2017 02:13:55 +0000 (02:13 +0000)
committerbors <bors@rust-lang.org>
Sun, 23 Apr 2017 02:13:55 +0000 (02:13 +0000)
Remove items that are unstable and deprecated

This removes unstable items that have been deprecated for more than one cycle.

- Since 1.16.0, `#![feature(enumset)]`
    - All of `mod collections::enum_set`
- Since 1.15.0, `#![feature(borrow_state)]`
    - `cell::BorrowState`
    - `RefCell::borrow_state()`
- Since 1.15.0, `#![feature(is_unique)]`
    - `Rc::is_unique()` (made private like `Arc::is_unique()`)
- Since 1.15.0, `#![feature(rc_would_unwrap)]`
    - `Rc::would_wrap()`
- Since 1.13.0, `#![feature(binary_heap_extras)]`
    - `BinaryHeap::push_pop()`
    - `BinaryHeap::replace()`
- Since 1.12.0, `#![feature(as_unsafe_cell)]`
    - `Cell::as_unsafe_cell()`
    - `RefCell::as_unsafe_cell()`
- Since 1.12.0, `#![feature(map_entry_recover_keys)]`
    - `btree_map::OccupiedEntry::remove_pair()`
    - `hash_map::OccupiedEntry::remove_pair()`
- Since 1.11.0, `#![feature(float_extras)]`
    - `Float::nan()`
    - `Float::infinity()`
    - `Float::neg_infinity()`
    - `Float::neg_zero()`
    - `Float::zero()`
    - `Float::one()`
    - `Float::integer_decode()`
    - `f32::integer_decode()`
    - `f32::ldexp()`
    - `f32::frexp()`
    - `f32::next_after()`
    - `f64::integer_decode()`
    - `f64::ldexp()`
    - `f64::frexp()`
    - `f64::next_after()`
- Since 1.11.0, `#![feature(zero_one)]`
    - `num::Zero`
    - `num::One`

1  2 
src/doc/unstable-book/src/SUMMARY.md
src/liballoc/rc.rs
src/libcollections/binary_heap.rs
src/libcollections/btree/map.rs
src/libstd/collections/hash/map.rs

index ee4e568a5ca9af263cd3fc50537d3cd18b652a1b,9fbd4e300f8f8602a9f7dd32b847b9cc323c052c..613475730417015b7e8d6ffba7a7c717b0230916
@@@ -72,7 -72,6 +72,7 @@@
      - [proc_macro](language-features/proc-macro.md)
      - [quote](language-features/quote.md)
      - [relaxed_adts](language-features/relaxed-adts.md)
 +    - [repr_align](language-features/repr-align.md)
      - [repr_simd](language-features/repr-simd.md)
      - [rustc_attrs](language-features/rustc-attrs.md)
      - [rustc_diagnostic_macros](language-features/rustc-diagnostic-macros.md)
      - [alloc_system](library-features/alloc-system.md)
      - [alloc](library-features/alloc.md)
      - [as_c_str](library-features/as-c-str.md)
-     - [as_unsafe_cell](library-features/as-unsafe-cell.md)
      - [ascii_ctype](library-features/ascii-ctype.md)
-     - [binary_heap_extras](library-features/binary-heap-extras.md)
      - [binary_heap_peek_mut_pop](library-features/binary-heap-peek-mut-pop.md)
-     - [borrow_state](library-features/borrow-state.md)
      - [box_heap](library-features/box-heap.md)
      - [c_void_variant](library-features/c-void-variant.md)
      - [char_escape_debug](library-features/char-escape-debug.md)
      - [derive_clone_copy](library-features/derive-clone-copy.md)
      - [derive_eq](library-features/derive-eq.md)
      - [discriminant_value](library-features/discriminant-value.md)
-     - [enumset](library-features/enumset.md)
      - [error_type_id](library-features/error-type-id.md)
      - [exact_size_is_empty](library-features/exact-size-is-empty.md)
      - [fd](library-features/fd.md)
      - [fd_read](library-features/fd-read.md)
      - [fixed_size_array](library-features/fixed-size-array.md)
      - [float_bits_conv](library-features/float-bits-conv.md)
-     - [float_extras](library-features/float-extras.md)
      - [flt2dec](library-features/flt2dec.md)
      - [fmt_flags_align](library-features/fmt-flags-align.md)
      - [fmt_internals](library-features/fmt-internals.md)
      - [io_error_internals](library-features/io-error-internals.md)
      - [io](library-features/io.md)
      - [ip](library-features/ip.md)
-     - [is_unique](library-features/is-unique.md)
      - [iter_rfind](library-features/iter-rfind.md)
      - [libstd_io_internals](library-features/libstd-io-internals.md)
      - [libstd_sys_internals](library-features/libstd-sys-internals.md)
      - [linked_list_extras](library-features/linked-list-extras.md)
      - [lookup_host](library-features/lookup-host.md)
      - [manually_drop](library-features/manually-drop.md)
-     - [map_entry_recover_keys](library-features/map-entry-recover-keys.md)
      - [mpsc_select](library-features/mpsc-select.md)
      - [n16](library-features/n16.md)
      - [never_type_impls](library-features/never-type-impls.md)
      - [rand](library-features/rand.md)
      - [range_contains](library-features/range-contains.md)
      - [raw](library-features/raw.md)
-     - [rc_would_unwrap](library-features/rc-would-unwrap.md)
      - [retain_hash_collection](library-features/retain-hash-collection.md)
      - [reverse_cmp_key](library-features/reverse-cmp-key.md)
      - [rt](library-features/rt.md)
      - [windows_handle](library-features/windows-handle.md)
      - [windows_net](library-features/windows-net.md)
      - [windows_stdio](library-features/windows-stdio.md)
-     - [zero_one](library-features/zero-one.md)
- >>>>>> Add top level sections to the Unstable Book.
diff --combined src/liballoc/rc.rs
index 69e5351cad53d0707beb3fd4a5d7b35b1e739e77,b12d89867c8efcac9ae1c1af0d73165eafc7b31b..38dc914583517f9410e1f685fbe0b50e47286ec6
@@@ -239,7 -239,7 +239,7 @@@ use core::ops::CoerceUnsized
  use core::ptr::{self, Shared};
  use core::convert::From;
  
 -use heap::deallocate;
 +use heap::{allocate, deallocate, box_free};
  use raw_vec::RawVec;
  
  struct RcBox<T: ?Sized> {
      value: T,
  }
  
 -
  /// A single-threaded reference-counting pointer.
  ///
  /// See the [module-level documentation](./index.html) for more details.
@@@ -340,19 -341,6 +340,6 @@@ impl<T> Rc<T> 
          }
      }
  
-     /// Checks whether [`Rc::try_unwrap`][try_unwrap] would return
-     /// [`Ok`].
-     ///
-     /// [try_unwrap]: struct.Rc.html#method.try_unwrap
-     /// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
-     #[unstable(feature = "rc_would_unwrap",
-                reason = "just added for niche usecase",
-                issue = "28356")]
-     #[rustc_deprecated(since = "1.15.0", reason = "too niche; use `strong_count` instead")]
-     pub fn would_unwrap(this: &Self) -> bool {
-         Rc::strong_count(&this) == 1
-     }
      /// Consumes the `Rc`, returning the wrapped pointer.
      ///
      /// To avoid a memory leak the pointer must be converted back to an `Rc` using
@@@ -437,38 -425,6 +424,38 @@@ impl Rc<str> 
      }
  }
  
 +impl<T> Rc<[T]> {
 +    /// Constructs a new `Rc<[T]>` from a `Box<[T]>`.
 +    #[doc(hidden)]
 +    #[unstable(feature = "rustc_private",
 +               reason = "for internal use in rustc",
 +               issue = "0")]
 +    pub fn __from_array(value: Box<[T]>) -> Rc<[T]> {
 +        unsafe {
 +            let ptr: *mut RcBox<[T]> =
 +                mem::transmute([mem::align_of::<RcBox<[T; 1]>>(), value.len()]);
 +            // FIXME(custom-DST): creating this invalid &[T] is dubiously defined,
 +            // we should have a better way of getting the size/align
 +            // of a DST from its unsized part.
 +            let ptr = allocate(size_of_val(&*ptr), align_of_val(&*ptr));
 +            let ptr: *mut RcBox<[T]> = mem::transmute([ptr as usize, value.len()]);
 +
 +            // Initialize the new RcBox.
 +            ptr::write(&mut (*ptr).strong, Cell::new(1));
 +            ptr::write(&mut (*ptr).weak, Cell::new(1));
 +            ptr::copy_nonoverlapping(
 +                value.as_ptr(),
 +                &mut (*ptr).value as *mut [T] as *mut T,
 +                value.len());
 +
 +            // Free the original allocation without freeing its (moved) contents.
 +            box_free(Box::into_raw(value));
 +
 +            Rc { ptr: Shared::new(ptr as *const _) }
 +        }
 +    }
 +}
 +
  impl<T: ?Sized> Rc<T> {
      /// Creates a new [`Weak`][weak] pointer to this value.
      ///
      ///
      /// [weak]: struct.Weak.html
      #[inline]
-     #[unstable(feature = "is_unique", reason = "uniqueness has unclear meaning",
-                issue = "28356")]
-     #[rustc_deprecated(since = "1.15.0",
-                        reason = "too niche; use `strong_count` and `weak_count` instead")]
-     pub fn is_unique(this: &Self) -> bool {
+     fn is_unique(this: &Self) -> bool {
          Rc::weak_count(this) == 0 && Rc::strong_count(this) == 1
      }
  
index b10a655c205b7802c59f6e6b81d3173accf59eff,e61d5b3169607122b149e3d554c2960b92497eed..7d972403f65db47dd923dc257487de5a5b08ab9a
@@@ -555,82 -555,6 +555,6 @@@ impl<T: Ord> BinaryHeap<T> 
          self.sift_up(0, old_len);
      }
  
-     /// Pushes an item onto the binary heap, then pops the greatest item off the queue in
-     /// an optimized fashion.
-     ///
-     /// # Examples
-     ///
-     /// Basic usage:
-     ///
-     /// ```
-     /// #![feature(binary_heap_extras)]
-     /// #![allow(deprecated)]
-     ///
-     /// use std::collections::BinaryHeap;
-     /// let mut heap = BinaryHeap::new();
-     /// heap.push(1);
-     /// heap.push(5);
-     ///
-     /// assert_eq!(heap.push_pop(3), 5);
-     /// assert_eq!(heap.push_pop(9), 9);
-     /// assert_eq!(heap.len(), 2);
-     /// assert_eq!(heap.peek(), Some(&3));
-     /// ```
-     #[unstable(feature = "binary_heap_extras",
-                reason = "needs to be audited",
-                issue = "28147")]
-     #[rustc_deprecated(since = "1.13.0", reason = "use `peek_mut` instead")]
-     pub fn push_pop(&mut self, mut item: T) -> T {
-         match self.data.get_mut(0) {
-             None => return item,
-             Some(top) => {
-                 if *top > item {
-                     swap(&mut item, top);
-                 } else {
-                     return item;
-                 }
-             }
-         }
-         self.sift_down(0);
-         item
-     }
-     /// Pops the greatest item off the binary heap, then pushes an item onto the queue in
-     /// an optimized fashion. The push is done regardless of whether the binary heap
-     /// was empty.
-     ///
-     /// # Examples
-     ///
-     /// Basic usage:
-     ///
-     /// ```
-     /// #![feature(binary_heap_extras)]
-     /// #![allow(deprecated)]
-     ///
-     /// use std::collections::BinaryHeap;
-     /// let mut heap = BinaryHeap::new();
-     ///
-     /// assert_eq!(heap.replace(1), None);
-     /// assert_eq!(heap.replace(3), Some(1));
-     /// assert_eq!(heap.len(), 1);
-     /// assert_eq!(heap.peek(), Some(&3));
-     /// ```
-     #[unstable(feature = "binary_heap_extras",
-                reason = "needs to be audited",
-                issue = "28147")]
-     #[rustc_deprecated(since = "1.13.0", reason = "use `peek_mut` instead")]
-     pub fn replace(&mut self, mut item: T) -> Option<T> {
-         if !self.is_empty() {
-             swap(&mut item, &mut self.data[0]);
-             self.sift_down(0);
-             Some(item)
-         } else {
-             self.push(item);
-             None
-         }
-     }
      /// Consumes the `BinaryHeap` and returns the underlying vector
      /// in arbitrary order.
      ///
@@@ -1042,7 -966,7 +966,7 @@@ impl<'a, T> FusedIterator for Iter<'a, 
  
  /// An owning iterator over the elements of a `BinaryHeap`.
  ///
 -/// This `struct` is created by the [`into_iter`] method on [`BinaryHeap`]
 +/// This `struct` is created by the [`into_iter`] method on [`BinaryHeap`][`BinaryHeap`]
  /// (provided by the `IntoIterator` trait). See its documentation for more.
  ///
  /// [`into_iter`]: struct.BinaryHeap.html#method.into_iter
index c5e4c76525243b7c3864f9a3b57ca881fb64bbeb,885b97dda8168e486f2655481c7a7051a516fb6e..d73c0254a74574221e1cd44d9ff12fe858cf588d
@@@ -298,7 -298,7 +298,7 @@@ pub struct IterMut<'a, K: 'a, V: 'a> 
  
  /// An owning iterator over the entries of a `BTreeMap`.
  ///
 -/// This `struct` is created by the [`into_iter`] method on [`BTreeMap`]
 +/// This `struct` is created by the [`into_iter`] method on [`BTreeMap`][`BTreeMap`]
  /// (provided by the `IntoIterator` trait). See its documentation for more.
  ///
  /// [`into_iter`]: struct.BTreeMap.html#method.into_iter
@@@ -2217,13 -2217,6 +2217,6 @@@ impl<'a, K: Ord, V> OccupiedEntry<'a, K
          self.handle.reborrow().into_kv().0
      }
  
-     /// Deprecated, renamed to `remove_entry`
-     #[unstable(feature = "map_entry_recover_keys", issue = "34285")]
-     #[rustc_deprecated(since = "1.12.0", reason = "renamed to `remove_entry`")]
-     pub fn remove_pair(self) -> (K, V) {
-         self.remove_entry()
-     }
      /// Take ownership of the key and value from the map.
      ///
      /// # Examples
index e7102115caf5cd3505c5bb22b3d6338c87b18c92,c8732e68c8539e09c1b068178c6593d8cc68d965..51d127f8ba79a246c33745356c94ab0888f4bf98
@@@ -1377,7 -1377,7 +1377,7 @@@ pub struct IterMut<'a, K: 'a, V: 'a> 
  
  /// An owning iterator over the entries of a `HashMap`.
  ///
 -/// This `struct` is created by the [`into_iter`] method on [`HashMap`]
 +/// This `struct` is created by the [`into_iter`] method on [`HashMap`][`HashMap`]
  /// (provided by the `IntoIterator` trait). See its documentation for more.
  ///
  /// [`into_iter`]: struct.HashMap.html#method.into_iter
@@@ -2017,13 -2017,6 +2017,6 @@@ impl<'a, K, V> OccupiedEntry<'a, K, V> 
          self.elem.read().0
      }
  
-     /// Deprecated, renamed to `remove_entry`
-     #[unstable(feature = "map_entry_recover_keys", issue = "34285")]
-     #[rustc_deprecated(since = "1.12.0", reason = "renamed to `remove_entry`")]
-     pub fn remove_pair(self) -> (K, V) {
-         self.remove_entry()
-     }
      /// Take the ownership of the key and value from the map.
      ///
      /// # Examples