This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:
Stabilized APIs:
* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`
Deprecated APIs
* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`
Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
132 lines
3.5 KiB
Rust
132 lines
3.5 KiB
Rust
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
|
// file at the top-level directory of this distribution and at
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
// option. This file may not be copied, modified, or distributed
|
|
// except according to those terms.
|
|
|
|
//! Collection types.
|
|
//!
|
|
//! See [std::collections](../std/collections) for a detailed discussion of
|
|
//! collections in Rust.
|
|
|
|
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
|
|
#![cfg_attr(stage0, feature(custom_attribute))]
|
|
#![crate_name = "collections"]
|
|
#![staged_api]
|
|
#![crate_type = "rlib"]
|
|
#![unstable(feature = "collections",
|
|
reason = "library is unlikely to be stabilized with the current \
|
|
layout and name, use std::collections instead",
|
|
issue = "27783")]
|
|
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
|
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
|
|
html_root_url = "https://doc.rust-lang.org/nightly/",
|
|
html_playground_url = "https://play.rust-lang.org/",
|
|
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
|
|
test(no_crate_inject))]
|
|
|
|
#![allow(trivial_casts)]
|
|
#![cfg_attr(test, allow(deprecated))] // rand
|
|
|
|
// SNAP 1af31d4
|
|
#![allow(unused_features)]
|
|
// SNAP 1af31d4
|
|
#![allow(unused_attributes)]
|
|
|
|
#![feature(alloc)]
|
|
#![feature(box_patterns)]
|
|
#![feature(box_syntax)]
|
|
#![feature(core_intrinsics)]
|
|
#![feature(core_slice_ext)]
|
|
#![feature(core_str_ext)]
|
|
#![feature(fmt_internals)]
|
|
#![feature(fmt_radix)]
|
|
#![feature(heap_api)]
|
|
#![feature(iter_arith)]
|
|
#![feature(iter_arith)]
|
|
#![feature(lang_items)]
|
|
#![feature(num_bits_bytes)]
|
|
#![feature(oom)]
|
|
#![feature(pattern)]
|
|
#![feature(ptr_as_ref)]
|
|
#![feature(ref_slice)]
|
|
#![feature(slice_bytes)]
|
|
#![feature(slice_patterns)]
|
|
#![feature(staged_api)]
|
|
#![feature(step_by)]
|
|
#![feature(str_char)]
|
|
#![feature(unboxed_closures)]
|
|
#![feature(unicode)]
|
|
#![feature(unique)]
|
|
#![feature(dropck_parametricity)]
|
|
#![feature(unsafe_no_drop_flag, filling_drop)]
|
|
#![feature(decode_utf16)]
|
|
#![cfg_attr(test, feature(clone_from_slice, rand, test))]
|
|
|
|
#![feature(no_std)]
|
|
#![no_std]
|
|
|
|
extern crate rustc_unicode;
|
|
extern crate alloc;
|
|
|
|
#[cfg(test)] #[macro_use] extern crate std;
|
|
#[cfg(test)] extern crate test;
|
|
|
|
pub use binary_heap::BinaryHeap;
|
|
pub use btree_map::BTreeMap;
|
|
pub use btree_set::BTreeSet;
|
|
pub use linked_list::LinkedList;
|
|
pub use enum_set::EnumSet;
|
|
pub use vec_deque::VecDeque;
|
|
pub use string::String;
|
|
pub use vec::Vec;
|
|
|
|
// Needed for the vec! macro
|
|
pub use alloc::boxed;
|
|
|
|
#[macro_use]
|
|
mod macros;
|
|
|
|
pub mod binary_heap;
|
|
mod btree;
|
|
pub mod borrow;
|
|
pub mod enum_set;
|
|
pub mod fmt;
|
|
pub mod linked_list;
|
|
pub mod range;
|
|
pub mod slice;
|
|
pub mod str;
|
|
pub mod string;
|
|
pub mod vec;
|
|
pub mod vec_deque;
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
pub mod btree_map {
|
|
pub use btree::map::*;
|
|
}
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
pub mod btree_set {
|
|
pub use btree::set::*;
|
|
}
|
|
|
|
#[cfg(not(test))]
|
|
mod std {
|
|
pub use core::ops; // RangeFull
|
|
}
|
|
|
|
/// An endpoint of a range of keys.
|
|
#[unstable(feature = "collections_bound", issue = "27787")]
|
|
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
|
|
pub enum Bound<T> {
|
|
/// An inclusive bound.
|
|
Included(T),
|
|
/// An exclusive bound.
|
|
Excluded(T),
|
|
/// An infinite endpoint. Indicates that there is no bound in this direction.
|
|
Unbounded,
|
|
}
|