Skip to content

Commit f905545

Browse files
committed
---
yaml --- r: 165630 b: refs/heads/auto c: 1bdcfd6 h: refs/heads/master v: v3
1 parent 2023cbb commit f905545

File tree

126 files changed

+2294
-1097
lines changed

Some content is hidden

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

126 files changed

+2294
-1097
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: a71686f4ea1a265f15adfbe850305f65453ef550
13+
refs/heads/auto: 1bdcfd64629930c09b942025e242e51e784c447d
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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.

branches/auto/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
######################################################################

branches/auto/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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,

branches/auto/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

branches/auto/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;

branches/auto/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
}

branches/auto/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

branches/auto/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)