Skip to content

Commit 6610045

Browse files
committed
---
yaml --- r: 169695 b: refs/heads/master c: 373cbab h: refs/heads/master i: 169693: f808612 169691: d647007 169687: fd58385 169679: 84e0906 169663: 94b3d4a v: v3
1 parent 579b1de commit 6610045

File tree

384 files changed

+5077
-4514
lines changed

Some content is hidden

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

384 files changed

+5077
-4514
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: ae4bcd41e8014b6057fe0a328c87f32f917396ba
2+
refs/heads/master: 373cbab5b08d6630da58f28d2166c19afc327fa6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
55
refs/heads/try: 5204084bd2e46af7cc6e0147430e44dd0d657bbb

trunk/configure

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,18 @@ then
599599
fi
600600
putvar CFG_RELEASE_CHANNEL
601601

602+
# A magic value that allows the compiler to use unstable features
603+
# during the bootstrap even when doing so would normally be an error
604+
# because of feature staging or because the build turns on
605+
# warnings-as-errors and unstable features default to warnings. The
606+
# build has to match this key in an env var. Meant to be a mild
607+
# deterrent from users just turning on unstable features on the stable
608+
# channel.
609+
# Basing CFG_BOOTSTRAP_KEY on CFG_BOOTSTRAP_KEY lets it get picked up
610+
# during a Makefile reconfig.
611+
CFG_BOOTSTRAP_KEY="${CFG_BOOTSTRAP_KEY-`date +%N`}"
612+
putvar CFG_BOOTSTRAP_KEY
613+
602614
step_msg "looking for build programs"
603615

604616
probe_need CFG_PERL perl

trunk/mk/main.mk

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ ifeq ($(CFG_RELEASE_CHANNEL),stable)
2525
CFG_RELEASE=$(CFG_RELEASE_NUM)
2626
# This is the string used in dist artifact file names, e.g. "0.12.0", "nightly"
2727
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
28+
CFG_DISABLE_UNSTABLE_FEATURES=1
2829
endif
2930
ifeq ($(CFG_RELEASE_CHANNEL),beta)
3031
# The beta channel is temporarily called 'alpha'
3132
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
3233
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
34+
CFG_DISABLE_UNSTABLE_FEATURES=1
3335
endif
3436
ifeq ($(CFG_RELEASE_CHANNEL),nightly)
3537
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
@@ -121,11 +123,9 @@ CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)
121123

122124
ifdef CFG_DISABLE_DEBUG
123125
CFG_RUSTC_FLAGS += --cfg ndebug
124-
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
125126
else
126127
$(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
127128
CFG_RUSTC_FLAGS += --cfg debug
128-
CFG_GCCISH_CFLAGS += -DRUST_DEBUG
129129
endif
130130

131131
ifdef SAVE_TEMPS
@@ -319,11 +319,20 @@ export CFG_VERSION_WIN
319319
export CFG_RELEASE
320320
export CFG_PACKAGE_NAME
321321
export CFG_BUILD
322+
export CFG_RELEASE_CHANNEL
322323
export CFG_LLVM_ROOT
323324
export CFG_PREFIX
324325
export CFG_LIBDIR
325326
export CFG_LIBDIR_RELATIVE
326327
export CFG_DISABLE_INJECT_STD_VERSION
328+
ifdef CFG_DISABLE_UNSTABLE_FEATURES
329+
CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES))
330+
# Turn on feature-staging
331+
export CFG_DISABLE_UNSTABLE_FEATURES
332+
endif
333+
# Subvert unstable feature lints to do the self-build
334+
export CFG_BOOTSTRAP_KEY
335+
export RUSTC_BOOTSTRAP_KEY:=$(CFG_BOOTSTRAP_KEY)
327336

328337
######################################################################
329338
# Per-stage targets and runner

trunk/src/compiletest/runtest.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,7 @@ fn check_error_patterns(props: &TestProps,
908908
}
909909
if done { return; }
910910

