]> git.lizzy.rs Git - rust.git/blob - src/libcollections/lib.rs
Rollup merge of #41249 - GuillaumeGomez:rustdoc-render, r=steveklabnik,frewsxcv
[rust.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
14 //! discussion of 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 #![deny(warnings)]
31 #![deny(missing_debug_implementations)]
32
33 #![feature(alloc)]
34 #![feature(allow_internal_unstable)]
35 #![feature(box_patterns)]
36 #![feature(box_syntax)]
37 #![cfg_attr(not(test), feature(char_escape_debug))]
38 #![feature(core_intrinsics)]
39 #![feature(dropck_eyepatch)]
40 #![feature(exact_size_is_empty)]
41 #![feature(fmt_internals)]
42 #![feature(fused)]
43 #![feature(generic_param_attrs)]
44 #![feature(heap_api)]
45 #![feature(inclusive_range)]
46 #![feature(lang_items)]
47 #![feature(manually_drop)]
48 #![feature(nonzero)]
49 #![feature(pattern)]
50 #![feature(placement_in)]
51 #![feature(placement_in_syntax)]
52 #![feature(placement_new_protocol)]
53 #![feature(shared)]
54 #![feature(slice_get_slice)]
55 #![feature(slice_patterns)]
56 #![feature(slice_rsplit)]
57 #![cfg_attr(not(test), feature(sort_unstable))]
58 #![feature(specialization)]
59 #![feature(staged_api)]
60 #![feature(str_internals)]
61 #![feature(str_mut_extras)]
62 #![feature(trusted_len)]
63 #![feature(unicode)]
64 #![feature(unique)]
65 #![feature(untagged_unions)]
66 #![cfg_attr(not(test), feature(str_checked_slicing))]
67 #![cfg_attr(test, feature(rand, test))]
68 #![feature(offset_to)]
69
70 #![no_std]
71
72 extern crate std_unicode;
73 extern crate alloc;
74
75 #[cfg(test)]
76 #[macro_use]
77 extern crate std;
78 #[cfg(test)]
79 extern crate test;
80
81 #[doc(no_inline)]
82 pub use binary_heap::BinaryHeap;
83 #[doc(no_inline)]
84 pub use btree_map::BTreeMap;
85 #[doc(no_inline)]
86 pub use btree_set::BTreeSet;
87 #[doc(no_inline)]
88 pub use linked_list::LinkedList;
89 #[doc(no_inline)]
90 #[allow(deprecated)]
91 pub use enum_set::EnumSet;
92 #[doc(no_inline)]
93 pub use vec_deque::VecDeque;
94 #[doc(no_inline)]
95 pub use string::String;
96 #[doc(no_inline)]
97 pub use vec::Vec;
98
99 // Needed for the vec! macro
100 pub use alloc::boxed;
101
102 #[macro_use]
103 mod macros;
104
105 pub mod binary_heap;
106 mod btree;
107 pub mod borrow;
108 pub mod enum_set;
109 pub mod fmt;
110 pub mod linked_list;
111 pub mod range;
112 pub mod slice;
113 pub mod str;
114 pub mod string;
115 pub mod vec;
116 pub mod vec_deque;
117
118 #[stable(feature = "rust1", since = "1.0.0")]
119 pub mod btree_map {
120     //! A map based on a B-Tree.
121     #[stable(feature = "rust1", since = "1.0.0")]
122     pub use btree::map::*;
123 }
124
125 #[stable(feature = "rust1", since = "1.0.0")]
126 pub mod btree_set {
127     //! A set based on a B-Tree.
128     #[stable(feature = "rust1", since = "1.0.0")]
129     pub use btree::set::*;
130 }
131
132 #[cfg(not(test))]
133 mod std {
134     pub use core::ops;      // RangeFull
135 }
136
137 /// An endpoint of a range of keys.
138 #[stable(feature = "collections_bound", since = "1.17.0")]
139 #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
140 pub enum Bound<T> {
141     /// An inclusive bound.
142     #[stable(feature = "collections_bound", since = "1.17.0")]
143     Included(T),
144     /// An exclusive bound.
145     #[stable(feature = "collections_bound", since = "1.17.0")]
146     Excluded(T),
147     /// An infinite endpoint. Indicates that there is no bound in this direction.
148     #[stable(feature = "collections_bound", since = "1.17.0")]
149     Unbounded,
150 }
151
152 /// An intermediate trait for specialization of `Extend`.
153 #[doc(hidden)]
154 trait SpecExtend<I: IntoIterator> {
155     /// Extends `self` with the contents of the given iterator.
156     fn spec_extend(&mut self, iter: I);
157 }