Skip to content

Commit 6798c44

Browse files
committed
---
yaml --- r: 224425 b: refs/heads/beta c: 43b2c47 h: refs/heads/master i: 224423: e9fbedc v: v3
1 parent 832927e commit 6798c44

File tree

140 files changed

+7288
-1295
lines changed

Some content is hidden

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

140 files changed

+7288
-1295
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 35d95515f3de27c0e1a7d67893fcad8d0ad6fac9
26+
refs/heads/beta: 43b2c4781e5d6e25dedfc480218ceda92d9dffad
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
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
911
*.woff binary

branches/beta/configure

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

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

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

Lines changed: 4 additions & 6 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 “read-write lock”
45+
These are immutable and mutable references respectively. They follow the &lquo;read-write lock&rquo;
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-
`Cell`s provide interior mutability. In other words, they contain data which can be manipulated even
111+
&lquo;Cell&rquo;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,8 +127,7 @@ 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;
131-
130+
# use std::cell::Cell;
132131
let x = Cell::new(1);
133132
let y = &x;
134133
let z = &x;
@@ -186,8 +185,7 @@ any other borrows active when a mutable borrow is active. If the programmer atte
186185
borrow, the thread will panic.
187186

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

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,6 @@ 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-
362358
Now that our functions are public, we can use them. Great! However, typing out
363359
`phrases::english::greetings::hello()` is very long and repetitive. Rust has
364360
another keyword for importing names into the current scope, so that you can
@@ -521,6 +517,9 @@ of `foo` relative to where we are. If that’s prefixed with `::`, as in
521517
`::foo::bar()`, it refers to a different `foo`, an absolute path from your
522518
crate root.
523519
520+
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
521+
`use` declarations go first.
522+
524523
This will build and run:
525524
526525
```bash

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

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@
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+
618
### Abstract Syntax Tree
719

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:
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:
1224

1325
```text
1426
+
@@ -25,41 +37,3 @@ And `2 + (3 * 4)` would look like this:
2537
/ \
2638
3 4
2739
```
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/beta/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 ranging from one to a hundred.
502+
so we need `1` and `101` to get a number between one and a hundred.
503503

504504
[concurrency]: concurrency.html
505505

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,10 @@ 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][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
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 `;`.
121118

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

branches/beta/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/beta/src/liballoc/arc.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ impl<T: ?Sized> Arc<T> {
200200
/// # Examples
201201
///
202202
/// ```
203-
/// #![feature(arc_weak)]
204-
///
203+
/// # #![feature(arc_weak)]
205204
/// use std::sync::Arc;
206205
///
207206
/// let five = Arc::new(5);
@@ -338,8 +337,7 @@ impl<T: Clone> Arc<T> {
338337
/// # Examples
339338
///
340339
/// ```
341-
/// #![feature(arc_unique)]
342-
///
340+
/// # #![feature(arc_unique)]
343341
/// use std::sync::Arc;
344342
///
345343
/// let mut five = Arc::new(5);
@@ -410,8 +408,7 @@ impl<T: ?Sized> Arc<T> {
410408
/// # Examples
411409
///
412410
/// ```
413-
/// #![feature(arc_unique, alloc)]
414-
///
411+
/// # #![feature(arc_unique, alloc)]
415412
/// extern crate alloc;
416413
/// # fn main() {
417414
/// use alloc::arc::Arc;
@@ -558,8 +555,7 @@ impl<T: ?Sized> Weak<T> {
558555
/// # Examples
559556
///
560557
/// ```
561-
/// #![feature(arc_weak)]
562-
///
558+
/// # #![feature(arc_weak)]
563559
/// use std::sync::Arc;
564560
///
565561
/// let five = Arc::new(5);
@@ -603,8 +599,7 @@ impl<T: ?Sized> Clone for Weak<T> {
603599
/// # Examples
604600
///
605601
/// ```
606-
/// #![feature(arc_weak)]
607-
///
602+
/// # #![feature(arc_weak)]
608603
/// use std::sync::Arc;
609604
///
610605
/// let weak_five = Arc::new(5).downgrade();
@@ -631,8 +626,7 @@ impl<T: ?Sized> Drop for Weak<T> {
631626
/// # Examples
632627
///
633628
/// ```
634-
/// #![feature(arc_weak)]
635-
///
629+
/// # #![feature(arc_weak)]
636630
/// use std::sync::Arc;
637631
///
638632
/// {

branches/beta/src/liballoc/boxed.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ use core::raw::{TraitObject};
7575
/// The following two examples are equivalent:
7676
///
7777
/// ```
78-
/// #![feature(box_heap)]
79-
///
78+
/// # #![feature(box_heap)]
8079
/// #![feature(box_syntax, placement_in_syntax)]
8180
/// use std::boxed::HEAP;
8281
///
@@ -242,8 +241,7 @@ impl<T : ?Sized> Box<T> {
242241
///
243242
/// # Examples
244243
/// ```
245-
/// #![feature(box_raw)]
246-
///
244+
/// # #![feature(box_raw)]
247245
/// let seventeen = Box::new(17u32);
248246
/// let raw = Box::into_raw(seventeen);
249247
/// let boxed_again = unsafe { Box::from_raw(raw) };
@@ -266,8 +264,7 @@ impl<T : ?Sized> Box<T> {
266264
///
267265
/// # Examples
268266
/// ```
269-
/// #![feature(box_raw)]
270-
///
267+
/// # #![feature(box_raw)]
271268
/// use std::boxed;
272269
///
273270
/// let seventeen = Box::new(17u32);
@@ -310,8 +307,7 @@ impl<T: Clone> Clone for Box<T> {
310307
/// # Examples
311308
///
312309
/// ```
313-
/// #![feature(box_raw)]
314-
///
310+
/// # #![feature(box_raw)]
315311
/// let x = Box::new(5);
316312
/// let mut y = Box::new(10);
317313
///

0 commit comments

Comments
 (0)