Skip to content

Commit 1137aac

Browse files
committed
---
yaml --- r: 159806 b: refs/heads/try c: 04dd61d h: refs/heads/master v: v3
1 parent bacaf8d commit 1137aac

File tree

265 files changed

+7277
-9513
lines changed

Some content is hidden

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

265 files changed

+7277
-9513
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e09d98603e608c9e47d4c89f7b4dca87a4b56da3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
5-
refs/heads/try: 73aaeb0fbdb14290b68288324e678068d2cfa6be
5+
refs/heads/try: 04dd61d1ecb0675cb0f9cd548ef3870e1e071822
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/main.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,12 @@ endif
148148
# libraries, so in the interest of space, prefer dynamic linking throughout the
149149
# compilation process.
150150
#
151-
# Note though that these flags are omitted for the *bins* in stage2+. This means
152-
# that the snapshot will be generated with a statically linked rustc so we only
153-
# have to worry about the distribution of one file (with its native dynamic
151+
# Note though that these flags are omitted for stage2+. This means that the
152+
# snapshot will be generated with a statically linked rustc so we only have to
153+
# worry about the distribution of one file (with its native dynamic
154154
# dependencies)
155155
RUSTFLAGS_STAGE0 += -C prefer-dynamic
156156
RUSTFLAGS_STAGE1 += -C prefer-dynamic
157-
RUST_LIB_FLAGS_ST2 += -C prefer-dynamic
158157

159158
# Landing pads require a lot of codegen. We can get through bootstrapping faster
160159
# by not emitting them.

branches/try/mk/target.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export CFG_COMPILER_HOST_TRIPLE
1717
# code, make sure that these common warnings are denied by default. These can
1818
# be overridden during development temporarily. For stage0, we allow warnings
1919
# which may be bugs in stage0 (should be fixed in stage1+)
20-
RUST_LIB_FLAGS_ST0 += -W warnings
21-
RUST_LIB_FLAGS_ST1 += -D warnings
22-
RUST_LIB_FLAGS_ST2 += -D warnings
20+
WFLAGS_ST0 = -W warnings
21+
WFLAGS_ST1 = -D warnings
22+
WFLAGS_ST2 = -D warnings
2323

