Skip to content

Commit 84d5734

Browse files
committed
---
yaml --- r: 227629 b: refs/heads/try c: c680f08 h: refs/heads/master i: 227627: 35ec5cb v: v3
1 parent d5f57c7 commit 84d5734

File tree

225 files changed

+1340
-1801
lines changed

Some content is hidden

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

225 files changed

+1340
-1801
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 2f5683913c9815d9f12494784747f79b0f3b3066
4+
refs/heads/try: c680f0818289dfcf5583a6a46aef0a3e4e7c54d2
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/compiletest/compiletest.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
#![crate_type = "bin"]
1212

1313
#![feature(box_syntax)]
14-
#![feature(dynamic_lib)]
15-
#![feature(libc)]
16-
#![feature(path_ext)]
14+
#![feature(collections)]
1715
#![feature(rustc_private)]
18-
#![feature(slice_extras)]
19-
#![feature(str_char)]
16+
#![feature(std_misc)]
2017
#![feature(test)]
21-
#![feature(vec_push_all)]
18+
#![feature(path_ext)]
19+
#![feature(str_char)]
20+
#![feature(libc)]
2221

2322
#![deny(warnings)]
2423

branches/try/src/doc/reference.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -944,20 +944,9 @@ fn foo<T>(x: T) where T: Debug {
944944
```
945945

946946
When a generic function is referenced, its type is instantiated based on the
947-
context of the reference. For example, calling the `foo` function here:
948-
949-
```
950-
use std::fmt::Debug;
951-
952-
fn foo<T>(x: &[T]) where T: Debug {
953-
// details elided
954-
# ()
955-
}
956-
957-
foo(&[1, 2]);
958-
```
959-
960-
will instantiate type parameter `T` with `i32`.
947+
context of the reference. For example, calling the `iter` function defined
948+
above on `[1, 2]` will instantiate type parameter `T` with `i32`, and require
949+
the closure parameter to have type `Fn(i32)`.
961950

962951
The type parameters can also be explicitly supplied in a trailing
963952
[path](#paths) component after the function name. This might be necessary if
@@ -2779,24 +2768,22 @@ meaning of the operators on standard types is given here.
27792768
Like the [arithmetic operators](#arithmetic-operators), bitwise operators are
27802769
syntactic sugar for calls to methods of built-in traits. This means that
27812770
bitwise operators can be overridden for user-defined types. The default
2782-
meaning of the operators on standard types is given here. Bitwise `&`, `|` and
2783-
`^` applied to boolean arguments are equivalent to logical `&&`, `||` and `!=`
2784-
evaluated in non-lazy fashion.
2771+
meaning of the operators on standard types is given here.
27852772

27862773
* `&`
2787-
: Bitwise AND.
2774+
: And.
27882775
Calls the `bitand` method of the `std::ops::BitAnd` trait.
27892776
* `|`
2790-
: Bitwise inclusive OR.
2777+
: Inclusive or.
27912778
Calls the `bitor` method of the `std::ops::BitOr` trait.
27922779
* `^`
2793-
: Bitwise exclusive OR.
2780+
: Exclusive or.
27942781
Calls the `bitxor` method of the `std::ops::BitXor` trait.
27952782
* `<<`
27962783
: Left shift.
27972784
Calls the `shl` method of the `std::ops::Shl` trait.
27982785
* `>>`
2799-
: Right shift (arithmetic).
2786+
: Right shift.
28002787
Calls the `shr` method of the `std::ops::Shr` trait.
28012788

28022789
#### Lazy boolean operators

branches/try/src/liballoc/arc.rs

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
134134
/// Weak pointers will not keep the data inside of the `Arc` alive, and can be
135135
/// used to break cycles between `Arc` pointers.
136136
#[unsafe_no_drop_flag]
137-
#[unstable(feature = "arc_weak",
137+
#[unstable(feature = "alloc",
138138
reason = "Weak pointers may not belong in this module.")]
139139
pub struct Weak<T: ?Sized> {
140140
// FIXME #12808: strange name to try to avoid interfering with
@@ -191,35 +191,23 @@ impl<T: ?Sized> Arc<T> {
191191
/// # Examples
192192
///
193193
/// ```
194-
/// # #![feature(arc_weak)]
194+
/// # #![feature(alloc)]
195195
/// use std::sync::Arc;
196196
///
197197
/// let five = Arc::new(5);
198198
///
199199
/// let weak_five = five.downgrade();
200200
/// ```
201-
#[unstable(feature = "arc_weak",
201+
#[unstable(feature = "alloc",
202202
reason = "Weak pointers may not belong in this module.")]
203203
pub fn downgrade(&self) -> Weak<T> {
204204
// See the clone() impl for why this is relaxed
205205
self.inner().weak.fetch_add(1, Relaxed);
206206
Weak { _ptr: self._ptr }
207207
}
208+
}
208209

