Skip to content

Commit a2701d7

Browse files
committed
---
yaml --- r: 165412 b: refs/heads/master c: e654491 h: refs/heads/master v: v3
1 parent 0e8aeff commit a2701d7

File tree

150 files changed

+2639
-1294
lines changed

Some content is hidden

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

150 files changed

+2639
-1294
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e0d44386d334e13677e2d43ad9365d6b24350780
2+
refs/heads/master: e654491960a07fe4f8ab2034a080276b129c9cfd
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 658529467d9d69ac9e09cacf98a6d61d781c2c76
55
refs/heads/try: aee614fc4973262a5a68efc643026e2b1458d65b

trunk/mk/crates.mk

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc \
5555
unicode
56-
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_driver rustc_trans rustc_back rustc_llvm
56+
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
57+
rustc_trans rustc_back rustc_llvm
5758
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
5859
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5960
TOOLS := compiletest rustdoc rustc
@@ -67,11 +68,12 @@ DEPS_std := core libc rand alloc collections unicode \
6768
DEPS_graphviz := std
6869
DEPS_syntax := std term serialize log fmt_macros arena libc
6970
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
70-
rustc_typeck log syntax serialize rustc_llvm rustc_trans
71+
rustc_typeck rustc_resolve log syntax serialize rustc_llvm rustc_trans
7172
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7273
log syntax serialize rustc_llvm
7374
DEPS_rustc_typeck := rustc syntax
7475
DEPS_rustc_borrowck := rustc log graphviz syntax
76+
DEPS_rustc_resolve := rustc log syntax
7577
DEPS_rustc := syntax flate arena serialize getopts rbml \
7678
time log graphviz rustc_llvm rustc_back
7779
DEPS_rustc_llvm := native:rustllvm libc std
@@ -118,9 +120,11 @@ DOC_CRATES := $(filter-out rustc, \
118120
$(filter-out rustc_trans, \
119121
$(filter-out rustc_typeck, \
120122
$(filter-out rustc_borrowck, \
123+
$(filter-out rustc_resolve, \
121124
$(filter-out rustc_driver, \
122-
$(filter-out syntax, $(CRATES)))))))
123-
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_typeck rustc_driver syntax
125+
$(filter-out syntax, $(CRATES))))))))
126+
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
127+
rustc_typeck rustc_driver syntax
124128

125129
# This macro creates some simple definitions for each crate being built, just
126130
# some munging of all of the parameters above.

trunk/mk/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ $(eval $(call RUST_CRATE,coretest))
2121

2222
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
24-
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_trans,$(HOST_CRATES))
24+
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans,\
25+
$(HOST_CRATES))
2526
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2627

2728
######################################################################

trunk/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ fn _arm_exec_compiled_test(config: &Config,
16091609
stderr_out.as_slice());
16101610

