Skip to content

Commit 387989f

Browse files
committed
---
yaml --- r: 234039 b: refs/heads/beta c: f84d53c h: refs/heads/master i: 234037: 75fa6bd 234035: 27e46e2 234031: fe5898c v: v3
1 parent ef3f092 commit 387989f

File tree

293 files changed

+18173
-5951
lines changed

Some content is hidden

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

293 files changed

+18173
-5951
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: 3fa1ee4677d756fa38884766b39d65633261235b
26+
refs/heads/beta: f84d53ca0afaeac14903d16ab24455f6170795e1
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,16 +1180,27 @@ do
11801180
# MSVC requires cmake because that's how we're going to build LLVM
11811181
probe_need CFG_CMAKE cmake
11821182

1183+
# There are three builds of cmake on windows: MSVC, MinGW and Cygwin
1184+
# The Cygwin build does not have generators for Visual Studio, so
1185+
# detect that here and error.
1186+
if ! "$CFG_CMAKE" --help | sed -n '/^Generators/,$p' | grep 'Visual Studio' > /dev/null
1187+
then
1188+
err "cmake does not support Visual Studio generators.\n\n \
1189+
This is likely due to it being an msys/cygwin build of cmake, \
1190+
rather than the required windows version, built using MinGW \
1191+
or Visual Studio."
1192+
fi
1193+
11831194
# Use the REG program to figure out where VS is installed
11841195
# We need to figure out where cl.exe and link.exe are, so we do some
11851196
# munging and some probing here. We also look for the default
11861197
# INCLUDE and LIB variables for MSVC so we can set those in the
11871198
# build system as well.
1188-
install=$(reg QUERY \
1199+
install=$(cmd //c reg QUERY \
11891200
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
11901201
-v InstallDir)
11911202
if [ -z "$install" ]; then
1192-
install=$(reg QUERY \
1203+
install=$(cmd //c reg QUERY \
11931204
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
11941205
-v InstallDir)
11951206
fi
@@ -1222,9 +1233,9 @@ do
12221233
eval CFG_MSVC_LINK_$bits="\"$bindir/link.exe\""
12231234

12241235
vcvarsall="${CFG_MSVC_ROOT}/VC/vcvarsall.bat"
1225-
include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%")
1236+
include_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !INCLUDE!)
12261237
need_ok "failed to learn about MSVC's INCLUDE"
1227-
lib_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %LIB%")
1238+
lib_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !LIB!)
12281239
need_ok "failed to learn about MSVC's LIB"
12291240

12301241
eval CFG_MSVC_INCLUDE_PATH_${bits}="\"$include_path\""

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/mk/rt.mk

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ BACKTRACE_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),backtrace)
259259
BACKTRACE_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(BACKTRACE_NAME_$(1))
260260
BACKTRACE_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libbacktrace
261261

262-
# We don't use this on platforms that aren't linux-based, so just make the file
263-
# available, the compilation of libstd won't actually build it.
262+
# We don't use this on platforms that aren't linux-based (with the exception of
263+
# msys2/mingw builds on windows, which use it to read the dwarf debug
264+
# information) so just make the file available, the compilation of libstd won't
265+
# actually build it.
264266
ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin)
265267
# See comment above
266268
$$(BACKTRACE_LIB_$(1)):
@@ -273,7 +275,7 @@ $$(BACKTRACE_LIB_$(1)):
273275
touch $$@
274276
else
275277

276-
ifeq ($$(CFG_WINDOWSY_$(1)),1)
278+
ifeq ($$(findstring msvc,$(1)),msvc)
277279
# See comment above
278280
$$(BACKTRACE_LIB_$(1)):
279281
touch $$@
@@ -296,16 +298,25 @@ endif
296298
# ./configure script. This is done to force libbacktrace to *not* use the
297299
# atomic/sync functionality because it pulls in unnecessary dependencies and we
298300
# never use it anyway.
301+
#
302+
# We also use `env PWD=` to clear the PWD environment variable, and then
303+
# execute the command in a new shell. This is necessary to workaround a
304+
# buildbot/msys2 bug: the shell is launched with PWD set to a windows-style path,
305+
# which results in all further uses of `pwd` also printing a windows-style path,
306+
# which breaks libbacktrace's configure script. Clearing PWD within the same
307+
# shell is not sufficient.
308+
299309
$$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
300310
@$$(call E, configure: libbacktrace for $(1))
301311
$$(Q)rm -rf $$(BACKTRACE_BUILD_DIR_$(1))
302312
$$(Q)mkdir -p $$(BACKTRACE_BUILD_DIR_$(1))
303-
$$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && \
313+
$$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && env \
314+
PWD= \
304315
CC="$$(CC_$(1))" \
305316
AR="$$(AR_$(1))" \
306317
RANLIB="$$(AR_$(1)) s" \
307318
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) -fno-stack-protector" \
308-
$(S)src/libbacktrace/configure --target=$(1) --host=$(CFG_BUILD))
319+
$(S)src/libbacktrace/configure --build=$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$(CFG_GNU_TRIPLE_$(1)))
309320
$$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \
310321
$$(BACKTRACE_BUILD_DIR_$(1))/config.h
311322
$$(Q)echo '#undef HAVE_SYNC_FUNCTIONS' >> \
@@ -317,7 +328,7 @@ $$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS)
317328
INCDIR=$(S)src/libbacktrace
318329
$$(Q)cp $$(BACKTRACE_BUILD_DIR_$(1))/.libs/libbacktrace.a $$@
319330