209-
/// Get the number of weak references to this value.
210-
#[inline]
211-
#[unstable(feature = "arc_counts")]
212-
pub fn weak_count(this: &Arc<T>) -> usize {
213-
this.inner().weak.load(SeqCst) - 1
214-
}
215-
216-
/// Get the number of strong references to this value.
217-
#[inline]
218-
#[unstable(feature = "arc_counts")]
219-
pub fn strong_count(this: &Arc<T>) -> usize {
220-
this.inner().strong.load(SeqCst)
221-
}
222-
210+
impl<T: ?Sized> Arc<T> {
223211
#[inline]
224212
fn inner(&self) -> &ArcInner<T> {
225213
// This unsafety is ok because while this arc is alive we're guaranteed
@@ -248,15 +236,13 @@ impl<T: ?Sized> Arc<T> {
248236

249237
/// Get the number of weak references to this value.
250238
#[inline]
251-
#[unstable(feature = "arc_counts")]
252-
#[deprecated(since = "1.2.0", reason = "renamed to Arc::weak_count")]
253-
pub fn weak_count<T: ?Sized>(this: &Arc<T>) -> usize { Arc::weak_count(this) }
239+
#[unstable(feature = "alloc")]
240+
pub fn weak_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().weak.load(SeqCst) - 1 }
254241

255242
/// Get the number of strong references to this value.
256243
#[inline]
257-
#[unstable(feature = "arc_counts")]
258-
#[deprecated(since = "1.2.0", reason = "renamed to Arc::strong_count")]
259-
pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { Arc::strong_count(this) }
244+
#[unstable(feature = "alloc")]
245+
pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst) }
260246

261247