16111611
ProcRes {
1612-
status: process::ExitStatus(exitcode),
1612+
status: process::ProcessExit::ExitStatus(exitcode),
16131613
stdout: stdout_out,
16141614
stderr: stderr_out,
16151615
cmdline: cmdline
@@ -1666,7 +1666,7 @@ fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
16661666
// FIXME (#9639): This needs to handle non-utf8 paths
16671667
let mut link_args = vec!("-L".to_string(),
16681668
aux_dir.as_str().unwrap().to_string());
1669-
let llvm_args = vec!("--emit=bc,obj".to_string(),
1669+
let llvm_args = vec!("--emit=llvm-bc,obj".to_string(),
16701670
"--crate-type=lib".to_string());
16711671
link_args.extend(llvm_args.into_iter());
16721672
let args = make_compile_args(config,

trunk/src/doc/guide.md

Lines changed: 76 additions & 78 deletions
Large diffs are not rendered by default.

trunk/src/doc/rust.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
* Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
33
* file at the top-level directory of this distribution and at
44
* http://rust-lang.org/COPYRIGHT.
55
* With elements taken from Bootstrap v3.0.2 (MIT licensed).
@@ -209,7 +209,6 @@ pre {
209209
code {
210210
padding: 0 2px;
211211
color: #8D1A38;
212-
white-space: pre-wrap;
213212
}
214213
pre code {
215214
padding: 0;

trunk/src/etc/rust-lldb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TMPFILE=`mktemp /tmp/rust-lldb-commands.XXXXXX`
1919
trap "rm -f $TMPFILE; exit" INT TERM EXIT
2020

2121
# Find out where to look for the pretty printer Python module
22-
RUSTC_SYSROOT=`rustc -Zprint-sysroot`
22+
RUSTC_SYSROOT=`rustc --print sysroot`
2323

2424
# Write the LLDB script to the tempfile
2525
echo "command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_rust_formatters.py\"" >> $TMPFILE

trunk/src/libcollections/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::prelude::*;
11+
use prelude::*;
1212
use std::rand;
1313
use std::rand::Rng;
1414
use test::Bencher;

trunk/src/libcollections/binary_heap.rs

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,18 @@ impl<T: Ord> BinaryHeap<T> {
551551
#[unstable = "matches collection reform specification, waiting for dust to settle"]
552552
pub fn is_empty(&self) -> bool { self.len() == 0 }
553553

554+
/// Clears the queue, returning an iterator over the removed elements.
555+
#[inline]
556+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
557+
pub fn drain<'a>(&'a mut self) -> Drain<'a, T> {
558+
Drain {
559+
iter: self.data.drain(),
560+
}
561+
}
562+
554563
/// Drops all items from the queue.
555564
#[unstable = "matches collection reform specification, waiting for dust to settle"]
556-
pub fn clear(&mut self) { self.data.truncate(0) }
565+
pub fn clear(&mut self) { self.drain(); }
557566
}
558567

559568
/// `BinaryHeap` iterator.
@@ -596,6 +605,26 @@ impl<T> DoubleEndedIterator<T> for MoveItems<T> {
596605

597606
impl<T> ExactSizeIterator<T> for MoveItems<T> {}
598607

608+
/// An iterator that drains a `BinaryHeap`.
609+
pub struct Drain<'a, T: 'a> {
610+
iter: vec::Drain<'a, T>,
611+
}
612+
613+
impl<'a, T: 'a> Iterator<T> for Drain<'a, T> {
614+
#[inline]
615+
fn next(&mut self) -> Option<T> { self.iter.next() }
616+
617+
#[inline]
618+
fn size_hint(&self) -> (uint, Option<uint>) { self.iter.size_hint() }
619+
}
620+
621+
impl<'a, T: 'a> DoubleEndedIterator<T> for Drain<'a, T> {
622+
#[inline]
623+
fn next_back(&mut self) -> Option<T> { self.iter.next_back() }
624+
}
625+
626+
impl<'a, T: 'a> ExactSizeIterator<T> for Drain<'a, T> {}
627+
599628
impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
600629
fn from_iter<Iter: Iterator<T>>(iter: Iter) -> BinaryHeap<T> {
601630
let vec: Vec<T> = iter.collect();
@@ -617,10 +646,9 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
617646

618647
#[cfg(test)]
619648
mod tests {
620-
use std::prelude::*;
649+
use prelude::*;
621650

622651
use super::BinaryHeap;
623-
use vec::Vec;
624652

625653
#[test]
626654
fn test_iterator() {
@@ -820,4 +848,14 @@ mod tests {
820848
assert_eq!(q.pop().unwrap(), x);
821849
}
822850
}
851+
852+
#[test]
853+
fn test_drain() {
854+
let mut q: BinaryHeap<_> =
855+
[9u, 8, 7, 6, 5, 4, 3, 2, 1].iter().cloned().collect();
856+
857+
assert_eq!(q.drain().take(5).count(), 5);
858+
859+
assert!(q.is_empty());
860+
}
823861
}

trunk/src/libcollections/bit.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,16 +1686,15 @@ impl<'a> Iterator<uint> for TwoBitPositions<'a> {
16861686

16871687
#[cfg(test)]
16881688
mod tests {
1689-
use std::prelude::*;
1690-
use std::iter::range_step;
1689+
use prelude::*;
1690+
use core::iter::range_step;
1691+
use core::u32;
16911692
use std::rand;
16921693
use std::rand::Rng;
1693-
use std::u32;
16941694
use test::{Bencher, black_box};
16951695

16961696
use super::{Bitv, BitvSet, from_fn, from_bytes};
16971697
use bitv;
1698-
use vec::Vec;
16991698

17001699
static BENCH_BITS : uint = 1 << 14;
17011700

@@ -2038,7 +2037,7 @@ mod tests {
20382037
#[test]
20392038
fn test_from_bytes() {
20402039
let bitv = from_bytes(&[0b10110110, 0b00000000, 0b11111111]);
2041-
let str = format!("{}{}{}", "10110110", "00000000", "11111111");
2040+
let str = concat!("10110110", "00000000", "11111111");
20422041
assert_eq!(bitv.to_string(), str);
20432042
}
20442043

trunk/src/libcollections/btree/map.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ pub enum Entry<'a, K:'a, V:'a> {
131131
/// A vacant Entry.
132132
pub struct VacantEntry<'a, K:'a, V:'a> {
133133
key: K,
134-
stack: stack::SearchStack<'a, K, V, node::Edge, node::Leaf>,
134+
stack: stack::SearchStack<'a, K, V, node::handle::Edge, node::handle::Leaf>,
135135
}
136136

137137
/// An occupied Entry.
138138
pub struct OccupiedEntry<'a, K:'a, V:'a> {
139-
stack: stack::SearchStack<'a, K, V, node::KV, node::LeafOrInternal>,
139+
stack: stack::SearchStack<'a, K, V, node::handle::KV, node::handle::LeafOrInternal>,
140140
}
141141

142142
impl<K: Ord, V> BTreeMap<K, V> {
@@ -496,7 +496,8 @@ mod stack {
496496
use core::kinds::marker;
497497
use core::mem;
498498
use super::BTreeMap;
499-
use super::super::node::{mod, Node, Fit, Split, KV, Edge, Internal, Leaf, LeafOrInternal};
499+
use super::super::node::{mod, Node, Fit, Split, Internal, Leaf};
500+
use super::super::node::handle;
500501
use vec::Vec;
501502

502503
/// A generic mutable reference, identical to `&mut` except for the fact that its lifetime
@@ -520,7 +521,7 @@ mod stack {
520521
}
521522
}
522523

523-
type StackItem<K, V> = node::Handle<*mut Node<K, V>, Edge, Internal>;
524+
type StackItem<K, V> = node::Handle<*mut Node<K, V>, handle::Edge, handle::Internal>;
524525
type Stack<K, V> = Vec<StackItem<K, V>>;
525526

526527
/// A `PartialSearchStack` handles the construction of a search stack.
@@ -595,7 +596,9 @@ mod stack {
595596
/// Pushes the requested child of the stack's current top on top of the stack. If the child
596597
/// exists, then a new PartialSearchStack is yielded. Otherwise, a VacantSearchStack is
597598
/// yielded.
598-
pub fn push(mut self, mut edge: node::Handle<IdRef<'id, Node<K, V>>, Edge, Internal>)
599+
pub fn push(mut self, mut edge: node::Handle<IdRef<'id, Node<K, V>>,
600+
handle::Edge,
601+
handle::Internal>)
599602
-> PartialSearchStack<'a, K, V> {
600603
self.stack.push(edge.as_raw());
601604
PartialSearchStack {
@@ -617,7 +620,7 @@ mod stack {
617620
}
618621
}
619622

620-
impl<'a, K, V, NodeType> SearchStack<'a, K, V, KV, NodeType> {
623+
impl<'a, K, V, NodeType> SearchStack<'a, K, V, handle::KV, NodeType> {
621624
/// Gets a reference to the value the stack points to.
622625
pub fn peek(&self) -> &V {
623626
unsafe { self.top.from_raw().into_kv().1 }
@@ -640,7 +643,7 @@ mod stack {
640643
}
641644
}
642645

643-
impl<'a, K, V> SearchStack<'a, K, V, KV, Leaf> {
646+
impl<'a, K, V> SearchStack<'a, K, V, handle::KV, handle::Leaf> {
644647
/// Removes the key and value in the top element of the stack, then handles underflows as
645648
/// described in BTree's pop function.
646649
fn remove_leaf(mut self) -> V {
@@ -686,7 +689,7 @@ mod stack {
686689
}
687690
}
688691

689-
impl<'a, K, V> SearchStack<'a, K, V, KV, LeafOrInternal> {
692+
impl<'a, K, V> SearchStack<'a, K, V, handle::KV, handle::LeafOrInternal> {
690693
/// Removes the key and value in the top element of the stack, then handles underflows as
691694
/// described in BTree's pop function.
692695
pub fn remove(self) -> V {
@@ -703,7 +706,7 @@ mod stack {
703706
/// leaves the tree in an inconsistent state that must be repaired by the caller by
704707
/// removing the entry in question. Specifically the key-value pair and its successor will
705708
/// become swapped.
706-
fn into_leaf(mut self) -> SearchStack<'a, K, V, KV, Leaf> {
709+
fn into_leaf(mut self) -> SearchStack<'a, K, V, handle::KV, handle::Leaf> {
707710
unsafe {
708711
let mut top_raw = self.top;
709712
let mut top = top_raw.from_raw_mut();
@@ -757,7 +760,7 @@ mod stack {
757760
}
758761
}
759762

760-
impl<'a, K, V> SearchStack<'a, K, V, Edge, Leaf> {
763+
impl<'a, K, V> SearchStack<'a, K, V, handle::Edge, handle::Leaf> {
761764
/// Inserts the key and value into the top element in the stack, and if that node has to
762765
/// split recursively inserts the split contents into the next element stack until
763766
/// splits stop.
@@ -1332,7 +1335,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
13321335

13331336
#[cfg(test)]
13341337
mod test {
1335-
use std::prelude::*;
1338+
use prelude::*;
13361339

13371340
use super::{BTreeMap, Occupied, Vacant};
13381341

@@ -1534,7 +1537,7 @@ mod test {
15341537

15351538
#[cfg(test)]
15361539
mod bench {
1537-
use std::prelude::*;
1540+
use prelude::*;
15381541
use std::rand::{weak_rng, Rng};
15391542
use test::{Bencher, black_box};
15401543

0 commit comments

Comments
 (0)