Skip to content

Commit cec7bc8

Browse files
committed
---
yaml --- r: 233983 b: refs/heads/beta c: 6c9549d h: refs/heads/master i: 233981: 9457a7d 233979: 6b6d353 233975: be760cd 233967: f89b1ad 233951: e63f586 233919: 9026467 233855: 7b6a6a0 233727: bfa9f37 233471: 1bfa0b2 v: v3
1 parent fb71e2d commit cec7bc8

File tree

230 files changed

+14872
-5280
lines changed

Some content is hidden

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

230 files changed

+14872
-5280
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: 17fde3a34d8dfa07378cbff0f2552b41071e032f
26+
refs/heads/beta: 6c9549dd20511769c58e4a0fdd2ffb5c5de7a820
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/mk/crates.mk

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TARGET_CRATES := libc std flate arena term \
5656
alloc_system
5757
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
59-
rustc_data_structures rustc_platform_intrinsics
59+
rustc_data_structures rustc_front rustc_platform_intrinsics
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
6161
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6262

@@ -71,23 +71,24 @@ DEPS_graphviz := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags
7272
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
7373
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
74-
rustc_trans rustc_privacy rustc_lint
74+
rustc_trans rustc_privacy rustc_lint rustc_front
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
77-
log syntax serialize rustc_llvm rustc_platform_intrinsics
78-
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics
79-
DEPS_rustc_borrowck := rustc log graphviz syntax
80-
DEPS_rustc_resolve := rustc log syntax
81-
DEPS_rustc_privacy := rustc log syntax
77+
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
78+
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics
79+
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
80+
DEPS_rustc_resolve := rustc rustc_front log syntax
81+
DEPS_rustc_privacy := rustc rustc_front log syntax
8282
DEPS_rustc_lint := rustc log syntax
8383
DEPS_rustc := syntax flate arena serialize getopts rbml \
8484
log graphviz rustc_llvm rustc_back rustc_data_structures
8585
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
8686
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
87-
DEPS_rustc_back := std syntax rustc_llvm flate log libc
87+
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
88+
DEPS_rustc_front := std syntax log serialize
8889
DEPS_rustc_data_structures := std log serialize
8990
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
90-
test rustc_lint
91+
test rustc_lint rustc_front
9192
DEPS_rustc_bitflags := core
9293
DEPS_flate := std native:miniz
9394
DEPS_arena := std

branches/beta/mk/docs.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ ifdef CFG_DISABLE_DOCS
191191
endif
192192

193193
docs: $(DOC_TARGETS)
194+
doc: docs
194195
compiler-docs: $(COMPILER_DOC_TARGETS)
195196

196197
trpl: doc/book/index.html