320-
endif # endif for windowsy
331+
endif # endif for msvc
321332
endif # endif for ios
322333
endif # endif for darwin
323334

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/reference.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,16 +3200,6 @@ let z = match x { &0 => "zero", _ => "some" };
32003200
assert_eq!(y, z);
32013201
```
32023202

3203-
A pattern that's just an identifier, like `Nil` in the previous example, could
3204-
either refer to an enum variant that's in scope, or bind a new variable. The
3205-
compiler resolves this ambiguity by forbidding variable bindings that occur in
3206-
`match` patterns from shadowing names of variants that are in scope. For
3207-
example, wherever `List` is in scope, a `match` pattern would not be able to
3208-
bind `Nil` as a new name. The compiler interprets a variable pattern `x` as a
3209-
binding _only_ if there is no variant named `x` in scope. A convention you can
3210-
use to avoid conflicts is simply to name variants with upper-case letters, and
3211-
local variables with lower-case letters.
3212-
32133203
Multiple match patterns may be joined with the `|` operator. A range of values
32143204
may be specified with `...`. For example:
32153205

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/method-syntax.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ can be awkward. Consider this code:
77
baz(bar(foo));
88
```
99

10-
We would read this left-to right, and so we see ‘baz bar foo’. But this isn’t the
10+
We would read this left-to-right, and so we see ‘baz bar foo’. But this isn’t the
1111
order that the functions would get called in, that’s inside-out: ‘foo bar baz’.
1212
Wouldn’t it be nice if we could do this instead?
1313

@@ -45,17 +45,17 @@ This will print `12.566371`.
4545

4646

4747

48-
We’ve made a struct that represents a circle. We then write an `impl` block,
48+
We’ve made a `struct` that represents a circle. We then write an `impl` block,
4949
and inside it, define a method, `area`.
5050

51-
Methods take a special first parameter, of which there are three variants:
51+
Methods take a special first parameter, of which there are three variants:
5252
`self`, `&self`, and `&mut self`. You can think of this first parameter as
5353
being the `foo` in `foo.bar()`. The three variants correspond to the three
5454
kinds of things `foo` could be: `self` if it’s just a value on the stack,
5555
`&self` if it’s a reference, and `&mut self` if it’s a mutable reference.
5656
Because we took the `&self` parameter to `area`, we can use it just like any
5757
other parameter. Because we know it’s a `Circle`, we can access the `radius`
58-
just like we would with any other struct.
58+
just like we would with any other `struct`.
5959

6060
We should default to using `&self`, as you should prefer borrowing over taking
6161
ownership, as well as taking immutable references over mutable ones. Here’s an
@@ -120,12 +120,12 @@ Check the return type:
120120
```rust
121121
# struct Circle;
122122
# impl Circle {
123-
fn grow(&self) -> Circle {
123+
fn grow(&self, increment: f64) -> Circle {
124124
# Circle } }
125125
```
126126

127127
We just say we’re returning a `Circle`. With this method, we can grow a new
128-
circle to any arbitrary size.
128+
`Circle` to any arbitrary size.
129129

130130
# Associated functions
131131

@@ -161,7 +161,7 @@ methods’.
161161

162162
# Builder Pattern
163163

164-
Let’s say that we want our users to be able to create Circles, but we will
164+
Let’s say that we want our users to be able to create `Circle`s, but we will
165165
allow them to only set the properties they care about. Otherwise, the `x`
166166
and `y` attributes will be `0.0`, and the `radius` will be `1.0`. Rust doesn’t
167167
have method overloading, named arguments, or variable arguments. We employ
@@ -224,7 +224,7 @@ fn main() {
224224
}
225225
```
226226

227-
What we’ve done here is make another struct, `CircleBuilder`. We’ve defined our
227+
What we’ve done here is make another `struct`, `CircleBuilder`. We’ve defined our
228228
builder methods on it. We’ve also defined our `area()` method on `Circle`. We
229229
also made one more method on `CircleBuilder`: `finalize()`. This method creates
230230
our final `Circle` from the builder. Now, we’ve used the type system to enforce

0 commit comments

Comments
 (0)