2424
# Macro that generates the full list of dependencies for a crate at a particular
2525
# stage/target/host tuple.
@@ -80,7 +80,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8080
$$(call REMOVE_ALL_OLD_GLOB_MATCHES, \
8181
$$(dir $$@)$$(call CFG_RLIB_GLOB,$(4)))
8282
$$(STAGE$(1)_T_$(2)_H_$(3)) \
83-
$$(RUST_LIB_FLAGS_ST$(1)) \
83+
$$(WFLAGS_ST$(1)) \
8484
-L "$$(RT_OUTPUT_DIR_$(2))" \
8585
-L "$$(LLVM_LIBDIR_$(2))" \
8686
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
444444
//waiting 1 second for gdbserver start
445445
timer::sleep(Duration::milliseconds(1000));
446446
let result = task::try(proc() {
447-
tcp::TcpStream::connect("127.0.0.1:5039").unwrap();
447+
tcp::TcpStream::connect("127.0.0.1", 5039).unwrap();
448448
});
449449
if result.is_err() {
450450
continue;

branches/try/src/doc/guide.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4601,24 +4601,20 @@ returns `true` or `false`. The new iterator `filter()` produces
46014601
only the elements that that closure returns `true` for:
46024602

46034603
```{rust}
4604-
for i in range(1i, 100i).filter(|&x| x % 2 == 0) {
4604+
for i in range(1i, 100i).filter(|x| x % 2 == 0) {
46054605
println!("{}", i);
46064606
}
46074607
```
46084608

46094609
This will print all of the even numbers between one and a hundred.
4610-
(Note that because `filter` doesn't consume the elements that are
4611-
being iterated over, it is passed a reference to each element, and
4612-
thus the filter predicate uses the `&x` pattern to extract the integer
4613-
itself.)
46144610

46154611
You can chain all three things together: start with an iterator, adapt it
46164612
a few times, and then consume the result. Check it out:
46174613

46184614
```{rust}
46194615
range(1i, 1000i)
4620-
.filter(|&x| x % 2 == 0)
4621-
.filter(|&x| x % 3 == 0)
4616+
.filter(|x| x % 2 == 0)
4617+
.filter(|x| x % 3 == 0)
46224618
.take(5)
46234619
.collect::<Vec<int>>();
46244620
```

branches/try/src/doc/reference.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,10 +1961,8 @@ On an `extern` block, the following attributes are interpreted:
19611961
name and type. This is feature gated and the exact behavior is
19621962
implementation-defined (due to variety of linker invocation syntax).
19631963
- `link` - indicate that a native library should be linked to for the
1964-
declarations in this block to be linked correctly. `link` supports an optional `kind`
1965-
key with three possible values: `dylib`, `static`, and `framework`. See [external blocks](#external-blocks) for more about external blocks. Two
1966-
examples: `#[link(name = "readline")]` and
1967-
`#[link(name = "CoreFoundation", kind = "framework")]`.
1964+
declarations in this block to be linked correctly. See [external
1965+
blocks](#external-blocks)
19681966

19691967
On declarations inside an `extern` block, the following attributes are
19701968
interpreted:

branches/try/src/etc/unicode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def load_east_asian_width(want_widths, except_cats):
283283
return widths
284284

285285
def escape_char(c):
286-
if c <= 0x7f:
286+
if c <= 0xff:
287287
return "'\\x%2.2x'" % c
288288
if c <= 0xffff:
289289
return "'\\u%4.4x'" % c
@@ -293,7 +293,7 @@ def emit_bsearch_range_table(f):
293293
f.write("""
294294
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
295295
use core::cmp::{Equal, Less, Greater};
296-
use core::slice::SlicePrelude;
296+
use core::slice::ImmutableSlice;
297297
r.binary_search(|&(lo,hi)| {
298298
if lo <= c && c <= hi { Equal }
299299
else if hi < c { Less }
@@ -351,7 +351,7 @@ def emit_conversions_module(f, lowerupper, upperlower):
351351
f.write("pub mod conversions {")
352352
f.write("""
353353
use core::cmp::{Equal, Less, Greater};
354-
use core::slice::SlicePrelude;
354+
use core::slice::ImmutableSlice;
355355
use core::tuple::Tuple2;
356356
use core::option::{Option, Some, None};
357357
use core::slice;
@@ -390,7 +390,7 @@ def emit_conversions_module(f, lowerupper, upperlower):
390390

391391
def emit_grapheme_module(f, grapheme_table, grapheme_cats):
392392
f.write("""pub mod grapheme {
393-
use core::slice::SlicePrelude;
393+
use core::slice::ImmutableSlice;
394394
use core::slice;
395395
396396
#[allow(non_camel_case_types)]
@@ -430,7 +430,7 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
430430
def emit_charwidth_module(f, width_table):
431431
f.write("pub mod charwidth {\n")
432432
f.write(" use core::option::{Option, Some, None};\n")
433-
f.write(" use core::slice::SlicePrelude;\n")
433+
f.write(" use core::slice::ImmutableSlice;\n")
434434
f.write(" use core::slice;\n")
435435
f.write("""
436436
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
@@ -530,7 +530,7 @@ def comp_pfun(char):
530530
f.write("""
531531
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
532532
use core::cmp::{Equal, Less, Greater};
533-
use core::slice::SlicePrelude;
533+
use core::slice::ImmutableSlice;
534534
use core::slice;
535535
match r.binary_search(|&(lo, hi, _)| {
536536
if lo <= c && c <= hi { Equal }

branches/try/src/liballoc/boxed.rs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,12 @@ impl<T: Clone> Clone for Box<T> {
6161
}
6262
}
6363

64-
// NOTE(stage0): remove impl after a snapshot
65-
#[cfg(stage0)]
6664
impl<T:PartialEq> PartialEq for Box<T> {
6765
#[inline]
6866
fn eq(&self, other: &Box<T>) -> bool { *(*self) == *(*other) }
6967
#[inline]
7068
fn ne(&self, other: &Box<T>) -> bool { *(*self) != *(*other) }
7169
}
72-
// NOTE(stage0): remove impl after a snapshot
73-
#[cfg(stage0)]
7470
impl<T:PartialOrd> PartialOrd for Box<T> {
7571
#[inline]
7672
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
@@ -85,50 +81,14 @@ impl<T:PartialOrd> PartialOrd for Box<T> {
8581
#[inline]
8682
fn gt(&self, other: &Box<T>) -> bool { *(*self) > *(*other) }
8783
}
88-
// NOTE(stage0): remove impl after a snapshot
89-
#[cfg(stage0)]
9084
impl<T: Ord> Ord for Box<T> {
9185
#[inline]
9286
fn cmp(&self, other: &Box<T>) -> Ordering {
9387
(**self).cmp(&**other)
9488
}
9589
}
96-
// NOTE(stage0): remove impl after a snapshot
97-
#[cfg(stage0)]
9890
impl<T: Eq> Eq for Box<T> {}
9991

100-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
101-
impl<Sized? T: PartialEq> PartialEq for Box<T> {
102-
#[inline]
103-
fn eq(&self, other: &Box<T>) -> bool { PartialEq::eq(&**self, &**other) }
104-
#[inline]
105-
fn ne(&self, other: &Box<T>) -> bool { PartialEq::ne(&**self, &**other) }
106-
}
107-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
108-
impl<Sized? T: PartialOrd> PartialOrd for Box<T> {
109-
#[inline]
110-
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
111-
PartialOrd::partial_cmp(&**self, &**other)
112-
}
113-
#[inline]
114-
fn lt(&self, other: &Box<T>) -> bool { PartialOrd::lt(&**self, &**other) }
115-
#[inline]
116-
fn le(&self, other: &Box<T>) -> bool { PartialOrd::le(&**self, &**other) }
117-
#[inline]
118-
fn ge(&self, other: &Box<T>) -> bool { PartialOrd::ge(&**self, &**other) }
119-
#[inline]
120-
fn gt(&self, other: &Box<T>) -> bool { PartialOrd::gt(&**self, &**other) }
121-
}
122-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
123-
impl<Sized? T: Ord> Ord for Box<T> {
124-
#[inline]
125-
fn cmp(&self, other: &Box<T>) -> Ordering {
126-
Ord::cmp(&**self, &**other)
127-
}
128-
}
129-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
130-
impl<Sized? T: Eq> Eq for Box<T> {}
131-
13292
/// Extension methods for an owning `Any` trait object.
13393
#[unstable = "post-DST and coherence changes, this will not be a trait but \
13494
rather a direct `impl` on `Box<Any>`"]

branches/try/src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl Drop for Arena {
132132

133133
#[inline]
134134
fn round_up(base: uint, align: uint) -> uint {
135-
(base.checked_add(&(align - 1))).unwrap() & !(align - 1)
135+
(base.checked_add(&(align - 1))).unwrap() & !(&(align - 1))
136136
}
137137

138138
// Walk down a chunk, running the destructors for any objects stored

branches/try/src/libcollections/binary_heap.rs

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ use core::ptr;
162162
use slice;
163163
use vec::Vec;
164164

165-
// FIXME(conventions): implement into_iter
166-
167165
/// A priority queue implemented with a binary heap.
168166
///
169167
/// This will be a max-heap.
@@ -186,7 +184,6 @@ impl<T: Ord> BinaryHeap<T> {
186184
/// use std::collections::BinaryHeap;
187185
/// let pq: BinaryHeap<uint> = BinaryHeap::new();
188186
/// ```
189-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
190187
pub fn new() -> BinaryHeap<T> { BinaryHeap{data: vec!(),} }
191188

192189
/// Creates an empty `BinaryHeap` with a specific capacity.
@@ -200,7 +197,6 @@ impl<T: Ord> BinaryHeap<T> {
200197
/// use std::collections::BinaryHeap;
201198
/// let pq: BinaryHeap<uint> = BinaryHeap::with_capacity(10u);
202199
/// ```
203-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
204200
pub fn with_capacity(capacity: uint) -> BinaryHeap<T> {
205201
BinaryHeap { data: Vec::with_capacity(capacity) }
206202
}
@@ -238,7 +234,6 @@ impl<T: Ord> BinaryHeap<T> {
238234
/// println!("{}", x);
239235
/// }
240236
/// ```
241-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
242237
pub fn iter<'a>(&'a self) -> Items<'a, T> {
243238
Items { iter: self.data.iter() }
244239
}
@@ -273,19 +268,10 @@ impl<T: Ord> BinaryHeap<T> {
273268
/// let pq: BinaryHeap<uint> = BinaryHeap::with_capacity(100u);
274269
/// assert!(pq.capacity() >= 100u);
275270
/// ```
276-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
277271
pub fn capacity(&self) -> uint { self.data.capacity() }
278272

279-
/// Reserves the minimum capacity for exactly `additional` more elements to be inserted in the
280-
/// given `BinaryHeap`. Does nothing if the capacity is already sufficient.
281-
///
282-
/// Note that the allocator may give the collection more space than it requests. Therefore
283-
/// capacity can not be relied upon to be precisely minimal. Prefer `reserve` if future
284-
/// insertions are expected.
285-
///
286-
/// # Panics
287-
///
288-
/// Panics if the new capacity overflows `uint`.
273+
/// Reserves capacity for exactly `n` elements in the `BinaryHeap`.
274+
/// Do nothing if the capacity is already sufficient.
289275
///
290276
/// # Example
291277
///
@@ -294,17 +280,12 @@ impl<T: Ord> BinaryHeap<T> {
294280
///
295281
/// let mut pq: BinaryHeap<uint> = BinaryHeap::new();
296282
/// pq.reserve_exact(100u);
297-
/// assert!(pq.capacity() >= 100u);
283+
/// assert!(pq.capacity() == 100u);
298284
/// ```
299-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
300-
pub fn reserve_exact(&mut self, additional: uint) { self.data.reserve_exact(additional) }
285+
pub fn reserve_exact(&mut self, n: uint) { self.data.reserve_exact(n) }
301286

302-
/// Reserves capacity for at least `additional` more elements to be inserted in the
303-
/// `BinaryHeap`. The collection may reserve more space to avoid frequent reallocations.
304-
///
305-
/// # Panics
306-
///
307-
/// Panics if the new capacity overflows `uint`.
287+
/// Reserves capacity for at least `n` elements in the `BinaryHeap`.
288+
/// Do nothing if the capacity is already sufficient.
308289
///
309290
/// # Example
310291
///
@@ -315,15 +296,8 @@ impl<T: Ord> BinaryHeap<T> {
315296
/// pq.reserve(100u);
316297
/// assert!(pq.capacity() >= 100u);
317298
/// ```
318-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
319-
pub fn reserve(&mut self, additional: uint) {
320-
self.data.reserve(additional)
321-
}
322-
323-
/// Discards as much additional capacity as possible.
324-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
325-
pub fn shrink_to_fit(&mut self) {
326-
self.data.shrink_to_fit()
299+
pub fn reserve(&mut self, n: uint) {
300+
self.data.reserve(n)
327301
}
328302

329303
/// Removes the greatest item from a queue and returns it, or `None` if it
@@ -340,7 +314,6 @@ impl<T: Ord> BinaryHeap<T> {
340314
/// assert_eq!(pq.pop(), Some(1i));
341315
/// assert_eq!(pq.pop(), None);
342316
/// ```
343-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
344317
pub fn pop(&mut self) -> Option<T> {
345318
match self.data.pop() {
346319
None => { None }
@@ -369,7 +342,6 @@ impl<T: Ord> BinaryHeap<T> {
369342
/// assert_eq!(pq.len(), 3);
370343
/// assert_eq!(pq.top(), Some(&5i));
371344
/// ```
372-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
373345
pub fn push(&mut self, item: T) {
374346
self.data.push(item);
375347
let new_len = self.len() - 1;
@@ -523,15 +495,12 @@ impl<T: Ord> BinaryHeap<T> {
523495
}
524496

525497
/// Returns the length of the queue.
526-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
527498
pub fn len(&self) -> uint { self.data.len() }
528499

529500
/// Returns true if the queue contains no elements
530-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
531501
pub fn is_empty(&self) -> bool { self.len() == 0 }
532502

533503
/// Drops all items from the queue.
534-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
535504
pub fn clear(&mut self) { self.data.truncate(0) }
536505
}
537506

@@ -559,7 +528,8 @@ impl<T: Ord> Extendable<T> for BinaryHeap<T> {
559528
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
560529
let (lower, _) = iter.size_hint();
561530

562-
self.reserve(lower);
531+
let len = self.capacity();
532+
self.reserve(len + lower);
563533

564534
for elem in iter {
565535
self.push(elem);

0 commit comments

Comments
 (0)