911-
let missing_patterns =
912-
props.error_patterns.index(&(next_err_idx..));
911+
let missing_patterns = &props.error_patterns[next_err_idx..];
913912
if missing_patterns.len() == 1u {
914913
fatal_proc_rec(format!("error pattern '{}' not found!",
915914
missing_patterns[0]).as_slice(),

trunk/src/doc/footer.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer><p>
2-
Copyright &copy; 2011-2014 The Rust Project Developers. Licensed under the
2+
Copyright &copy; 2011-2015 The Rust Project Developers. Licensed under the
33
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
44
or the <a href="http://opensource.org/licenses/MIT">MIT license</a>, at your option.
55
</p><p>

trunk/src/doc/guide-ownership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ lifetime, and so if you elide a lifetime (like `&T` instead of `&'a T`), Rust
458458
will do three things to determine what those lifetimes should be.
459459

460460
When talking about lifetime elision, we use the term 'input lifetime' and
461-
'output lifetime'. An 'input liftime' is a lifetime associated with a parameter
461+
'output lifetime'. An 'input lifetime' is a lifetime associated with a parameter
462462
of a function, and an 'output lifetime' is a lifetime associated with the return
463463
value of a function. For example, this function has an input lifetime:
464464

trunk/src/doc/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ use std::thread::Thread;
542542
fn main() {
543543
let vec = vec![1i, 2, 3];
544544
545-
for i in range(1u, 3) {
545+
for i in range(0u, 3) {
546546
Thread::spawn(move || {
547547
println!("{}", vec[i]);
548548
}).detach();
@@ -558,7 +558,7 @@ a vector:
558558
```{rust}
559559
let vec = vec![1i, 2, 3];
560560
561-
for i in range(1u, vec.len()) {
561+
for i in range(0u, vec.len()) {
562562
println!("{}", vec[i]);
563563
}
564564
```

trunk/src/liballoc/arc.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,20 @@
6767
//! }
6868
//! ```
6969
70+
use core::prelude::*;
71+
7072
use core::atomic;
7173
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
7274
use core::borrow::BorrowFrom;
73-
use core::clone::Clone;
7475
use core::fmt::{self, Show};
75-
use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering};
76+
use core::cmp::{Ordering};
7677
use core::default::Default;
77-
use core::marker::{Sync, Send};
78-
use core::mem::{min_align_of, size_of, drop};
78+
use core::mem::{min_align_of, size_of};
7979
use core::mem;
8080
use core::nonzero::NonZero;
81-
use core::ops::{Drop, Deref};
82-
use core::option::Option;
83-
use core::option::Option::{Some, None};
84-
use core::ptr::{self, PtrExt};
81+
use core::ops::Deref;
82+
use core::ptr;
83+
use core::hash::{Hash, Hasher};
8584
use heap::deallocate;
8685

8786
/// An atomically reference counted wrapper for shared state.
@@ -585,12 +584,25 @@ impl<T: fmt::Show> fmt::Show for Arc<T> {
585584
}
586585
}
587586

587+
#[stable]
588+
impl<T: fmt::String> fmt::String for Arc<T> {
589+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
590+
fmt::String::fmt(&**self, f)
591+
}
592+
}
593+
588594
#[stable]
589595
impl<T: Default + Sync + Send> Default for Arc<T> {
590596
#[stable]
591597
fn default() -> Arc<T> { Arc::new(Default::default()) }
592598
}
593599

600+
impl<H: Hasher, T: Hash<H>> Hash<H> for Arc<T> {
601+
fn hash(&self, state: &mut H) {
602+
(**self).hash(state)
603+
}
604+
}
605+
594606
#[cfg(test)]
595607
#[allow(experimental)]
596608
mod tests {

trunk/src/liballoc/boxed.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -111,16 +111,24 @@ impl<T: ?Sized + Ord> Ord for Box<T> {
111111
fn cmp(&self, other: &Box<T>) -> Ordering {
112112
Ord::cmp(&**self, &**other)
113113
}
114-
115-
#[stable]}
114+
}
115+
#[stable]
116116
impl<T: ?Sized + Eq> Eq for Box<T> {}
117117

118+
#[cfg(stage0)]
118119
impl<S: hash::Writer, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
119120
#[inline]
120121
fn hash(&self, state: &mut S) {
121122
(**self).hash(state);
122123
}
123124
}
125+
#[cfg(not(stage0))]
126+
impl<S: hash::Hasher, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
127+
#[inline]
128+
fn hash(&self, state: &mut S) {
129+
(**self).hash(state);
130+
}
131+
}
124132

125133
/// Extension methods for an owning `Any` trait object.
126134
#[unstable = "post-DST and coherence changes, this will not be a trait but \
@@ -158,6 +166,7 @@ impl<T: ?Sized + fmt::Show> fmt::Show for Box<T> {
158166
}
159167
}
160168

