Skip to content

Commit f568c2a

Browse files
committed
---
yaml --- r: 158431 b: refs/heads/auto c: 29b2b58 h: refs/heads/master i: 158429: f13d226 158427: 96aa806 158423: 4db4791 158415: e0e292e 158399: 0dd6a38 v: v3
1 parent b1bc0f4 commit f568c2a

File tree

270 files changed

+6185
-3333
lines changed

Some content is hidden

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

270 files changed

+6185
-3333
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: e4794250c89e2594f12c0d0d1ae25c9ff5b10803
13+
refs/heads/auto: 29b2b58315991cdf09761668535e0c706b9d89e4
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/src/doc/guide.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4601,20 +4601,24 @@ 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.)
46104614

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

46144618
```{rust}
46154619
range(1i, 1000i)
4616-
.filter(|x| x % 2 == 0)
4617-
.filter(|x| x % 3 == 0)
4620+
.filter(|&x| x % 2 == 0)
4621+
.filter(|&x| x % 3 == 0)
46184622
.take(5)
46194623
.collect::<Vec<int>>();
46204624
```

branches/auto/src/doc/reference.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,8 +1961,10 @@ 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. See [external
1965-
blocks](#external-blocks)
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")]`.
19661968

19671969
On declarations inside an `extern` block, the following attributes are
19681970
interpreted:

branches/auto/src/etc/unicode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
3535
// NOTE: The following code was generated by "src/etc/unicode.py", do not edit directly
3636
37-
#![allow(missing_docs, non_uppercase_statics, non_snake_case)]
37+
#![allow(missing_docs, non_upper_case_globals, non_snake_case)]
3838
'''
3939

4040
# Mapping taken from Table 12 from:
@@ -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::ImmutableSlice;
296+
use core::slice::SlicePrelude;
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::ImmutableSlice;
354+
use core::slice::SlicePrelude;
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::ImmutableSlice;
393+
use core::slice::SlicePrelude;
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::ImmutableSlice;\n")
433+
f.write(" use core::slice::SlicePrelude;\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::ImmutableSlice;
533+
use core::slice::SlicePrelude;
534534
use core::slice;
535535
match r.binary_search(|&(lo, hi, _)| {
536536
if lo <= c && c <= hi { Equal }

branches/auto/src/liballoc/boxed.rs

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

64+
// NOTE(stage0): remove impl after a snapshot
65+
#[cfg(stage0)]
6466
impl<T:PartialEq> PartialEq for Box<T> {
6567
#[inline]
6668
fn eq(&self, other: &Box<T>) -> bool { *(*self) == *(*other) }
6769
#[inline]
6870
fn ne(&self, other: &Box<T>) -> bool { *(*self) != *(*other) }
6971
}
72+
// NOTE(stage0): remove impl after a snapshot
73+
#[cfg(stage0)]
7074
impl<T:PartialOrd> PartialOrd for Box<T> {
7175
#[inline]
7276
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
@@ -81,14 +85,50 @@ impl<T:PartialOrd> PartialOrd for Box<T> {
8185
#[inline]
8286
fn gt(&self, other: &Box<T>) -> bool { *(*self) > *(*other) }
8387
}
88+
// NOTE(stage0): remove impl after a snapshot
89+
#[cfg(stage0)]
8490
impl<T: Ord> Ord for Box<T> {
8591
#[inline]
8692
fn cmp(&self, other: &Box<T>) -> Ordering {
8793
(**self).cmp(&**other)
8894
}
8995
}
96+
// NOTE(stage0): remove impl after a snapshot
97+
#[cfg(stage0)]
9098
impl<T: Eq> Eq for Box<T> {}
9199

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+
92132
/// Extension methods for an owning `Any` trait object.
93133
#[unstable = "post-DST and coherence changes, this will not be a trait but \
94134
rather a direct `impl` on `Box<Any>`"]

branches/auto/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/auto/src/libcollections/binary_heap.rs

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

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

189192
/// Creates an empty `BinaryHeap` with a specific capacity.
@@ -197,6 +200,7 @@ impl<T: Ord> BinaryHeap<T> {
197200
/// use std::collections::BinaryHeap;
198201
/// let pq: BinaryHeap<uint> = BinaryHeap::with_capacity(10u);
199202
/// ```
203+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
200204
pub fn with_capacity(capacity: uint) -> BinaryHeap<T> {
201205
BinaryHeap { data: Vec::with_capacity(capacity) }
202206
}
@@ -234,6 +238,7 @@ impl<T: Ord> BinaryHeap<T> {
234238
/// println!("{}", x);
235239
/// }
236240
/// ```
241+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
237242
pub fn iter<'a>(&'a self) -> Items<'a, T> {
238243
Items { iter: self.data.iter() }
239244
}
@@ -268,10 +273,19 @@ impl<T: Ord> BinaryHeap<T> {
268273
/// let pq: BinaryHeap<uint> = BinaryHeap::with_capacity(100u);
269274
/// assert!(pq.capacity() >= 100u);
270275
/// ```
276+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
271277
pub fn capacity(&self) -> uint { self.data.capacity() }
272278

273-
/// Reserves capacity for exactly `n` elements in the `BinaryHeap`.
274-
/// Do nothing if the capacity is already sufficient.
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`.
275289
///
276290
/// # Example
277291
///
@@ -280,12 +294,17 @@ impl<T: Ord> BinaryHeap<T> {
280294
///
281295
/// let mut pq: BinaryHeap<uint> = BinaryHeap::new();
282296
/// pq.reserve_exact(100u);
283-
/// assert!(pq.capacity() == 100u);
297+
/// assert!(pq.capacity() >= 100u);
284298
/// ```
285-
pub fn reserve_exact(&mut self, n: uint) { self.data.reserve_exact(n) }
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) }
286301

287-
/// Reserves capacity for at least `n` elements in the `BinaryHeap`.
288-
/// Do nothing if the capacity is already sufficient.
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`.
289308
///
290309
/// # Example
291310
///
@@ -296,8 +315,15 @@ impl<T: Ord> BinaryHeap<T> {
296315
/// pq.reserve(100u);
297316
/// assert!(pq.capacity() >= 100u);
298317
/// ```
299-
pub fn reserve(&mut self, n: uint) {
300-
self.data.reserve(n)
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()
301327
}
302328

303329
/// Removes the greatest item from a queue and returns it, or `None` if it
@@ -314,6 +340,7 @@ impl<T: Ord> BinaryHeap<T> {
314340
/// assert_eq!(pq.pop(), Some(1i));
315341
/// assert_eq!(pq.pop(), None);
316342
/// ```
343+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
317344
pub fn pop(&mut self) -> Option<T> {
318345
match self.data.pop() {
319346
None => { None }
@@ -342,6 +369,7 @@ impl<T: Ord> BinaryHeap<T> {
342369
/// assert_eq!(pq.len(), 3);
343370
/// assert_eq!(pq.top(), Some(&5i));
344371
/// ```
372+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
345373
pub fn push(&mut self, item: T) {
346374
self.data.push(item);
347375
let new_len = self.len() - 1;
@@ -495,12 +523,15 @@ impl<T: Ord> BinaryHeap<T> {
495523
}
496524

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

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

503533
/// Drops all items from the queue.
534+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
504535
pub fn clear(&mut self) { self.data.truncate(0) }
505536
}
506537

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

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

534564
for elem in iter {
535565
self.push(elem);

0 commit comments

Comments
 (0)