branches/beta/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
268268
// FIXME (#9639): This needs to handle non-utf8 paths
269269
let mut args = vec!("-".to_owned(),
270270
"-Zunstable-options".to_owned(),
271-
"--pretty".to_owned(),
271+
"--unpretty".to_owned(),
272272
pretty_type,
273273
format!("--target={}", config.target),
274274
"-L".to_owned(),

branches/beta/src/doc/grammar.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ type_path_tail : '<' type_expr [ ',' type_expr ] + '>'
281281
## Macros
282282

283283
```antlr
284-
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ';'
284+
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ';'
285285
| "macro_rules" '!' ident '{' macro_rule * '}' ;
286286
macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';' ;
287287
matcher : '(' matcher * ')' | '[' matcher * ']'
@@ -306,7 +306,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
306306

307307
```antlr
308308
item : vis ? mod_item | fn_item | type_item | struct_item | enum_item
309-
| const_item | static_item | trait_item | impl_item | extern_block ;
309+
| const_item | static_item | trait_item | impl_item | extern_block_item ;
310310
```
311311

312312
### Type Parameters
@@ -636,31 +636,31 @@ lambda_expr : '|' ident_list '|' expr ;
636636
### While loops
637637

638638
```antlr
639-
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
639+
while_expr : [ lifetime ':' ] ? "while" no_struct_literal_expr '{' block '}' ;
640640
```
641641

642642
### Infinite loops
643643

644644
```antlr
645-
loop_expr : [ lifetime ':' ] "loop" '{' block '}';
645+
loop_expr : [ lifetime ':' ] ? "loop" '{' block '}';
646646
```
647647

648648
### Break expressions
649649

650650
```antlr
651-
break_expr : "break" [ lifetime ];
651+
break_expr : "break" [ lifetime ] ?;
652652
```
653653

654654
### Continue expressions
655655

656656
```antlr
657-
continue_expr : "continue" [ lifetime ];
657+
continue_expr : "continue" [ lifetime ] ?;
658658
```
659659

660660
### For expressions
661661

662662
```antlr
663-
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
663+
for_expr : [ lifetime ':' ] ? "for" pat "in" no_struct_literal_expr '{' block '}' ;
664664
```
665665

666666
### If expressions
@@ -688,13 +688,12 @@ match_pat : pat [ '|' pat ] * [ "if" expr ] ? ;
688688
```antlr
689689
if_let_expr : "if" "let" pat '=' expr '{' block '}'
690690
else_tail ? ;
691-
else_tail : "else" [ if_expr | if_let_expr | '{' block '}' ] ;
692691
```
693692

694693
### While let loops
695694

696695
```antlr
697-
while_let_expr : "while" "let" pat '=' expr '{' block '}' ;
696+
while_let_expr : [ lifetime ':' ] ? "while" "let" pat '=' expr '{' block '}' ;
698697
```
699698

700699
### Return expressions
@@ -754,8 +753,6 @@ return_expr : "return" expr ? ;
754753
```antlr
755754
closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
756755
[ ':' bound-list ] [ '->' type ]
757-
procedure_type := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
758-
[ ':' bound-list ] [ '->' type ]
759756
lifetime-list := lifetime | lifetime ',' lifetime-list
760757
arg-list := ident ':' type | ident ':' type ',' arg-list
761758
bound-list := bound | bound '+' bound-list

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Choosing your Guarantees
22

3-
One important feature of Rust as language is that it lets us control the costs and guarantees
3+
One important feature of Rust is that it lets us control the costs and guarantees
44
of a program.
55

66
There are various &ldquo;wrapper type&rdquo; abstractions in the Rust standard library which embody
@@ -18,9 +18,9 @@ Before proceeding, it is highly recommended that one reads about [ownership][own
1818

1919
## `Box<T>`
2020

21-
[`Box<T>`][box] is pointer which is &ldquo;owned&rdquo;, or a &ldquo;box&rdquo;. While it can hand
22-
out references to the contained data, it is the only owner of the data. In particular, when
23-
something like the following occurs:
21+
[`Box<T>`][box] is an &ldquo;owned&rdquo; pointer, or a &ldquo;box&rdquo;. While it can hand
22+
out references to the contained data, it is the only owner of the data. In particular, consider
23+
the following:
2424

2525
```rust
2626
let x = Box::new(1);
@@ -40,7 +40,7 @@ allowed to share references to this by the regular borrowing rules, checked at c
4040

4141
[box]: ../std/boxed/struct.Box.html
4242

43-
## `&T` and `&mut T`
43+
## `&T` and `&mut T`
4444

4545
These are immutable and mutable references respectively. They follow the &ldquo;read-write lock&rdquo;
4646
pattern, such that one may either have only one mutable reference to some data, or any number of
@@ -243,7 +243,7 @@ Many of the types above cannot be used in a threadsafe manner. Particularly, `Rc
243243
`RefCell<T>`, which both use non-atomic reference counts (_atomic_ reference counts are those which
244244
can be incremented from multiple threads without causing a data race), cannot be used this way. This
245245
makes them cheaper to use, but we need thread safe versions of these too. They exist, in the form of
246-
`Arc<T>` and `Mutex<T>`/`RWLock<T>`
246+
`Arc<T>` and `Mutex<T>`/`RwLock<T>`
247247

248248
Note that the non-threadsafe types _cannot_ be sent between threads, and this is checked at compile
249249
time.

branches/beta/src/doc/trpl/deref-coercions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ Vectors can `Deref` to a slice.
8989

9090
## Deref and method calls
9191

92-
`Deref` will also kick in when calling a method. In other words, these are
93-
the same two things in Rust:
92+
`Deref` will also kick in when calling a method. Consider the following
93+
example.
9494

9595
```rust
9696
struct Foo;
@@ -99,13 +99,13 @@ impl Foo {
9999
fn foo(&self) { println!("Foo"); }
100100
}
101101

102-
let f = Foo;
102+
let f = &&Foo;
103103

104104
f.foo();
105105
```
106106

107-
Even though `f` isn’t a reference, and `foo` takes `&self`, this works.
108-
That’s because these things are the same:
107+
Even though `f` is a `&&Foo` and `foo` takes `&self`, this works. That’s
108+
because these things are the same:
109109

110110
```rust,ignore
111111
f.foo();

branches/beta/src/doc/trpl/rust-inside-other-languages.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,17 @@ And finally, we can try running it:
217217

218218
```bash
219219
$ ruby embed.rb
220+
Thread finished with count=5000000
221+
Thread finished with count=5000000
222+
Thread finished with count=5000000
223+
Thread finished with count=5000000
224+
Thread finished with count=5000000
225+
Thread finished with count=5000000
226+
Thread finished with count=5000000
227+
Thread finished with count=5000000
228+
Thread finished with count=5000000
229+
Thread finished with count=5000000
230+
done!
220231
done!
221232
$
222233
```

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Structs
22

3-
Structs are a way of creating more complex data types. For example, if we were
3+
`struct`s are a way of creating more complex data types. For example, if we were
44
doing calculations involving coordinates in 2D space, we would need both an `x`
55
and a `y` value:
66

@@ -9,7 +9,7 @@ let origin_x = 0;
99
let origin_y = 0;
1010
```
1111

12-
A struct lets us combine these two into a single, unified datatype:
12+
A `struct` lets us combine these two into a single, unified datatype:
1313

1414
```rust
1515
struct Point {
@@ -28,14 +28,14 @@ There’s a lot going on here, so let’s break it down. We declare a `struct` w
2828
the `struct` keyword, and then with a name. By convention, `struct`s begin with
2929
a capital letter and are camel cased: `PointInSpace`, not `Point_In_Space`.
3030

31-
We can create an instance of our struct via `let`, as usual, but we use a `key:
31+
We can create an instance of our `struct` via `let`, as usual, but we use a `key:
3232
value` style syntax to set each field. The order doesn’t need to be the same as
3333
in the original declaration.
3434

3535
Finally, because fields have names, we can access the field through dot
3636
notation: `origin.x`.
3737

38-
The values in structs are immutable by default, like other bindings in Rust.
38+
The values in `struct`s are immutable by default, like other bindings in Rust.
3939
Use `mut` to make them mutable:
4040

4141
```rust
@@ -91,7 +91,7 @@ fn main() {
9191
# Update syntax
9292

9393
A `struct` can include `..` to indicate that you want to use a copy of some
94-
other struct for some of the values. For example:
94+
other `struct` for some of the values. For example:
9595

9696
```rust
9797
struct Point3d {
@@ -121,7 +121,7 @@ let point = Point3d { z: 1, x: 2, .. origin };
121121
# Tuple structs
122122

123123
Rust has another data type that’s like a hybrid between a [tuple][tuple] and a
124-
struct, called a ‘tuple struct’. Tuple structs have a name, but
124+
`struct`, called a ‘tuple struct’. Tuple structs have a name, but
125125
their fields don’t:
126126

127127
```rust
@@ -140,7 +140,7 @@ let black = Color(0, 0, 0);
140140
let origin = Point(0, 0, 0);
141141
```
142142

143-
It is almost always better to use a struct than a tuple struct. We would write
143+
It is almost always better to use a `struct` than a tuple struct. We would write
144144
`Color` and `Point` like this instead:
145145

146146
```rust
@@ -158,7 +158,7 @@ struct Point {
158158
```
159159

160160
Now, we have actual names, rather than positions. Good names are important,
161-
and with a struct, we have actual names.
161+
and with a `struct`, we have actual names.
162162

163163
There _is_ one case when a tuple struct is very useful, though, and that’s a
164164
tuple struct with only one element. We call this the ‘newtype’ pattern, because
@@ -180,13 +180,13 @@ destructuring `let`, just as with regular tuples. In this case, the
180180

181181
# Unit-like structs
182182

183-
You can define a struct with no members at all:
183+
You can define a `struct` with no members at all:
184184

185185
```rust
186186
struct Electron;
187187
```
188188

189-
Such a struct is called ‘unit-like’ because it resembles the empty
189+
Such a `struct` is called ‘unit-like’ because it resembles the empty
190190
tuple, `()`, sometimes called ‘unit’. Like a tuple struct, it defines a
191191
new type.
192192

@@ -195,6 +195,6 @@ marker type), but in combination with other features, it can become
195195
useful. For instance, a library may ask you to create a structure that
196196
implements a certain [trait][trait] to handle events. If you don’t have
197197
any data you need to store in the structure, you can just create a
198-
unit-like struct.
198+
unit-like `struct`.
199199

200200
[trait]: traits.html

branches/beta/src/doc/trpl/the-stack-and-the-heap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ local variables and some other information. This is called a ‘stack frame’,
3838
for the purpose of this tutorial, we’re going to ignore the extra information
3939
and just consider the local variables we’re allocating. So in this case, when
4040
`main()` is run, we’ll allocate a single 32-bit integer for our stack frame.
41-
This is automatically handled for you, as you can see, we didn’t have to write
41+
This is automatically handled for you, as you can see; we didn’t have to write
4242
any special Rust code or anything.
4343

4444
When the function is over, its stack frame gets deallocated. This happens
@@ -51,7 +51,7 @@ we’ll throw them all away at the same time as well, we can get rid of it very
5151
fast too.
5252

5353
The downside is that we can’t keep values around if we need them for longer
54-
than a single function. We also haven’t talked about what that name, ‘stack’
54+
than a single function. We also haven’t talked about what the word, ‘stack’,
5555
means. To do that, we need a slightly more complicated example:
5656

5757
```rust

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ fn normal<T: ConvertTo<i64>>(x: &T) -> i64 {
390390

391391
// can be called with T == i64
392392
fn inverse<T>() -> T
393-
// this is using ConvertTo as if it were "ConvertFrom<i32>"
393+
// this is using ConvertTo as if it were "ConvertTo<i64>"
394394
where i32: ConvertTo<T> {
395395
42.convert()
396396
}

branches/beta/src/grammar/RustLexer.g4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ tokens {
1313
BINOPEQ, AT, DOT, DOTDOT, DOTDOTDOT, COMMA, SEMI, COLON,
1414
MOD_SEP, RARROW, FAT_ARROW, LPAREN, RPAREN, LBRACKET, RBRACKET,
1515
LBRACE, RBRACE, POUND, DOLLAR, UNDERSCORE, LIT_CHAR, LIT_BYTE,
16-
LIT_INTEGER, LIT_FLOAT, LIT_STR, LIT_STR_RAW, LIT_BINARY,
17-
LIT_BINARY_RAW, QUESTION, IDENT, LIFETIME, WHITESPACE, DOC_COMMENT,
16+
LIT_INTEGER, LIT_FLOAT, LIT_STR, LIT_STR_RAW, LIT_BYTE_STR,
17+
LIT_BYTE_STR_RAW, QUESTION, IDENT, LIFETIME, WHITESPACE, DOC_COMMENT,
1818
COMMENT, SHEBANG, UTF8_BOM
1919
}
2020

@@ -148,8 +148,8 @@ LIT_STR
148148
: '"' ('\\\n' | '\\\r\n' | '\\' CHAR_ESCAPE | .)*? '"' SUFFIX?
149149
;
150150

151-
LIT_BINARY : 'b' LIT_STR ;
152-
LIT_BINARY_RAW : 'b' LIT_STR_RAW ;
151+
LIT_BYTE_STR : 'b' LIT_STR ;
152+
LIT_BYTE_STR_RAW : 'b' LIT_STR_RAW ;
153153

154154
/* this is a bit messy */
155155

0 commit comments

Comments
 (0)