This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
140 lines
3.8 KiB
Rust
140 lines
3.8 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"]
|
|
#![cfg_attr(stage0, 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, attr(allow(unused_variables), deny(warnings))))]
|
|
|
|
#![allow(trivial_casts)]
|
|
#![cfg_attr(test, allow(deprecated))] // rand
|
|
|
|
// SNAP 1af31d4
|
|
#![allow(unused_features)]
|
|
// SNAP 1af31d4
|
|
#![allow(unused_attributes)]
|
|
|
|
#![cfg_attr(stage0, feature(rustc_attrs))]
|
|
#![cfg_attr(stage0, allow(unused_attributes))]
|
|
#![feature(alloc)]
|
|
#![feature(box_patterns)]
|
|
#![feature(box_syntax)]
|
|
#![feature(core_intrinsics)]
|
|
#![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)]
|
|
#![feature(drop_in_place)]
|
|
#![feature(clone_from_slice)]
|
|
#![cfg_attr(test, feature(clone_from_slice, rand, test))]
|
|
|
|
#![cfg_attr(stage0, 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 {
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
pub use btree::map::*;
|
|
}
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
pub mod btree_set {
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
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,
|
|
}
|