262248
/// Returns a mutable reference to the contained value if the `Arc<T>` is unique.
@@ -269,7 +255,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { Arc::strong_count(this)
269255
/// # Examples
270256
///
271257
/// ```
272-
/// # #![feature(arc_unique, alloc)]
258+
/// # #![feature(alloc)]
273259
/// extern crate alloc;
274260
/// # fn main() {
275261
/// use alloc::arc::{Arc, get_mut};
@@ -285,12 +271,10 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { Arc::strong_count(this)
285271
/// # }
286272
/// ```
287273
#[inline]
288-
#[unstable(feature = "arc_unique")]
289-
#[deprecated(since = "1.2.0",
290-
reason = "this function is unsafe with weak pointers")]
274+
#[unstable(feature = "alloc")]
291275
pub unsafe fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> {
292276
// FIXME(#24880) potential race with upgraded weak pointers here
293-
if Arc::strong_count(this) == 1 && Arc::weak_count(this) == 0 {
277+
if strong_count(this) == 1 && weak_count(this) == 0 {
294278
// This unsafety is ok because we're guaranteed that the pointer
295279
// returned is the *only* pointer that will ever be returned to T. Our
296280
// reference count is guaranteed to be 1 at this point, and we required
@@ -358,7 +342,7 @@ impl<T: Clone> Arc<T> {
358342
/// # Examples
359343
///
360344
/// ```
361-
/// # #![feature(arc_unique)]
345+
/// # #![feature(alloc)]
362346
/// use std::sync::Arc;
363347
///
364348
/// # unsafe {
@@ -368,9 +352,7 @@ impl<T: Clone> Arc<T> {
368352
/// # }
369353
/// ```
370354
#[inline]
371-
#[unstable(feature = "arc_unique")]
372-
#[deprecated(since = "1.2.0",
373-
reason = "this function is unsafe with weak pointers")]
355+
#[unstable(feature = "alloc")]
374356
pub unsafe fn make_unique(&mut self) -> &mut T {
375357
// FIXME(#24880) potential race with upgraded weak pointers here
376358
//
@@ -456,7 +438,7 @@ impl<T: ?Sized> Drop for Arc<T> {
456438
}
457439
}
458440

459-
#[unstable(feature = "arc_weak",
441+
#[unstable(feature = "alloc",
460442
reason = "Weak pointers may not belong in this module.")]
461443
impl<T: ?Sized> Weak<T> {
462444
/// Upgrades a weak reference to a strong reference.
@@ -469,7 +451,7 @@ impl<T: ?Sized> Weak<T> {
469451
/// # Examples
470452
///
471453
/// ```
472-
/// # #![feature(arc_weak)]
454+
/// # #![feature(alloc)]
473455
/// use std::sync::Arc;
474456
///
475457
/// let five = Arc::new(5);
@@ -497,7 +479,7 @@ impl<T: ?Sized> Weak<T> {
497479
}
498480
}
499481

500-
#[unstable(feature = "arc_weak",
482+
#[unstable(feature = "alloc",
501483
reason = "Weak pointers may not belong in this module.")]
502484
impl<T: ?Sized> Clone for Weak<T> {
503485
/// Makes a clone of the `Weak<T>`.
@@ -507,7 +489,7 @@ impl<T: ?Sized> Clone for Weak<T> {
507489
/// # Examples
508490
///
509491
/// ```
510-
/// # #![feature(arc_weak)]
492+
/// # #![feature(alloc)]
511493
/// use std::sync::Arc;
512494
///
513495
/// let weak_five = Arc::new(5).downgrade();
@@ -531,7 +513,7 @@ impl<T: ?Sized> Drop for Weak<T> {
531513
/// # Examples
532514
///
533515
/// ```
534-
/// # #![feature(arc_weak)]
516+
/// # #![feature(alloc)]
535517
/// use std::sync::Arc;
536518
///
537519
/// {

branches/try/src/liballoc/boxed.rs

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
//! A pointer type for heap allocation.
1212
//!
13-
//! `Box<T>`, casually referred to as a 'box', provides the simplest form of
14-
//! heap allocation in Rust. Boxes provide ownership for this allocation, and
15-
//! drop their contents when they go out of scope.
13+
//! `Box<T>`, casually referred to as a 'box', provides the simplest form of heap allocation in
14+
//! Rust. Boxes provide ownership for this allocation, and drop their contents when they go out of
15+
//! scope.
1616
//!
1717
//! # Examples
1818
//!
@@ -39,17 +39,15 @@
3939
//!
4040
//! This will print `Cons(1, Cons(2, Nil))`.
4141
//!
42-
//! Recursive structures must be boxed, because if the definition of `Cons`
43-
//! looked like this:
42+
//! Recursive structures must be boxed, because if the definition of `Cons` looked like this:
4443
//!
4544
//! ```rust,ignore
4645
//! Cons(T, List<T>),
4746
//! ```
4847
//!
49-
//! It wouldn't work. This is because the size of a `List` depends on how many
50-
//! elements are in the list, and so we don't know how much memory to allocate
51-
//! for a `Cons`. By introducing a `Box`, which has a defined size, we know how
52-
//! big `Cons` needs to be.
48+
//! It wouldn't work. This is because the size of a `List` depends on how many elements are in the
49+
//! list, and so we don't know how much memory to allocate for a `Cons`. By introducing a `Box`,
50+
//! which has a defined size, we know how big `Cons` needs to be.
5351
5452
#![stable(feature = "rust1", since = "1.0.0")]
5553

@@ -71,7 +69,7 @@ use core::raw::{TraitObject};
7169
/// The following two examples are equivalent:
7270
///
7371
/// ```
74-
/// # #![feature(box_heap)]
72+
/// # #![feature(alloc)]
7573
/// #![feature(box_syntax)]
7674
/// use std::boxed::HEAP;
7775
///
@@ -81,7 +79,7 @@ use core::raw::{TraitObject};
8179
/// }
8280
/// ```
8381
#[lang = "exchange_heap"]
84-
#[unstable(feature = "box_heap",
82+
#[unstable(feature = "alloc",
8583
reason = "may be renamed; uncertain about custom allocator design")]
8684
pub const HEAP: () = ();
8785

@@ -121,37 +119,12 @@ impl<T : ?Sized> Box<T> {
121119
/// Function is unsafe, because improper use of this function may
122120
/// lead to memory problems like double-free, for example if the
123121
/// function is called twice on the same raw pointer.
124-
#[unstable(feature = "box_raw",
122+
#[unstable(feature = "alloc",
125123
reason = "may be renamed or moved out of Box scope")]
126124
#[inline]
127-
// NB: may want to be called from_ptr, see comments on CStr::from_ptr
128125
pub unsafe fn from_raw(raw: *mut T) -> Self {
129126
mem::transmute(raw)
130127
}
131-
132-
/// Consumes the `Box`, returning the wrapped raw pointer.
133-
///
134-
/// After call to this function, caller is responsible for the memory
135-
/// previously managed by `Box`, in particular caller should properly
136-
/// destroy `T` and release memory. The proper way to do it is to
137-
/// convert pointer back to `Box` with `Box::from_raw` function, because
138-
/// `Box` does not specify, how memory is allocated.
139-
///
140-
/// # Examples
141-
/// ```
142-
/// # #![feature(box_raw)]
143-
/// use std::boxed;
144-
///
145-
/// let seventeen = Box::new(17u32);
146-
/// let raw = boxed::into_raw(seventeen);
147-
/// let boxed_again = unsafe { Box::from_raw(raw) };
148-
/// ```
149-
#[unstable(feature = "box_raw", reason = "may be renamed")]
150-
#[inline]
151-
// NB: may want to be called into_ptr, see comments on CStr::from_ptr
152-
pub fn into_raw(b: Box<T>) -> *mut T {
153-
unsafe { mem::transmute(b) }
154-
}
155128
}
156129

