Skip to content

Commit 258ae6d

Browse files
committed
Auto merge of #42648 - murarth:merge-alloc-collections, r=alexcrichton
Merge crate `collections` into `alloc` This is a necessary step in order to merge #42565
2 parents 16c27bf + eadda76 commit 258ae6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2347
-2516
lines changed

src/Cargo.lock

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

src/bootstrap/dist.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ pub fn debugger_scripts(build: &Build,
376376
install(&build.src.join("src/etc/rust-windbg.cmd"), &sysroot.join("bin"),
377377
0o755);
378378

379+
cp_debugger_script("natvis/liballoc.natvis");
379380
cp_debugger_script("natvis/libcore.natvis");
380-
cp_debugger_script("natvis/libcollections.natvis");
381381
} else {
382382
cp_debugger_script("debugger_pretty_printers_common.py");
383383

@@ -550,7 +550,6 @@ pub fn rust_src(build: &Build) {
550550
"src/liballoc_jemalloc",
551551
"src/liballoc_system",
552552
"src/libbacktrace",
553-
"src/libcollections",
554553
"src/libcompiler_builtins",
555554
"src/libcore",
556555
"src/liblibc",

src/bootstrap/doc.rs

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

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

-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
- [coerce_unsized](library-features/coerce-unsized.md)
111111
- [collection_placement](library-features/collection-placement.md)
112112
- [collections_range](library-features/collections-range.md)
113-
- [collections](library-features/collections.md)
114113
- [command_envs](library-features/command-envs.md)
115114
- [compiler_builtins_lib](library-features/compiler-builtins-lib.md)
116115
- [compiler_fences](library-features/compiler-fences.md)

src/doc/unstable-book/src/library-features/collections.md

-5
This file was deleted.

src/etc/natvis/libcollections.natvis renamed to src/etc/natvis/liballoc.natvis

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
3-
<Type Name="collections::vec::Vec&lt;*&gt;">
3+
<Type Name="alloc::vec::Vec&lt;*&gt;">
44
<DisplayString>{{ size={len} }}</DisplayString>
55
<Expand>
66
<Item Name="[size]" ExcludeView="simple">len</Item>
@@ -11,7 +11,7 @@
1111
</ArrayItems>
1212
</Expand>
1313
</Type>
14-
<Type Name="collections::vec_deque::VecDeque&lt;*&gt;">
14+
<Type Name="alloc::vec_deque::VecDeque&lt;*&gt;">
1515
<DisplayString>{{ size={tail &lt;= head ? head - tail : buf.cap - tail + head} }}</DisplayString>
1616
<Expand>
1717
<Item Name="[size]" ExcludeView="simple">tail &lt;= head ? head - tail : buf.cap - tail + head</Item>
@@ -30,18 +30,18 @@
3030
</CustomListItems>
3131
</Expand>
3232
</Type>
33-
<Type Name="collections::linked_list::LinkedList&lt;*&gt;">
33+
<Type Name="alloc::linked_list::LinkedList&lt;*&gt;">
3434
<DisplayString>{{ size={len} }}</DisplayString>
3535
<Expand>
3636
<LinkedListItems>
3737
<Size>len</Size>
38-
<HeadPointer>*(collections::linked_list::Node&lt;$T1&gt; **)&amp;head</HeadPointer>
39-
<NextPointer>*(collections::linked_list::Node&lt;$T1&gt; **)&amp;next</NextPointer>
38+
<HeadPointer>*(alloc::linked_list::Node&lt;$T1&gt; **)&amp;head</HeadPointer>
39+
<NextPointer>*(alloc::linked_list::Node&lt;$T1&gt; **)&amp;next</NextPointer>
4040
<ValueNode>element</ValueNode>
4141
</LinkedListItems>
4242
</Expand>
4343
</Type>
44-
<Type Name="collections::string::String">
44+
<Type Name="alloc::string::String">
4545
<DisplayString>{*(char**)this,[vec.len]}</DisplayString>
4646
<StringView>*(char**)this,[vec.len]</StringView>
4747
<Expand>
@@ -53,4 +53,4 @@
5353
</ArrayItems>
5454
</Expand>
5555
</Type>
56-
</AutoVisualizer>
56+
</AutoVisualizer>

src/etc/rust-windbg.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ for /f "delims=" %%i in ('rustc --print=sysroot') do set rustc_sysroot=%%i
1515

1616
set rust_etc=%rustc_sysroot%\lib\rustlib\etc
1717

18-
windbg -c ".nvload %rust_etc%\libcore.natvis;.nvload %rust_etc%\libcollections.natvis;" %*
18+
windbg -c ".nvload %rust_etc%\liballoc.natvis; .nvload %rust_etc%\libcore.natvis;" %*

src/liballoc/Cargo.toml

+9
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ path = "lib.rs"
99

1010
[dependencies]
1111
core = { path = "../libcore" }
12+
std_unicode = { path = "../libstd_unicode" }
13+
14+
[[test]]
15+
name = "collectionstests"
16+
path = "../liballoc/tests/lib.rs"
17+
18+
[[bench]]
19+
name = "collectionsbenches"
20+
path = "../liballoc/benches/lib.rs"

src/liballoc/arc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1222,11 +1222,12 @@ mod tests {
12221222
use std::sync::atomic;
12231223
use std::sync::atomic::Ordering::{Acquire, SeqCst};
12241224
use std::thread;
1225-
use std::vec::Vec;
1226-
use super::{Arc, Weak};
12271225
use std::sync::Mutex;
12281226
use std::convert::From;
12291227

1228+
use super::{Arc, Weak};
1229+
use vec::Vec;
1230+
12301231
struct Canary(*mut atomic::AtomicUsize);
12311232

12321233
impl Drop for Canary {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/liballoc/boxed.rs

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ pub const HEAP: ExchangeHeapSingleton = ExchangeHeapSingleton { _force_singleton
9595
#[unstable(feature = "box_heap",
9696
reason = "may be renamed; uncertain about custom allocator design",
9797
issue = "27779")]
98+
#[allow(missing_debug_implementations)]
9899
#[derive(Copy, Clone)]
99100
pub struct ExchangeHeapSingleton {
100101
_force_singleton: (),
@@ -129,6 +130,7 @@ pub struct Box<T: ?Sized>(Unique<T>);
129130
#[unstable(feature = "placement_in",
130131
reason = "placement box design is still being worked out.",
131132
issue = "27779")]
133+
#[allow(missing_debug_implementations)]
132134
pub struct IntermediateBox<T: ?Sized> {
133135
ptr: *mut u8,
134136
size: usize,
File renamed without changes.
File renamed without changes.

src/libcollections/btree/node.rs renamed to src/liballoc/btree/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
// - A node of length `n` has `n` keys, `n` values, and (in an internal node) `n + 1` edges.
4242
// This implies that even an empty internal node has at least one edge.
4343

44-
use alloc::heap;
4544
use core::marker::PhantomData;
4645
use core::mem;
4746
use core::nonzero::NonZero;
4847
use core::ptr::{self, Unique};
4948
use core::slice;
5049

5150
use boxed::Box;
51+
use heap;
5252

5353
const B: usize = 6;
5454
pub const MIN_LEN: usize = B - 1;
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)