Skip to content

Commit 285f276

Browse files
committed
---
yaml --- r: 128411 b: refs/heads/master c: 82fa436 h: refs/heads/master i: 128409: a2d5546 128407: ab71c11 v: v3
1 parent 91843d9 commit 285f276

Some content is hidden

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

96 files changed

+1199
-1552
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: 0600a3befaad1fa564885a2d3cd3716ce8ecb304
2+
refs/heads/master: 82fa4368ed50db5081504523249222856c34a3aa
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
55
refs/heads/try: 73b8f60b60d8a2a7ca5a7d49d59771350b867951

trunk/src/doc/guide.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ note: in expansion of format_args!
517517
<std macros>:1:1: 3:2 note: in expansion of println!
518518
src/hello_world.rs:4:5: 4:42 note: expansion site
519519
error: aborting due to previous error
520-
Could not compile `hello_world`.
520+
Could not execute process `rustc src/hello_world.rs --crate-type bin --out-dir /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target/deps` (status=101)
521521
```
522522

523523
Rust will not let us use a value that has not been initialized. So why let us
@@ -532,7 +532,7 @@ in the middle of a string." We add a comma, and then `x`, to indicate that we
532532
want `x` to be the value we're interpolating. The comma is used to separate
533533
arguments we pass to functions and macros, if you're passing more than one.
534534

535-
When you just use the curly braces, Rust will attempt to display the
535+
When you just use the double curly braces, Rust will attempt to display the
536536
value in a meaningful way by checking out its type. If you want to specify the
537537
format in a more detailed manner, there are a [wide number of options
538538
available](/std/fmt/index.html). For now, we'll just stick to the default:
@@ -1888,16 +1888,8 @@ fn main() {
18881888

18891889
The first thing we changed was to `use std::rand`, as the docs
18901890
explained. We then added in a `let` expression to create a variable binding
1891-
named `secret_number`, and we printed out its result.
1892-
1893-
Also, you may wonder why we are using `%` on the result of `rand::random()`.
1894-
This operator is called 'modulo', and it returns the remainder of a division.
1895-
By taking the modulo of the result of `rand::random()`, we're limiting the
1896-
values to be between 0 and 99. Then, we add one to the result, making it from 1
1897-
to 100. Using modulo can give you a very, very small bias in the result, but
1898-
for this example, it is not important.
1899-
1900-
Let's try to compile this using `cargo build`:
1891+
named `secret_number`, and we printed out its result. Let's try to compile
1892+
this using `cargo build`:
19011893

19021894
```{notrust,no_run}
19031895
$ cargo build
@@ -3677,9 +3669,10 @@ manually free this allocation! If we write
36773669
```
36783670

36793671
then Rust will automatically free `x` at the end of the block. This isn't
3680-
because Rust has a garbage collector -- it doesn't. Instead, when `x` goes out
3681-
of scope, Rust `free`s `x`. This Rust code will do the same thing as the
3682-
following C code:
3672+
because Rust has a garbage collector -- it doesn't. Instead, Rust uses static
3673+
analysis to determine the *lifetime* of `x`, and then generates code to free it
3674+
once it's sure the `x` won't be used again. This Rust code will do the same
3675+
thing as the following C code:
36833676

36843677
```{c,ignore}
36853678
{

trunk/src/doc/rust.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ sequence (`/**`), are interpreted as a special syntax for `doc`
169169
`#[doc="..."]` around the body of the comment (this includes the comment
170170
characters themselves, ie `/// Foo` turns into `#[doc="/// Foo"]`).
171171

172-
`//!` comments apply to the parent of the comment, rather than the item that
173-
follows. `//!` comments are usually used to display information on the crate
174-
index page.
175-
176172
Non-doc comments are interpreted as a form of whitespace.
177173

178174
## Whitespace
@@ -1805,7 +1801,7 @@ module through the rules above. It essentially allows public access into the
18051801
re-exported item. For example, this program is valid:
18061802

18071803
~~~~
1808-
pub use self::implementation as api;
1804+
pub use api = self::implementation;
18091805
18101806
mod implementation {
18111807
pub fn f() {}

trunk/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,7 @@ use farm::*;
31123112
However, that's not all. You can also rename an item while you're bringing it into scope:
31133113

31143114
~~~
3115-
use farm::chicken as egg_layer;
3115+
use egg_layer = farm::chicken;
31163116
# mod farm { pub fn chicken() { println!("Laying eggs is fun!") } }
31173117
// ...
31183118
@@ -3335,7 +3335,7 @@ you just have to import it with an `use` statement.
33353335
For example, it re-exports `range` which is defined in `std::iter::range`:
33363336

33373337
~~~
3338-
use std::iter::range as iter_range;
3338+
use iter_range = std::iter::range;
33393339
33403340
fn main() {
33413341
// `range` is imported by default

trunk/src/liballoc/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct ArcInner<T> {
7777
}
7878

7979
impl<T: Sync + Send> Arc<T> {
80-
/// Creates an atomically reference counted wrapper.
80+
/// Create an atomically reference counted wrapper.
8181
#[inline]
8282
#[stable]
8383
pub fn new(data: T) -> Arc<T> {
@@ -101,7 +101,7 @@ impl<T: Sync + Send> Arc<T> {
101101
unsafe { &*self._ptr }
102102
}
103103

104-
/// Downgrades a strong pointer to a weak pointer.
104+
/// Downgrades a strong pointer to a weak pointer
105105
///
106106
/// Weak pointers will not keep the data alive. Once all strong references
107107
/// to the underlying data have been dropped, the data itself will be
@@ -224,7 +224,7 @@ impl<T: Sync + Send> Weak<T> {
224224
///
225225
/// This method will fail to upgrade this reference if the strong reference
226226
/// count has already reached 0, but if there are still other active strong
227-
/// references this function will return a new strong reference to the data.
227+
/// references this function will return a new strong reference to the data
228228
pub fn upgrade(&self) -> Option<Arc<T>> {
229229
// We use a CAS loop to increment the strong count instead of a
230230
// fetch_add because once the count hits 0 is must never be above 0.

trunk/src/liballoc/boxed.rs

Lines changed: 10 additions & 12 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 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
//
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! A unique pointer type.
11+
//! A unique pointer type
1212
1313
use core::any::{Any, AnyRefExt};
1414
use core::clone::Clone;
@@ -26,14 +26,12 @@ use core::result::{Ok, Err, Result};
2626
///
2727
/// The following two examples are equivalent:
2828
///
29-
/// ```rust
30-
/// use std::boxed::HEAP;
29+
/// use std::boxed::HEAP;
3130
///
32-
/// # struct Bar;
33-
/// # impl Bar { fn new(_a: int) { } }
34-
/// let foo = box(HEAP) Bar::new(2);
35-
/// let foo = box Bar::new(2);
36-
/// ```
31+
/// # struct Bar;
32+
/// # impl Bar { fn new(_a: int) { } }
33+
/// let foo = box(HEAP) Bar::new(2);
34+
/// let foo = box Bar::new(2);
3735
#[lang = "exchange_heap"]
3836
#[experimental = "may be renamed; uncertain about custom allocator design"]
3937
pub static HEAP: () = ();
@@ -49,11 +47,11 @@ impl<T: Default> Default for Box<T> {
4947

5048
#[unstable]
5149
impl<T: Clone> Clone for Box<T> {
52-
/// Returns a copy of the owned box.
50+
/// Return a copy of the owned box.
5351
#[inline]
5452
fn clone(&self) -> Box<T> { box {(**self).clone()} }
5553

56-
/// Performs copy-assignment from `source` by reusing the existing allocation.
54+
/// Perform copy-assignment from `source` by reusing the existing allocation.
5755
#[inline]
5856
fn clone_from(&mut self, source: &Box<T>) {
5957
(**self).clone_from(&(**source));
@@ -88,7 +86,7 @@ impl<T: Ord> Ord for Box<T> {
8886
}
8987
impl<T: Eq> Eq for Box<T> {}
9088

91-
/// Extension methods for an owning `Any` trait object.
89+
/// Extension methods for an owning `Any` trait object
9290
#[unstable = "post-DST and coherence changes, this will not be a trait but \
9391
rather a direct `impl` on `Box<Any>`"]
9492
pub trait BoxAny {

trunk/src/liballoc/heap.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#[cfg(not(test))] use core::raw;
1616
#[cfg(not(test))] use util;
1717

18-
/// Returns a pointer to `size` bytes of memory.
18+
/// Return a pointer to `size` bytes of memory.
1919
///
2020
/// Behavior is undefined if the requested size is 0 or the alignment is not a
2121
/// power of 2. The alignment must be no larger than the largest supported page
@@ -25,7 +25,7 @@ pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
2525
imp::allocate(size, align)
2626
}
2727

28-
/// Extends or shrinks the allocation referenced by `ptr` to `size` bytes of
28+
/// Extend or shrink the allocation referenced by `ptr` to `size` bytes of
2929
/// memory.
3030
///
3131
/// Behavior is undefined if the requested size is 0 or the alignment is not a
@@ -41,10 +41,10 @@ pub unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint,
4141
imp::reallocate(ptr, size, align, old_size)
4242
}
4343

44-
/// Extends or shrinks the allocation referenced by `ptr` to `size` bytes of
44+
/// Extend or shrink the allocation referenced by `ptr` to `size` bytes of
4545
/// memory in-place.
4646
///
47-
/// Returns true if successful, otherwise false if the allocation was not
47+
/// Return true if successful, otherwise false if the allocation was not
4848
/// altered.
4949
///
5050
/// Behavior is undefined if the requested size is 0 or the alignment is not a
@@ -60,7 +60,7 @@ pub unsafe fn reallocate_inplace(ptr: *mut u8, size: uint, align: uint,
6060
imp::reallocate_inplace(ptr, size, align, old_size)
6161
}
6262

63-
/// Deallocates the memory referenced by `ptr`.
63+
/// Deallocate the memory referenced by `ptr`.
6464
///
6565
/// The `ptr` parameter must not be null.
6666
///
@@ -72,14 +72,14 @@ pub unsafe fn deallocate(ptr: *mut u8, size: uint, align: uint) {
7272
imp::deallocate(ptr, size, align)
7373
}
7474

75-
/// Returns the usable size of an allocation created with the specified the
75+
/// Return the usable size of an allocation created with the specified the
7676
/// `size` and `align`.
7777
#[inline]
7878
pub fn usable_size(size: uint, align: uint) -> uint {
7979
imp::usable_size(size, align)
8080
}
8181

82-
/// Prints implementation-defined allocator statistics.
82+
/// Print implementation-defined allocator statistics.
8383
///
8484
/// These statistics may be inconsistent if other threads use the allocator
8585
/// during the call.
@@ -88,7 +88,7 @@ pub fn stats_print() {
8888
imp::stats_print();
8989
}
9090

91-
// The compiler never calls `exchange_free` on Box<ZeroSizeType>, so zero-size
91+
// The compiler never calls `exchange_free` on ~ZeroSizeType, so zero-size
9292
// allocations can point to this `static`. It would be incorrect to use a null
9393
// pointer, due to enums assuming types like unique pointers are never null.
9494
pub static mut EMPTY: uint = 12345;

trunk/src/liballoc/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! # The Rust core allocation library
11+
//! Rust's core allocation library
1212
//!
1313
//! This is the lowest level library through which allocation in Rust can be
1414
//! performed where the allocation is assumed to succeed. This library will
@@ -23,22 +23,22 @@
2323
//!
2424
//! ## Boxed values
2525
//!
26-
//! The [`Box`](boxed/index.html) type is the core owned pointer type in Rust.
26+
//! The [`Box`](boxed/index.html) type is the core owned pointer type in rust.
2727
//! There can only be one owner of a `Box`, and the owner can decide to mutate
2828
//! the contents, which live on the heap.
2929
//!
3030
//! This type can be sent among tasks efficiently as the size of a `Box` value
31-
//! is the same as that of a pointer. Tree-like data structures are often built
32-
//! with boxes because each node often has only one owner, the parent.
31+
//! is just a pointer. Tree-like data structures are often built on owned
32+
//! pointers because each node often has only one owner, the parent.
3333
//!
3434
//! ## Reference counted pointers
3535
//!
3636
//! The [`Rc`](rc/index.html) type is a non-threadsafe reference-counted pointer
3737
//! type intended for sharing memory within a task. An `Rc` pointer wraps a
3838
//! type, `T`, and only allows access to `&T`, a shared reference.
3939
//!
40-
//! This type is useful when inherited mutability (such as using `Box`) is too
41-
//! constraining for an application, and is often paired with the `Cell` or
40+
//! This type is useful when inherited mutability is too constraining for an
41+
//! application (such as using `Box`), and is often paired with the `Cell` or
4242
//! `RefCell` types in order to allow mutation.
4343
//!
4444
//! ## Atomically reference counted pointers
@@ -86,7 +86,7 @@ extern crate libc;
8686

8787
#[deprecated = "use boxed instead"]
8888
#[cfg(not(test))]
89-
pub use boxed as owned;
89+
pub use owned = boxed;
9090

9191
// Heaps provided for low-level allocation strategies
9292

trunk/src/liballoc/libc_heap.rs

Lines changed: 3 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 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
//
@@ -14,7 +14,7 @@
1414
use libc::{c_void, size_t, free, malloc, realloc};
1515
use core::ptr::{RawPtr, mut_null};
1616

17-
/// A wrapper around libc::malloc, aborting on out-of-memory.
17+
/// A wrapper around libc::malloc, aborting on out-of-memory
1818
#[inline]
1919
pub unsafe fn malloc_raw(size: uint) -> *mut u8 {
2020
// `malloc(0)` may allocate, but it may also return a null pointer
@@ -30,7 +30,7 @@ pub unsafe fn malloc_raw(size: uint) -> *mut u8 {
3030
}
3131
}
3232

33-
/// A wrapper around libc::realloc, aborting on out-of-memory.
33+
/// A wrapper around libc::realloc, aborting on out-of-memory
3434
#[inline]
3535
pub unsafe fn realloc_raw(ptr: *mut u8, size: uint) -> *mut u8 {
3636
// `realloc(ptr, 0)` may allocate, but it may also return a null pointer

0 commit comments

Comments
 (0)