Skip to content

Commit e41e05a

Browse files
committed
---
yaml --- r: 216571 b: refs/heads/stable c: 4b46546 h: refs/heads/master i: 216569: 03ac8c2 216567: bc74139 v: v3
1 parent 4651ebc commit e41e05a

File tree

155 files changed

+966
-2163
lines changed

Some content is hidden

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

155 files changed

+966
-2163
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 435622028f37085819843f4ac8938557501f0468
32+
refs/heads/stable: 4b46546af0d230a56b4f66d0fcc2ede7b89c09b5
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ fi
544544
BOOL_OPTIONS=""
545545
VAL_OPTIONS=""
546546

547-
opt debug 0 "debug mode; disables optimization unless \`--enable-optimize\` given"
547+
opt debug 0 "debug mode"
548548
opt valgrind 0 "run tests with valgrind (memcheck by default)"
549549
opt helgrind 0 "run tests with helgrind instead of memcheck"
550550
opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"

branches/stable/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
269269
run_ignored: config.run_ignored,
270270
logfile: config.logfile.clone(),
271271
run_tests: true,
272-
bench_benchmarks: true,
272+
run_benchmarks: true,
273273
nocapture: env::var("RUST_TEST_NOCAPTURE").is_ok(),
274274
color: test::AutoColor,
275275
}

branches/stable/src/doc/grammar.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,9 @@ excluded from the `ident` rule.
176176

177177
```antlr
178178
lit_suffix : ident;
179-
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit | bool_lit ] lit_suffix ?;
179+
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit ] lit_suffix ?;
180180
```
181181

