]> git.proxmox.com Git - rustc.git/blob - src/libcollections/lib.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / libcollections / lib.rs
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 //!
13 //! See [std::collections](../std/collections/index.html) for a detailed discussion of
14 //! collections in Rust.
15
16 #![crate_name = "collections"]
17 #![crate_type = "rlib"]
18 #![unstable(feature = "collections",
19 reason = "library is unlikely to be stabilized with the current \
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",
23 html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
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/",
27 test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
28
29 #![cfg_attr(test, allow(deprecated))] // rand
30 #![cfg_attr(not(stage0), deny(warnings))]
31
32 #![feature(alloc)]
33 #![feature(allow_internal_unstable)]
34 #![feature(box_patterns)]
35 #![feature(box_syntax)]
36 #![feature(core_intrinsics)]
37 #![feature(dropck_parametricity)]
38 #![feature(fmt_internals)]
39 #![feature(heap_api)]
40 #![feature(inclusive_range)]
41 #![feature(iter_arith)]
42 #![feature(lang_items)]
43 #![feature(nonzero)]
44 #![feature(pattern)]
45 #![feature(placement_in)]
46 #![feature(placement_new_protocol)]
47 #![feature(shared)]
48 #![feature(slice_patterns)]
49 #![feature(specialization)]
50 #![feature(staged_api)]
51 #![feature(step_by)]
52 #![feature(str_char)]
53 #![feature(unboxed_closures)]
54 #![feature(unicode)]
55 #![feature(unique)]
56 #![feature(unsafe_no_drop_flag)]
57 #![cfg_attr(test, feature(rand, test))]
58
59 #![no_std]
60
61 extern crate rustc_unicode;
62 extern crate alloc;
63
64 #[cfg(test)]
65 #[macro_use]
66 extern crate std;
67 #[cfg(test)]
68 extern crate test;
69
70 #[doc(no_inline)]
71 pub use binary_heap::BinaryHeap;
72 #[doc(no_inline)]
73 pub use btree_map::BTreeMap;
74 #[doc(no_inline)]
75 pub use btree_set::BTreeSet;
76 #[doc(no_inline)]
77 pub use linked_list::LinkedList;
78 #[doc(no_inline)]
79 pub use enum_set::EnumSet;
80 #[doc(no_inline)]
81 pub use vec_deque::VecDeque;
82 #[doc(no_inline)]
83 pub use string::String;
84 #[doc(no_inline)]
85 pub use vec::Vec;
86
87 // Needed for the vec! macro
88 pub use alloc::boxed;
89
90 #[macro_use]
91 mod macros;
92
93 pub mod binary_heap;
94 mod btree;
95 pub mod borrow;
96 pub mod enum_set;
97 pub mod fmt;
98 pub mod linked_list;
99 pub mod range;
100 pub mod slice;
101 pub mod str;
102 pub mod string;
103 pub mod vec;
104 pub mod vec_deque;
105
106 #[stable(feature = "rust1", since = "1.0.0")]
107 pub mod btree_map {
108 #[stable(feature = "rust1", since = "1.0.0")]
109 pub use btree::map::*;
110 }
111
112 #[stable(feature = "rust1", since = "1.0.0")]
113 pub mod btree_set {
114 #[stable(feature = "rust1", since = "1.0.0")]
115 pub use btree::set::*;
116 }
117
118 #[cfg(not(test))]
119 mod std {
120 pub use core::ops; // RangeFull
121 }
122
123 /// An endpoint of a range of keys.
124 #[unstable(feature = "collections_bound", issue = "27787")]
125 #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
126 pub 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 }