]> git.proxmox.com Git - rustc.git/blame - src/libcollections/lib.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / libcollections / lib.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11//! Collection types.
12//!
9cc50fc6 13//! See [std::collections](../std/collections/index.html) for a detailed discussion of
62682a34 14//! collections in Rust.
1a4d82fc 15
1a4d82fc 16#![crate_name = "collections"]
1a4d82fc 17#![crate_type = "rlib"]
62682a34
SL
18#![unstable(feature = "collections",
19 reason = "library is unlikely to be stabilized with the current \
e9174d1e
SL
20 layout and name, use std::collections instead",
21 issue = "27783")]
22#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
62682a34 23 html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
e9174d1e
SL
24 html_root_url = "https://doc.rust-lang.org/nightly/",
25 html_playground_url = "https://play.rust-lang.org/",
26 issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
92a42be0 27 test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
1a4d82fc 28
62682a34 29#![cfg_attr(test, allow(deprecated))] // rand
7453a54e 30#![cfg_attr(not(stage0), deny(warnings))]
62682a34 31
85aaf69f 32#![feature(alloc)]
54a0048b 33#![feature(allow_internal_unstable)]
85aaf69f 34#![feature(box_patterns)]
62682a34 35#![feature(box_syntax)]
62682a34 36#![feature(core_intrinsics)]
9cc50fc6 37#![feature(dropck_parametricity)]
b039eaaf 38#![feature(fmt_internals)]
62682a34 39#![feature(heap_api)]
54a0048b 40#![feature(inclusive_range)]
62682a34 41#![feature(iter_arith)]
c34b1796 42#![feature(lang_items)]
9cc50fc6 43#![feature(nonzero)]
62682a34 44#![feature(pattern)]
7453a54e
SL
45#![feature(placement_in)]
46#![feature(placement_new_protocol)]
9cc50fc6 47#![feature(shared)]
62682a34 48#![feature(slice_patterns)]
54a0048b 49#![feature(specialization)]
85aaf69f 50#![feature(staged_api)]
62682a34
SL
51#![feature(step_by)]
52#![feature(str_char)]
1a4d82fc 53#![feature(unboxed_closures)]
85aaf69f 54#![feature(unicode)]
c34b1796 55#![feature(unique)]
9cc50fc6 56#![feature(unsafe_no_drop_flag)]
7453a54e 57#![cfg_attr(test, feature(rand, test))]
85aaf69f 58
1a4d82fc
JJ
59#![no_std]
60
d9579d0f 61extern crate rustc_unicode;
1a4d82fc
JJ
62extern crate alloc;
63
92a42be0
SL
64#[cfg(test)]
65#[macro_use]
66extern crate std;
67#[cfg(test)]
68extern crate test;
1a4d82fc 69
54a0048b 70#[doc(no_inline)]
1a4d82fc 71pub use binary_heap::BinaryHeap;
54a0048b 72#[doc(no_inline)]
1a4d82fc 73pub use btree_map::BTreeMap;
54a0048b 74#[doc(no_inline)]
1a4d82fc 75pub use btree_set::BTreeSet;
54a0048b 76#[doc(no_inline)]
85aaf69f 77pub use linked_list::LinkedList;
54a0048b 78#[doc(no_inline)]
1a4d82fc 79pub use enum_set::EnumSet;
54a0048b 80#[doc(no_inline)]
85aaf69f 81pub use vec_deque::VecDeque;
54a0048b 82#[doc(no_inline)]
1a4d82fc 83pub use string::String;
54a0048b 84#[doc(no_inline)]
1a4d82fc 85pub use vec::Vec;
1a4d82fc
JJ
86
87// Needed for the vec! macro
88pub use alloc::boxed;
89
90#[macro_use]
91mod macros;
92
93pub mod binary_heap;
1a4d82fc 94mod btree;
c34b1796 95pub mod borrow;
1a4d82fc 96pub mod enum_set;
85aaf69f 97pub mod fmt;
c34b1796 98pub mod linked_list;
d9579d0f 99pub mod range;
1a4d82fc
JJ
100pub mod slice;
101pub mod str;
102pub mod string;
103pub mod vec;
c34b1796 104pub mod vec_deque;
1a4d82fc 105
85aaf69f 106#[stable(feature = "rust1", since = "1.0.0")]
1a4d82fc 107pub mod btree_map {
92a42be0 108 #[stable(feature = "rust1", since = "1.0.0")]
1a4d82fc
JJ
109 pub use btree::map::*;
110}
111
85aaf69f 112#[stable(feature = "rust1", since = "1.0.0")]
1a4d82fc 113pub mod btree_set {
92a42be0 114 #[stable(feature = "rust1", since = "1.0.0")]
1a4d82fc
JJ
115 pub use btree::set::*;
116}
117
1a4d82fc
JJ
118#[cfg(not(test))]
119mod std {
85aaf69f 120 pub use core::ops; // RangeFull
1a4d82fc
JJ
121}
122
85aaf69f 123/// An endpoint of a range of keys.
e9174d1e 124#[unstable(feature = "collections_bound", issue = "27787")]
c34b1796 125#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
85aaf69f
SL
126pub enum Bound<T> {
127 /// An inclusive bound.
128 Included(T),
129 /// An exclusive bound.
130 Excluded(T),
131 /// An infinite endpoint. Indicates that there is no bound in this direction.
132 Unbounded,
133}