Skip to content

Commit 01b4f86

Browse files
committed
---
yaml --- r: 236009 b: refs/heads/stable c: b904b45 h: refs/heads/master i: 236007: 5697123 v: v3
1 parent 9d9c791 commit 01b4f86

File tree

139 files changed

+1282
-7274
lines changed

Some content is hidden

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

139 files changed

+1282
-7274
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 43b2c4781e5d6e25dedfc480218ceda92d9dffad
32+
refs/heads/stable: b904b452c607e84c1fb7e4b1a5f9ed6cb4e043e6
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
*.rs rust
77
src/etc/pkg/rust-logo.ico binary
88
src/etc/pkg/rust-logo.png binary
9-
src/rt/msvc/* -whitespace
10-
src/rt/valgrind/* -whitespace
119
*.woff binary

branches/stable/configure

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,11 +1005,9 @@ then
10051005
(''|*clang)
10061006
CFG_CLANG_REPORTED_VERSION=$($CFG_CC --version | grep version)
10071007

1008-
if [[ $CFG_CLANG_REPORTED_VERSION == *"(based on LLVM "* ]]
1009-
then
1008+
if echo $CFG_CLANG_REPORTED_VERSION | grep -q "(based on LLVM "; then
10101009
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*(based on LLVM \(.*\))/\1/')
1011-
elif [[ $CFG_CLANG_REPORTED_VERSION == "Apple LLVM"* ]]
1012-
then
1010+
elif echo $CFG_CLANG_REPORTED_VERSION | grep -q "Apple LLVM"; then
10131011
CFG_OSX_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
10141012
else
10151013
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')

branches/stable/src/doc/trpl/choosing-your-guarantees.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ allowed to share references to this by the regular borrowing rules, checked at c
4242

4343
## `&T` and `&mut T`
4444

45-
These are immutable and mutable references respectively. They follow the &lquo;read-write lock&rquo;
45+
These are immutable and mutable references respectively. They follow the “read-write lock”
4646
pattern, such that one may either have only one mutable reference to some data, or any number of
4747
immutable ones, but not both. This guarantee is enforced at compile time, and has no visible cost at
4848
runtime. In most cases these two pointer types suffice for sharing cheap references between sections
@@ -108,7 +108,7 @@ increment the inner reference count and return a copy of the `Rc<T>`.
108108

109109
# Cell types
110110

111-
&lquo;Cell&rquo;s provide interior mutability. In other words, they contain data which can be manipulated even
111+
`Cell`s provide interior mutability. In other words, they contain data which can be manipulated even
112112
if the type cannot be obtained in a mutable form (for example, when it is behind an `&`-ptr or
113113
`Rc<T>`).
114114

@@ -127,7 +127,8 @@ If a field is wrapped in `Cell`, it's a nice indicator that the chunk of data is
127127
stay the same between the time you first read it and when you intend to use it.
128128

129129
```rust
130-
# use std::cell::Cell;
130+
use std::cell::Cell;
131+
131132
let x = Cell::new(1);
132133
let y = &x;
133134
let z = &x;
@@ -185,7 +186,8 @@ any other borrows active when a mutable borrow is active. If the programmer atte
185186
borrow, the thread will panic.
186187

187188
```rust
188-
# use std::cell::RefCell;
189+
use std::cell::RefCell;
190+
189191
let x = RefCell::new(vec![1,2,3,4]);
190192
{
191193
println!("{:?}", *x.borrow())

branches/stable/src/doc/trpl/crates-and-modules.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ Hello in English: Hello!
355355
Goodbye in English: Goodbye.
356356
```
357357
358+
`pub` also applies to `struct`s and their member fields. In keeping with Rust’s
359+
tendency toward safety, simply making a `struct` public won't automatically
360+
make its members public: you must mark the fields individually with `pub`.
361+
358362
Now that our functions are public, we can use them. Great! However, typing out
359363
`phrases::english::greetings::hello()` is very long and repetitive. Rust has
360364
another keyword for importing names into the current scope, so that you can
@@ -517,9 +521,6 @@ of `foo` relative to where we are. If that’s prefixed with `::`, as in
517521
`::foo::bar()`, it refers to a different `foo`, an absolute path from your
518522
crate root.
519523
520-
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
521-
`use` declarations go first.
522-
523524
This will build and run:
524525
525526
```bash

branches/stable/src/doc/trpl/glossary.md

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,12 @@
33
Not every Rustacean has a background in systems programming, nor in computer
44
science, so we've added explanations of terms that might be unfamiliar.
55

6-
### Arity
7-
8-
Arity refers to the number of arguments a function or operation takes.
9-
10-
```rust
11-
let x = (2, 3);
12-
let y = (4, 6);
13-
let z = (8, 2, 6);
14-
```
15-
16-
In the example above `x` and `y` have arity 2. `z` has arity 3.
17-
186
### Abstract Syntax Tree
197

20-
When a compiler is compiling your program, it does a number of different
21-
things. One of the things that it does is turn the text of your program into an
22-
‘abstract syntax tree’, or ‘AST’. This tree is a representation of the
23-
structure of your program. For example, `2 + 3` can be turned into a tree:
8+
When a compiler is compiling your program, it does a number of different things.
9+
One of the things that it does is turn the text of your program into an
10+
‘abstract syntax tree’, or ‘AST’. This tree is a representation of the structure
11+
of your program. For example, `2 + 3` can be turned into a tree:
2412

2513
```text
2614
+
@@ -37,3 +25,41 @@ And `2 + (3 * 4)` would look like this:
3725
/ \
3826
3 4
3927
```
28+
29+
### Arity
30+
31+
Arity refers to the number of arguments a function or operation takes.
32+
33+
```rust
34+
let x = (2, 3);
35+
let y = (4, 6);
36+
let z = (8, 2, 6);
37+
```
38+
39+
In the example above `x` and `y` have arity 2. `z` has arity 3.
40+
41+
### Expression
42+
43+
In computer programming, an expression is a combination of values, constants,
44+
variables, operators and functions that evaluate to a single value. For example,
45+
`2 + (3 * 4)` is an expression that returns the value 14. It is worth noting
46+
that expressions can have side-effects. For example, a function included in an
47+
expression might perform actions other than simply returning a value.
48+
49+
### Expression-Oriented Language
50+
51+
In early programming languages, [expressions][expression] and
52+
[statements][statement] were two separate syntactic categories: expressions had
53+
a value and statements did things. However, later languages blurred this
54+
distinction, allowing expressions to do things and statements to have a value.
55+
In an expression-oriented language, (nearly) every statement is an expression
56+
and therefore returns a value. Consequently, these expression statements can
57+
themselves form part of larger expressions.
58+
59+
[expression]: glossary.html#expression
60+
[statement]: glossary.html#statement
61+
62+
### Statement
63+
64+
In computer programming, a statement is the smallest standalone element of a
65+
programming language that commands a computer to perform an action.

branches/stable/src/doc/trpl/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ generator, which is local to the particular [thread][concurrency] of execution
499499
we’re in. Because we `use rand::Rng`’d above, it has a `gen_range()` method
500500
available. This method takes two arguments, and generates a number between
501501
them. It’s inclusive on the lower bound, but exclusive on the upper bound,
502-
so we need `1` and `101` to get a number between one and a hundred.
502+
so we need `1` and `101` to get a number ranging from one to a hundred.
503503

504504
[concurrency]: concurrency.html
505505

branches/stable/src/doc/trpl/hello-world.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,13 @@ string to the screen. Easy enough!
111111

112112
[allocation]: the-stack-and-the-heap.html
113113

114-
Finally, the line ends with a semicolon (`;`). Rust is an ‘expression oriented’
115-
language, which means that most things are expressions, rather than statements.
116-
The `;` is used to indicate that this expression is over, and the next one is
117-
ready to begin. Most lines of Rust code end with a `;`.
114+
Finally, the line ends with a semicolon (`;`). Rust is an [‘expression oriented’
115+
language][expression-oriented language], which means that most things are
116+
expressions, rather than statements. The `;` is used to indicate that this
117+
expression is over, and the next one is ready to begin. Most lines of Rust code
118+
end with a `;`.
119+
120+
[expression-oriented language]: glossary.html#expression-oriented-language
118121

119122
Finally, actually compiling and running our program. We can compile with our
120123
compiler, `rustc`, by passing it the name of our source file:

branches/stable/src/doc/trpl/intrinsics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ perform efficient pointer arithmetic, one would import those functions
1111
via a declaration like
1212

1313
```rust
14-
# #![feature(intrinsics)]
14+
#![feature(intrinsics)]
1515
# fn main() {}
1616

1717
extern "rust-intrinsic" {

branches/stable/src/liballoc/arc.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ impl<T: ?Sized> Arc<T> {
200200
/// # Examples
201201
///
202202
/// ```
203-
/// # #![feature(arc_weak)]
203+
/// #![feature(arc_weak)]
204+
///
204205
/// use std::sync::Arc;
205206
///
206207
/// let five = Arc::new(5);
@@ -337,7 +338,8 @@ impl<T: Clone> Arc<T> {
337338
/// # Examples
338339
///
339340
/// ```
340-
/// # #![feature(arc_unique)]
341+
/// #![feature(arc_unique)]
342+
///
341343
/// use std::sync::Arc;
342344
///
343345
/// let mut five = Arc::new(5);
@@ -408,7 +410,8 @@ impl<T: ?Sized> Arc<T> {
408410
/// # Examples
409411
///
410412
/// ```
411-
/// # #![feature(arc_unique, alloc)]
413+
/// #![feature(arc_unique, alloc)]
414+
///
412415
/// extern crate alloc;
413416
/// # fn main() {
414417
/// use alloc::arc::Arc;
@@ -555,7 +558,8 @@ impl<T: ?Sized> Weak<T> {
555558
/// # Examples
556559
///
557560
/// ```
558-
/// # #![feature(arc_weak)]
561+
/// #![feature(arc_weak)]
562+
///
559563
/// use std::sync::Arc;
560564
///
561565
/// let five = Arc::new(5);
@@ -599,7 +603,8 @@ impl<T: ?Sized> Clone for Weak<T> {
599603
/// # Examples
600604
///
601605
/// ```
602-
/// # #![feature(arc_weak)]
606+
/// #![feature(arc_weak)]
607+
///
603608
/// use std::sync::Arc;
604609
///
605610
/// let weak_five = Arc::new(5).downgrade();
@@ -626,7 +631,8 @@ impl<T: ?Sized> Drop for Weak<T> {
626631
/// # Examples
627632
///
628633
/// ```
629-
/// # #![feature(arc_weak)]
634+
/// #![feature(arc_weak)]
635+
///
630636
/// use std::sync::Arc;
631637
///
632638
/// {

branches/stable/src/liballoc/boxed.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ use core::raw::{TraitObject};
7575
/// The following two examples are equivalent:
7676
///
7777
/// ```
78-
/// # #![feature(box_heap)]
78+
/// #![feature(box_heap)]
79+
///
7980
/// #![feature(box_syntax, placement_in_syntax)]
8081
/// use std::boxed::HEAP;
8182
///
@@ -241,7 +242,8 @@ impl<T : ?Sized> Box<T> {
241242
///
242243
/// # Examples
243244
/// ```
244-
/// # #![feature(box_raw)]
245+
/// #![feature(box_raw)]
246+
///
245247
/// let seventeen = Box::new(17u32);
246248
/// let raw = Box::into_raw(seventeen);
247249
/// let boxed_again = unsafe { Box::from_raw(raw) };
@@ -264,7 +266,8 @@ impl<T : ?Sized> Box<T> {
264266
///
265267
/// # Examples
266268
/// ```
267-
/// # #![feature(box_raw)]
269+
/// #![feature(box_raw)]
270+
///
268271
/// use std::boxed;
269272
///
270273
/// let seventeen = Box::new(17u32);
@@ -307,7 +310,8 @@ impl<T: Clone> Clone for Box<T> {
307310
/// # Examples
308311
///
309312
/// ```
310-
/// # #![feature(box_raw)]
313+
/// #![feature(box_raw)]
314+
///
311315
/// let x = Box::new(5);
312316
/// let mut y = Box::new(10);
313317
///

0 commit comments

Comments
 (0)