Skip to content

Commit

Permalink
Merge crate collections into alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
murarth committed Jun 14, 2017
1 parent e40ef96 commit eadda76
Show file tree
Hide file tree
Showing 97 changed files with 2,347 additions and 2,516 deletions.
11 changes: 1 addition & 10 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/bootstrap/dist.rs
Expand Up @@ -376,8 +376,8 @@ pub fn debugger_scripts(build: &Build,
install(&build.src.join("src/etc/rust-windbg.cmd"), &sysroot.join("bin"),
0o755);

cp_debugger_script("natvis/liballoc.natvis");
cp_debugger_script("natvis/libcore.natvis");
cp_debugger_script("natvis/libcollections.natvis");
} else {
cp_debugger_script("debugger_pretty_printers_common.py");

Expand Down Expand Up @@ -550,7 +550,6 @@ pub fn rust_src(build: &Build) {
"src/liballoc_jemalloc",
"src/liballoc_system",
"src/libbacktrace",
"src/libcollections",
"src/libcompiler_builtins",
"src/libcore",
"src/liblibc",
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/doc.rs
Expand Up @@ -246,7 +246,7 @@ pub fn std(build: &Build, stage: u32, target: &str) {
// for which docs must be built.
if !build.config.compiler_docs {
cargo.arg("--no-deps");
for krate in &["alloc", "collections", "core", "std", "std_unicode"] {
for krate in &["alloc", "core", "std", "std_unicode"] {
cargo.arg("-p").arg(krate);
// Create all crate output directories first to make sure rustdoc uses
// relative links.
Expand Down
1 change: 0 additions & 1 deletion src/doc/unstable-book/src/SUMMARY.md
Expand Up @@ -108,7 +108,6 @@
- [coerce_unsized](library-features/coerce-unsized.md)
- [collection_placement](library-features/collection-placement.md)
- [collections_range](library-features/collections-range.md)
- [collections](library-features/collections.md)
- [command_envs](library-features/command-envs.md)
- [compiler_builtins_lib](library-features/compiler-builtins-lib.md)
- [compiler_fences](library-features/compiler-fences.md)
Expand Down
5 changes: 0 additions & 5 deletions src/doc/unstable-book/src/library-features/collections.md

This file was deleted.

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="collections::vec::Vec&lt;*&gt;">
<Type Name="alloc::vec::Vec&lt;*&gt;">
<DisplayString>{{ size={len} }}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple">len</Item>
Expand All @@ -11,7 +11,7 @@
</ArrayItems>
</Expand>
</Type>
<Type Name="collections::vec_deque::VecDeque&lt;*&gt;">
<Type Name="alloc::vec_deque::VecDeque&lt;*&gt;">
<DisplayString>{{ size={tail &lt;= head ? head - tail : buf.cap - tail + head} }}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple">tail &lt;= head ? head - tail : buf.cap - tail + head</Item>
Expand All @@ -30,18 +30,18 @@
</CustomListItems>
</Expand>
</Type>
<Type Name="collections::linked_list::LinkedList&lt;*&gt;">
<Type Name="alloc::linked_list::LinkedList&lt;*&gt;">
<DisplayString>{{ size={len} }}</DisplayString>
<Expand>
<LinkedListItems>
<Size>len</Size>
<HeadPointer>*(collections::linked_list::Node&lt;$T1&gt; **)&amp;head</HeadPointer>
<NextPointer>*(collections::linked_list::Node&lt;$T1&gt; **)&amp;next</NextPointer>
<HeadPointer>*(alloc::linked_list::Node&lt;$T1&gt; **)&amp;head</HeadPointer>
<NextPointer>*(alloc::linked_list::Node&lt;$T1&gt; **)&amp;next</NextPointer>
<ValueNode>element</ValueNode>
</LinkedListItems>
</Expand>
</Type>
<Type Name="collections::string::String">
<Type Name="alloc::string::String">
<DisplayString>{*(char**)this,[vec.len]}</DisplayString>
<StringView>*(char**)this,[vec.len]</StringView>
<Expand>
Expand All @@ -53,4 +53,4 @@
</ArrayItems>
</Expand>
</Type>
</AutoVisualizer>
</AutoVisualizer>
2 changes: 1 addition & 1 deletion src/etc/rust-windbg.cmd
Expand Up @@ -15,4 +15,4 @@ for /f "delims=" %%i in ('rustc --print=sysroot') do set rustc_sysroot=%%i

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

windbg -c ".nvload %rust_etc%\libcore.natvis;.nvload %rust_etc%\libcollections.natvis;" %*
windbg -c ".nvload %rust_etc%\liballoc.natvis; .nvload %rust_etc%\libcore.natvis;" %*
9 changes: 9 additions & 0 deletions src/liballoc/Cargo.toml
Expand Up @@ -9,3 +9,12 @@ path = "lib.rs"

[dependencies]
core = { path = "../libcore" }
std_unicode = { path = "../libstd_unicode" }

[[test]]
name = "collectionstests"
path = "../liballoc/tests/lib.rs"

[[bench]]
name = "collectionsbenches"
path = "../liballoc/benches/lib.rs"
5 changes: 3 additions & 2 deletions src/liballoc/arc.rs
Expand Up @@ -1222,11 +1222,12 @@ mod tests {
use std::sync::atomic;
use std::sync::atomic::Ordering::{Acquire, SeqCst};
use std::thread;
use std::vec::Vec;
use super::{Arc, Weak};
use std::sync::Mutex;
use std::convert::From;

use super::{Arc, Weak};
use vec::Vec;

struct Canary(*mut atomic::AtomicUsize);

impl Drop for Canary {
Expand Down
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/liballoc/boxed.rs
Expand Up @@ -95,6 +95,7 @@ pub const HEAP: ExchangeHeapSingleton = ExchangeHeapSingleton { _force_singleton
#[unstable(feature = "box_heap",
reason = "may be renamed; uncertain about custom allocator design",
issue = "27779")]
#[allow(missing_debug_implementations)]
#[derive(Copy, Clone)]
pub struct ExchangeHeapSingleton {
_force_singleton: (),
Expand Down Expand Up @@ -129,6 +130,7 @@ pub struct Box<T: ?Sized>(Unique<T>);
#[unstable(feature = "placement_in",
reason = "placement box design is still being worked out.",
issue = "27779")]
#[allow(missing_debug_implementations)]
pub struct IntermediateBox<T: ?Sized> {
ptr: *mut u8,
size: usize,
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -41,14 +41,14 @@
// - A node of length `n` has `n` keys, `n` values, and (in an internal node) `n + 1` edges.
// This implies that even an empty internal node has at least one edge.

use alloc::heap;
use core::marker::PhantomData;
use core::mem;
use core::nonzero::NonZero;
use core::ptr::{self, Unique};
use core::slice;

use boxed::Box;
use heap;

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

0 comments on commit eadda76

Please sign in to comment.