169+
#[stable]
161170
impl<T: ?Sized + fmt::String> fmt::String for Box<T> {
162171
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
163172
fmt::String::fmt(&**self, f)

trunk/src/liballoc/heap.rs

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,20 @@ unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) {
115115
// The minimum alignment guaranteed by the architecture. This value is used to
116116
// add fast paths for low alignment values. In practice, the alignment is a
117117
// constant at the call site and the branch will be optimized out.
118-
#[cfg(any(target_arch = "arm",
119-
target_arch = "mips",
120-
target_arch = "mipsel"))]
118+
#[cfg(all(not(feature = "external_funcs"),
119+
not(feature = "external_crate"),
120+
any(target_arch = "arm",
121+
target_arch = "mips",
122+
target_arch = "mipsel")))]
121123
const MIN_ALIGN: uint = 8;
122-
#[cfg(any(target_arch = "x86",
123-
target_arch = "x86_64",
124-
target_arch = "aarch64"))]
124+
#[cfg(all(not(feature = "external_funcs"),
125+
not(feature = "external_crate"),
126+
any(target_arch = "x86",
127+
target_arch = "x86_64",
128+
target_arch = "aarch64"))]
125129
const MIN_ALIGN: uint = 16;
126130

127-
#[cfg(external_funcs)]
131+
#[cfg(feature = "external_funcs")]
128132
mod imp {
129133
extern {
130134
fn rust_allocate(size: uint, align: uint) -> *mut u8;
@@ -142,14 +146,13 @@ mod imp {
142146
}
143147

144148
#[inline]
145-
pub unsafe fn reallocate_inplace(ptr: *mut u8, old_size: uint, size: uint,
146-
align: uint) -> uint {
147-
rust_reallocate_inplace(ptr, old_size, size, align)
149+
pub unsafe fn deallocate(ptr: *mut u8, old_size: uint, align: uint) {
150+
rust_deallocate(ptr, old_size, align)
148151
}
149152

150153
#[inline]
151-
pub unsafe fn deallocate(ptr: *mut u8, old_size: uint, align: uint) {
152-
rust_deallocate(ptr, old_size, align)
154+
pub unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8 {
155+
rust_reallocate(ptr, old_size, size, align)
153156
}
154157

155158
#[inline]
@@ -169,14 +172,16 @@ mod imp {
169172
}
170173
}
171174

172-
#[cfg(external_crate)]
175+
#[cfg(feature = "external_crate")]
173176
mod imp {
174177
extern crate external;
175178
pub use self::external::{allocate, deallocate, reallocate_inplace, reallocate};
176179
pub use self::external::{usable_size, stats_print};
177180
}
178181

179-
#[cfg(all(not(external_funcs), not(external_crate), jemalloc))]
182+
#[cfg(all(not(feature = "external_funcs"),
183+
not(feature = "external_crate"),
184+
jemalloc))]
180185
mod imp {
181186
use core::option::Option;
182187
use core::option::Option::None;
@@ -253,7 +258,10 @@ mod imp {
253258
}
254259
}
255260