157130
/// Consumes the `Box`, returning the wrapped raw pointer.
@@ -164,18 +137,18 @@ impl<T : ?Sized> Box<T> {
164137
///
165138
/// # Examples
166139
/// ```
167-
/// # #![feature(box_raw)]
140+
/// # #![feature(alloc)]
168141
/// use std::boxed;
169142
///
170143
/// let seventeen = Box::new(17u32);
171144
/// let raw = boxed::into_raw(seventeen);
172145
/// let boxed_again = unsafe { Box::from_raw(raw) };
173146
/// ```
174-
#[unstable(feature = "box_raw", reason = "may be renamed")]
175-
#[deprecated(since = "1.2.0", reason = "renamed to Box::into_raw")]
147+
#[unstable(feature = "alloc",
148+
reason = "may be renamed")]
176149
#[inline]
177150
pub fn into_raw<T : ?Sized>(b: Box<T>) -> *mut T {
178-
Box::into_raw(b)
151+
unsafe { mem::transmute(b) }
179152
}
180153

181154
#[stable(feature = "rust1", since = "1.0.0")]
@@ -208,7 +181,7 @@ impl<T: Clone> Clone for Box<T> {
208181
/// # Examples
209182
///
210183
/// ```
211-
/// # #![feature(box_raw)]
184+
/// # #![feature(alloc, core)]
212185
/// let x = Box::new(5);
213186
/// let mut y = Box::new(10);
214187
///
@@ -269,7 +242,7 @@ impl Box<Any> {
269242
if self.is::<T>() {
270243
unsafe {
271244
// Get the raw representation of the trait object
272-
let raw = Box::into_raw(self);
245+
let raw = into_raw(self);
273246
let to: TraitObject =
274247
mem::transmute::<*mut Any, TraitObject>(raw);
275248

@@ -361,7 +334,7 @@ impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {}
361334
/// -> i32>`.
362335
///
363336
/// ```
364-
/// #![feature(fnbox)]
337+
/// #![feature(core)]
365338
///
366339
/// use std::boxed::FnBox;
367340
/// use std::collections::HashMap;
@@ -382,7 +355,7 @@ impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {}
382355
/// }
383356
/// ```
384357
#[rustc_paren_sugar]
385-
#[unstable(feature = "fnbox", reason = "Newly introduced")]
358+
#[unstable(feature = "core", reason = "Newly introduced")]
386359
pub trait FnBox<A> {
387360
type Output;
388361

0 commit comments

Comments
 (0)