182-
The optional `lit_suffix` production is only used for certain numeric literals,
183-
but is reserved for future extension. That is, the above gives the lexical
184-
grammar, but a Rust parser will reject everything but the 12 special cases
185-
mentioned in [Number literals](reference.html#number-literals) in the
186-
reference.
187-
188182
#### Character and string literals
189183

190184
```antlr
@@ -244,9 +238,7 @@ dec_lit : [ dec_digit | '_' ] + ;
244238

245239
#### Boolean literals
246240

247-
```antlr
248-
bool_lit : [ "true" | "false" ] ;
249-
```
241+
**FIXME:** write grammar
250242

251243
The two values of the boolean type are written `true` and `false`.
252244

@@ -305,7 +297,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
305297

306298
```antlr
307299
item : mod_item | fn_item | type_item | struct_item | enum_item
308-
| const_item | static_item | trait_item | impl_item | extern_block ;
300+
| static_item | trait_item | impl_item | extern_block ;
309301
```
310302

311303
### Type Parameters
@@ -377,10 +369,6 @@ path_item : ident | "mod" ;
377369

378370
**FIXME:** grammar?
379371

380-
### Enumerations
381-
382-
**FIXME:** grammar?
383-
384372
### Constant items
385373

386374
```antlr

branches/stable/src/doc/reference.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ of tokens, that immediately and directly denotes the value it evaluates to,
130130
rather than referring to it by name or some other evaluation rule. A literal is
131131
a form of constant expression, so is evaluated (primarily) at compile time.
132132

133+
The optional suffix is only used for certain numeric literals, but is
134+
reserved for future extension, that is, the above gives the lexical
135+
grammar, but a Rust parser will reject everything but the 12 special
136+
cases mentioned in [Number literals](#number-literals) below.
137+
133138
#### Examples
134139

135140
##### Characters and strings
@@ -1557,7 +1562,8 @@ warnings are generated, or otherwise "you used a private item of another module
15571562
and weren't allowed to."
15581563

15591564
By default, everything in Rust is *private*, with one exception. Enum variants
1560-
in a `pub` enum are also public by default. When an item is declared as `pub`,
1565+
in a `pub` enum are also public by default. You are allowed to alter this
1566+
default visibility with the `priv` keyword. When an item is declared as `pub`,
15611567
it can be thought of as being accessible to the outside world. For example:
15621568

15631569
```
@@ -2044,21 +2050,21 @@ A complete list of the built-in language items will be added in the future.
20442050

20452051
### Inline attributes
20462052

2047-
The inline attribute suggests that the compiler should place a copy of
2048-
the function or static in the caller, rather than generating code to
2049-
call the function or access the static where it is defined.
2053+
The inline attribute is used to suggest to the compiler to perform an inline
2054+
expansion and place a copy of the function or static in the caller rather than
2055+
generating code to call the function or access the static where it is defined.
20502056

20512057
The compiler automatically inlines functions based on internal heuristics.
2052-
Incorrectly inlining functions can actually make the program slower, so it
2058+
Incorrectly inlining functions can actually making the program slower, so it
20532059
should be used with care.
20542060

20552061
Immutable statics are always considered inlineable unless marked with
20562062
`#[inline(never)]`. It is undefined whether two different inlineable statics
20572063
have the same memory address. In other words, the compiler is free to collapse
20582064
duplicate inlineable statics together.
20592065

2060-
`#[inline]` and `#[inline(always)]` always cause the function to be serialized
2061-
into the crate metadata to allow cross-crate inlining.
2066+
`#[inline]` and `#[inline(always)]` always causes the function to be serialized
2067+
into crate metadata to allow cross-crate inlining.
20622068

20632069
There are three different types of inline attributes:
20642070

@@ -2425,18 +2431,11 @@ Tuples are written by enclosing zero or more comma-separated expressions in
24252431
parentheses. They are used to create [tuple-typed](#tuple-types) values.
24262432

24272433
```{.tuple}
2434+
(0,);
24282435
(0.0, 4.5);
24292436
("a", 4usize, true);
24302437
```
24312438

2432-
You can disambiguate a single-element tuple from a value in parentheses with a
2433-
comma:
2434-
2435-
```
2436-
(0,); // single-element tuple
2437-
(0); // zero in parentheses
2438-
```
2439-
24402439
### Unit expressions
24412440

24422441
The expression `()` denotes the _unit value_, the only value of the type with

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ want to dive in with a project, or ‘Syntax and Semantics’ if you prefer to
4040
start small, and learn a single concept thoroughly before moving onto the next.
4141
Copious cross-linking connects these parts together.
4242

43-
### Contributing
44-
45-
The source files from which this book is generated can be found on Github:
46-
[github.com/rust-lang/rust/tree/master/src/doc/trpl](https://github.com/rust-lang/rust/tree/master/src/doc/trpl)
47-
4843
## A brief introduction to Rust
4944

5045
Is Rust a language you might be interested in? Let’s examine a few small code
@@ -195,5 +190,5 @@ fn main() {
195190
We created an inner scope with an additional set of curly braces. `y` will go out of
196191
scope before we call `push()`, and so we’re all good.
197192

198-
This concept of ownership isn’t just good for preventing dangling pointers, but an
193+
This concept of ownership isn’t just good for preventing danging pointers, but an
199194
entire set of related problems, like iterator invalidation, concurrency, and more.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,5 @@
6464
* [Benchmark Tests](benchmark-tests.md)
6565
* [Box Syntax and Patterns](box-syntax-and-patterns.md)
6666
* [Slice Patterns](slice-patterns.md)
67-
* [Associated Constants](associated-constants.md)
6867
* [Glossary](glossary.md)
6968
* [Academic Research](academic-research.md)

branches/stable/src/doc/trpl/associated-constants.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ Rust attributes are used for a number of different things. There is a full list
6767
of attributes [in the reference][reference]. Currently, you are not allowed to
6868
create your own attributes, the Rust compiler defines them.
6969

70-
[reference]: ../reference.html#attributes
70+
[reference]: reference.html#attributes

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ use std::thread;
116116
fn main() {
117117
let mut data = vec![1u32, 2, 3];
118118
119-
for i in 0..3 {
119+
for i in 0..2 {
120120
thread::spawn(move || {
121121
data[i] += 1;
122122
});
@@ -154,7 +154,7 @@ use std::sync::Mutex;
154154
fn main() {
155155
let mut data = Mutex::new(vec![1u32, 2, 3]);
156156
157-
for i in 0..3 {
157+
for i in 0..2 {
158158
let data = data.lock().unwrap();
159159
thread::spawn(move || {
160160
data[i] += 1;
@@ -196,7 +196,7 @@ use std::thread;
196196
fn main() {
197197
let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
198198
199-
for i in 0..3 {
199+
for i in 0..2 {
200200
let data = data.clone();
201201
thread::spawn(move || {
202202
let mut data = data.lock().unwrap();
@@ -217,7 +217,7 @@ thread more closely:
217217
# use std::thread;
218218
# fn main() {
219219
# let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
220-
# for i in 0..3 {
220+
# for i in 0..2 {
221221
# let data = data.clone();
222222
thread::spawn(move || {
223223
let mut data = data.lock().unwrap();

branches/stable/src/doc/trpl/const-and-static.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ this reason.
1919
# `static`
2020

2121
Rust provides a ‘global variable’ sort of facility in static items. They’re
22-
similar to constants, but static items aren’t inlined upon use. This means that
23-
there is only one instance for each value, and it’s at a fixed location in
24-
memory.
22+
similar to [constants][const], but static items aren’t inlined upon use. This
23+
means that there is only one instance for each value, and it’s at a fixed
24+
location in memory.
2525

2626
Here’s an example:
2727

2828
```rust
2929
static N: i32 = 5;
3030
```
3131

32+
[const]: const.html
33+
3234
Unlike [`let`][let] bindings, you must annotate the type of a `static`.
3335

3436
[let]: variable-bindings.html

branches/stable/src/doc/trpl/inline-assembly.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ but you must add the right number of `:` if you skip them:
5858
asm!("xor %eax, %eax"
5959
:
6060
:
61-
: "{eax}"
61+
: "eax"
6262
);
6363
# } }
6464
```
@@ -69,21 +69,21 @@ Whitespace also doesn't matter:
6969
# #![feature(asm)]
7070
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
7171
# fn main() { unsafe {
72-
asm!("xor %eax, %eax" ::: "{eax}");
72+
asm!("xor %eax, %eax" ::: "eax");
7373
# } }
7474
```
7575

7676
## Operands
7777

7878
Input and output operands follow the same format: `:
7979
"constraints1"(expr1), "constraints2"(expr2), ..."`. Output operand
80-
expressions must be mutable lvalues, or not yet assigned:
80+
expressions must be mutable lvalues:
8181

8282
```
8383
# #![feature(asm)]
8484
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
8585
fn add(a: i32, b: i32) -> i32 {
86-
let c: i32;
86+
let mut c = 0;
8787
unsafe {
8888
asm!("add $2, $0"
8989
: "=r"(c)
@@ -100,22 +100,6 @@ fn main() {
100100
}
101101
```
102102

103-
If you would like to use real operands in this position, however,
104-
you are required to put curly braces `{}` around the register that
105-
you want, and you are required to put the specific size of the
106-
operand. This is useful for very low level programming, where
107-
which register you use is important:
108-
109-
```
110-
# #![feature(asm)]
111-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
112-
# unsafe fn read_byte_in(port: u16) -> u8 {
113-
let result: u8;
114-
asm!("in %dx, %al" : "={al}"(result) : "{dx}"(port));
115-
result
116-
# }
117-
```
118-
119103
## Clobbers
120104

121105
Some instructions modify registers which might otherwise have held
@@ -128,7 +112,7 @@ stay valid.
128112
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
129113
# fn main() { unsafe {
130114
// Put the value 0x200 in eax
131-
asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "{eax}");
115+
asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "eax");
132116
# } }
133117
```
134118

@@ -155,14 +139,3 @@ Current valid options are:
155139
the compiler to insert its usual stack alignment code
156140
3. *intel* - use intel syntax instead of the default AT&T.
157141

158-
```
159-
# #![feature(asm)]
160-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
161-
# fn main() {
162-
let result: i32;
163-
unsafe {
164-
asm!("mov eax, 2" : "={eax}"(result) : : : "intel")
165-
}
166-
println!("eax is currently {}", result);
167-
# }
168-
```

0 commit comments

Comments
 (0)