Skip to content

Commit 6484258

Browse files
committed
Reintroduce deprecated collections crate
1 parent dfb8c80 commit 6484258

File tree

8 files changed

+102
-1
lines changed

8 files changed

+102
-1
lines changed

src/Cargo.lock

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/dist.rs

+1
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ pub fn rust_src(build: &Build) {
550550
"src/liballoc_jemalloc",
551551
"src/liballoc_system",
552552
"src/libbacktrace",
553+
"src/libcollections",
553554
"src/libcompiler_builtins",
554555
"src/libcore",
555556
"src/liblibc",

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub fn std(build: &Build, stage: u32, target: &str) {
254254
// for which docs must be built.
255255
if !build.config.compiler_docs {
256256
cargo.arg("--no-deps");
257-
for krate in &["alloc", "core", "std", "std_unicode"] {
257+
for krate in &["alloc", "collections", "core", "std", "std_unicode"] {
258258
cargo.arg("-p").arg(krate);
259259
// Create all crate output directories first to make sure rustdoc uses
260260
// relative links.

src/doc/unstable-book/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
- [char_escape_debug](library-features/char-escape-debug.md)
109109
- [coerce_unsized](library-features/coerce-unsized.md)
110110
- [collection_placement](library-features/collection-placement.md)
111+
- [collections](library-features/collections.md)
111112
- [collections_range](library-features/collections-range.md)
112113
- [command_envs](library-features/command-envs.md)
113114
- [compiler_builtins_lib](library-features/compiler-builtins-lib.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# `collections`
2+
3+
This feature is internal to the Rust compiler and is not intended for general use.
4+
5+
------------------------

src/libcollections/Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
authors = ["The Rust Project Developers"]
3+
name = "collections"
4+
version = "0.0.0"
5+
6+
[lib]
7+
name = "collections"
8+
path = "lib.rs"
9+
10+
[dependencies]
11+
alloc = { path = "../liballoc" }
12+
core = { path = "../libcore" }

src/libcollections/lib.rs

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Copyright 2017 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+
#![crate_name = "collections"]
12+
#![crate_type = "rlib"]
13+
#![allow(unused_attributes)]
14+
#![unstable(feature = "collections",
15+
reason = "this library is unlikely to be stabilized in its current \
16+
form or name",
17+
issue = "27783")]
18+
#![rustc_deprecated(since = "1.20.0",
19+
reason = "collections moved to `alloc`")]
20+
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
21+
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
22+
html_root_url = "https://doc.rust-lang.org/nightly/",
23+
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
24+
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
25+
#![no_std]
26+
#![needs_allocator]
27+
#![deny(warnings)]
28+
29+
#![feature(alloc)]
30+
#![feature(collections_range)]
31+
#![feature(macro_reexport)]
32+
#![feature(needs_allocator)]
33+
#![feature(staged_api)]
34+
35+
//! Collection types
36+
//!
37+
//! See [`std::collections`](../std/collections/index.html) for a detailed
38+
//! discussion of collections in Rust.
39+
40+
#[macro_reexport(vec, format)]
41+
extern crate alloc;
42+
43+
pub use alloc::Bound;
44+
45+
pub use alloc::binary_heap;
46+
pub use alloc::borrow;
47+
pub use alloc::fmt;
48+
pub use alloc::linked_list;
49+
pub use alloc::range;
50+
pub use alloc::slice;
51+
pub use alloc::str;
52+
pub use alloc::string;
53+
pub use alloc::vec;
54+
pub use alloc::vec_deque;
55+
56+
pub use alloc::btree_map;
57+
pub use alloc::btree_set;
58+
59+
#[doc(no_inline)]
60+
pub use alloc::binary_heap::BinaryHeap;
61+
#[doc(no_inline)]
62+
pub use alloc::btree_map::BTreeMap;
63+
#[doc(no_inline)]
64+
pub use alloc::btree_set::BTreeSet;
65+
#[doc(no_inline)]
66+
pub use alloc::linked_list::LinkedList;
67+
#[doc(no_inline)]
68+
pub use alloc::vec_deque::VecDeque;
69+
#[doc(no_inline)]
70+
pub use alloc::string::String;
71+
#[doc(no_inline)]
72+
pub use alloc::vec::Vec;

src/libstd/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ alloc_jemalloc = { path = "../liballoc_jemalloc", optional = true }
1515
alloc_system = { path = "../liballoc_system" }
1616
panic_unwind = { path = "../libpanic_unwind", optional = true }
1717
panic_abort = { path = "../libpanic_abort" }
18+
collections = { path = "../libcollections" }
1819
core = { path = "../libcore" }
1920
libc = { path = "../rustc/libc_shim" }
2021
rand = { path = "../librand" }

0 commit comments

Comments
 (0)