256-
#[cfg(all(not(external_funcs), not(external_crate), not(jemalloc), unix))]
261+
#[cfg(all(not(feature = "external_funcs"),
262+
not(feature = "external_crate"),
263+
not(jemalloc),
264+
unix))]
257265
mod imp {
258266
use core::cmp;
259267
use core::ptr;
@@ -314,7 +322,10 @@ mod imp {
314322
pub fn stats_print() {}
315323
}
316324

317-
#[cfg(all(not(external_funcs), not(external_crate), not(jemalloc), windows))]
325+
#[cfg(all(not(feature = "external_funcs"),
326+
not(feature = "external_crate"),
327+
not(jemalloc),
328+
windows))]
318329
mod imp {
319330
use libc::{c_void, size_t};
320331
use libc;

trunk/src/liballoc/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
5959
#![crate_name = "alloc"]
6060
#![experimental]
61+
#![staged_api]
6162
#![crate_type = "rlib"]
6263
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
6364
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
@@ -70,6 +71,8 @@
7071

7172
#[macro_use]
7273
extern crate core;
74+
75+
#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate")))]
7376
extern crate libc;
7477

7578
// Allow testing this library

trunk/src/liballoc/rc.rs

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,26 @@
1010

1111
//! Thread-local reference-counted boxes (the `Rc<T>` type).
1212
//!
13-
//! The `Rc<T>` type provides shared ownership of an immutable value. Destruction is deterministic,
14-
//! and will occur as soon as the last owner is gone. It is marked as non-sendable because it
15-
//! avoids the overhead of atomic reference counting.
13+
//! The `Rc<T>` type provides shared ownership of an immutable value.
14+
//! Destruction is deterministic, and will occur as soon as the last owner is
15+
//! gone. It is marked as non-sendable because it avoids the overhead of atomic
16+
//! reference counting.
1617
//!
17-
//! The `downgrade` method can be used to create a non-owning `Weak<T>` pointer to the box. A
18-
//! `Weak<T>` pointer can be upgraded to an `Rc<T>` pointer, but will return `None` if the value
19-
//! has already been dropped.
18+
//! The `downgrade` method can be used to create a non-owning `Weak<T>` pointer
19+
//! to the box. A `Weak<T>` pointer can be upgraded to an `Rc<T>` pointer, but
20+
//! will return `None` if the value has already been dropped.
2021
//!
21-
//! For example, a tree with parent pointers can be represented by putting the nodes behind strong
22-
//! `Rc<T>` pointers, and then storing the parent pointers as `Weak<T>` pointers.
22+
//! For example, a tree with parent pointers can be represented by putting the
23+
//! nodes behind strong `Rc<T>` pointers, and then storing the parent pointers
24+
//! as `Weak<T>` pointers.
2325
//!
2426
//! # Examples
2527
//!
26-
//! Consider a scenario where a set of `Gadget`s are owned by a given `Owner`. We want to have our
27-
//! `Gadget`s point to their `Owner`. We can't do this with unique ownership, because more than one
28-
//! gadget may belong to the same `Owner`. `Rc<T>` allows us to share an `Owner` between multiple
29-
//! `Gadget`s, and have the `Owner` remain allocated as long as any `Gadget` points at it.
28+
//! Consider a scenario where a set of `Gadget`s are owned by a given `Owner`.
29+
//! We want to have our `Gadget`s point to their `Owner`. We can't do this with
30+
//! unique ownership, because more than one gadget may belong to the same
31+
//! `Owner`. `Rc<T>` allows us to share an `Owner` between multiple `Gadget`s,
32+
//! and have the `Owner` remain allocated as long as any `Gadget` points at it.
3033
//!
3134
//! ```rust
3235
//! use std::rc::Rc;
@@ -597,12 +600,20 @@ impl<T: Ord> Ord for Rc<T> {
597600
}
598601

599602
// FIXME (#18248) Make `T` `Sized?`
603+
#[cfg(stage0)]
600604
impl<S: hash::Writer, T: Hash<S>> Hash<S> for Rc<T> {
601605
#[inline]
602606
fn hash(&self, state: &mut S) {
603607
(**self).hash(state);
604608
}
605609
}
610+
#[cfg(not(stage0))]
611+
impl<S: hash::Hasher, T: Hash<S>> Hash<S> for Rc<T> {
612+
#[inline]
613+
fn hash(&self, state: &mut S) {
614+
(**self).hash(state);
615+
}
616+
}
606617

607618
#[experimental = "Show is experimental."]
608619
impl<T: fmt::Show> fmt::Show for Rc<T> {
@@ -611,6 +622,13 @@ impl<T: fmt::Show> fmt::Show for Rc<T> {
611622
}
612623
}
613624

625+
#[stable]
626+
impl<T: fmt::String> fmt::String for Rc<T> {
627+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
628+
fmt::String::fmt(&**self, f)
629+
}
630+
}
631+
614632
/// A weak version of `Rc<T>`.
615633
///
616634
/// Weak references do not count when determining if the inner value should be dropped.

0 commit comments

Comments
 (0)