Skip to content

Commit 8e46185

Browse files
committed
---
yaml --- r: 158647 b: refs/heads/master c: f2aaed8 h: refs/heads/master i: 158645: 444a508 158643: 7297632 158639: 75063f5 v: v3
1 parent 9c3b1a1 commit 8e46185

File tree

242 files changed

+2991
-4068
lines changed

Some content is hidden

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

242 files changed

+2991
-4068
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: 932eec7d702cf2cf55554e2431c3cb0fecd19014
2+
refs/heads/master: f2aaed8338d80afccd2159d9c819d8d0f300cb55
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 1b2ad7831f1745bf4a4709a1fa1772afb47c933c
55
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2

trunk/mk/crates.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
TARGET_CRATES := libc std green native flate arena term \
5353
serialize sync getopts collections test time rand \
54-
log regex graphviz core rbml alloc rustrt \
54+
log regex graphviz core rbml rlibc alloc rustrt \
5555
unicode
5656
HOST_CRATES := syntax rustc rustdoc regex_macros fmt_macros \
5757
rustc_llvm rustc_back
@@ -60,6 +60,7 @@ TOOLS := compiletest rustdoc rustc
6060

6161
DEPS_core :=
6262
DEPS_libc := core
63+
DEPS_rlibc := core
6364
DEPS_unicode := core
6465
DEPS_alloc := core libc native:jemalloc
6566
DEPS_rustrt := alloc core libc collections native:rustrt_native
@@ -103,6 +104,7 @@ TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
103104

104105
ONLY_RLIB_core := 1
105106
ONLY_RLIB_libc := 1
107+
ONLY_RLIB_rlibc := 1
106108
ONLY_RLIB_alloc := 1
107109
ONLY_RLIB_rand := 1
108110
ONLY_RLIB_collections := 1

trunk/mk/main.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ endif
155155
RUSTFLAGS_STAGE0 += -C prefer-dynamic
156156
RUSTFLAGS_STAGE1 += -C prefer-dynamic
157157
RUST_LIB_FLAGS_ST2 += -C prefer-dynamic
158-
RUST_LIB_FLAGS_ST3 += -C prefer-dynamic
159158

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

trunk/mk/tests.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,7 @@ CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
677677
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
678678
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
679679
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
680-
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
681-
$(S)src/etc/lldb_batchmode.py \
682-
$(S)src/etc/lldb_rust_formatters.py
680+
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS)
683681
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
684682

685683
endef

trunk/src/doc/guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ enum StringResult {
11491149
}
11501150
```
11511151
Where a `StringResult` is either an `StringOK`, with the result of a computation, or an
1152-
`ErrorReason` with a `String` explaining what caused the computation to fail. These kinds of
1152+
`ErrorReason` with a `String` explaining what caused the computation to fail. This kind of
11531153
`enum`s are actually very useful and are even part of the standard library.
11541154

11551155
As you can see `enum`s with values are quite a powerful tool for data representation,
@@ -1901,8 +1901,8 @@ result is a link to
19011901
click on that result, we'll be taken to its documentation page.
19021902

19031903
This page shows us a few things: the type signature of the function, some
1904-
explanatory text, and then an example. Let's try to modify our code to add in the
1905-
`random` function and see what happens:
1904+
explanatory text, and then an example. Let's modify our code to add in the
1905+
`random` function:
19061906

19071907
```{rust,ignore}
19081908
use std::io;

trunk/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:

trunk/src/etc/lldb_batchmode.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
import os
2929
import sys
3030
import threading
31-
import thread
3231
import re
3332
import atexit
34-
import time
3533

3634
# Set this to True for additional output
3735
DEBUG_OUTPUT = False
@@ -132,22 +130,6 @@ def listen():
132130
target.GetBroadcaster().AddListener(listener, lldb.SBTarget.eBroadcastBitBreakpointChanged)
133131

134132

135-
def start_watchdog():
136-
"Starts a watchdog thread that will terminate the process after a certain period of time"
137-
watchdog_start_time = time.clock()
138-
watchdog_max_time = watchdog_start_time + 30
139-
140-
def watchdog():
141-
while time.clock() < watchdog_max_time:
142-
time.sleep(1)
143-
print("TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!")
144-
thread.interrupt_main()
145-
146-
# Start the listener and let it run as a daemon
147-
watchdog_thread = threading.Thread(target = watchdog)
148-
watchdog_thread.daemon = True
149-
watchdog_thread.start()
150-
151133
####################################################################################################
152134
# ~main
153135
####################################################################################################
@@ -165,9 +147,6 @@ def watchdog():
165147
print("Target executable is '%s'." % target_path)
166148
print("Current working directory is '%s'" % os.getcwd())
167149

168-
# Start the timeout watchdog
169-
start_watchdog()
170-
171150
# Create a new debugger instance
172151
debugger = lldb.SBDebugger.Create()
173152

@@ -196,10 +175,6 @@ def watchdog():
196175

197176
for line in script_file:
198177
command = line.strip()
199-
if command == "run" or command == "r" or re.match("^process\s+launch.*", command):
200-
# Before starting to run the program, let the thread sleep a bit, so all
201-
# breakpoint added events can be processed
202-
time.sleep(0.5)
203178
if command != '':
204179
execute_command(command_interpreter, command)
205180

trunk/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_upper_case_globals, non_snake_case)]
37+
#![allow(missing_docs, non_uppercase_statics, 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::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 }

trunk/src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
166166
// additional reference of either kind.
167167
if self.inner().strong.load(atomic::SeqCst) != 1 ||
168168
self.inner().weak.load(atomic::SeqCst) != 1 {
169-
*self = Arc::new(self.deref().clone())
169+
*self = Arc::new((**self).clone())
170170
}
171171
// This unsafety is ok because we're guaranteed that the pointer
172172
// returned is the *only* pointer that will ever be returned to T. Our

trunk/src/liballoc/boxed.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ impl<T: Default> Default for Box<T> {
4848
fn default() -> Box<T> { box Default::default() }
4949
}
5050

51-
impl<T> Default for Box<[T]> {
52-
fn default() -> Box<[T]> { box [] }
53-
}
54-
5551
#[unstable]
5652
impl<T: Clone> Clone for Box<T> {
5753
/// Returns a copy of the owned box.

trunk/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)