Skip to content

Commit 6867deb

Browse files
committed
---
yaml --- r: 231770 b: refs/heads/auto c: 52417d5 h: refs/heads/master v: v3
1 parent 4d3e7a9 commit 6867deb

File tree

138 files changed

+953
-2270
lines changed

Some content is hidden

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

138 files changed

+953
-2270
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 668dac477eeb8b7d7bf0556c77bbc3292e5c7cc2
11+
refs/heads/auto: 52417d5b5c4298548d42528a2c0909bc82bacc95
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,27 +1180,16 @@ 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-
11941183
# Use the REG program to figure out where VS is installed
11951184
# We need to figure out where cl.exe and link.exe are, so we do some
11961185
# munging and some probing here. We also look for the default
11971186
# INCLUDE and LIB variables for MSVC so we can set those in the
11981187
# build system as well.
1199-
install=$(cmd //c reg QUERY \
1188+
install=$(reg QUERY \
12001189
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
12011190
-v InstallDir)
12021191
if [ -z "$install" ]; then
1203-
install=$(cmd //c reg QUERY \
1192+
install=$(reg QUERY \
12041193
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
12051194
-v InstallDir)
12061195
fi
@@ -1233,9 +1222,9 @@ do
12331222
eval CFG_MSVC_LINK_$bits="\"$bindir/link.exe\""
12341223

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

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

branches/auto/mk/rt.mk

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,8 @@ 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 (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.
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.
266264
ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin)
267265
# See comment above
268266
$$(BACKTRACE_LIB_$(1)):
@@ -275,7 +273,7 @@ $$(BACKTRACE_LIB_$(1)):
275273
touch $$@
276274
else
277275

278-
ifeq ($$(findstring msvc,$(1)),msvc)
276+
ifeq ($$(CFG_WINDOWSY_$(1)),1)
279277
# See comment above
280278
$$(BACKTRACE_LIB_$(1)):
281279
touch $$@
@@ -298,25 +296,16 @@ endif
298296
# ./configure script. This is done to force libbacktrace to *not* use the
299297
# atomic/sync functionality because it pulls in unnecessary dependencies and we
300298
# 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-
309299
$$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
310300
@$$(call E, configure: libbacktrace for $(1))
311301
$$(Q)rm -rf $$(BACKTRACE_BUILD_DIR_$(1))
312302
$$(Q)mkdir -p $$(BACKTRACE_BUILD_DIR_$(1))
313-
$$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && env \
314-
PWD= \
303+
$$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && \
315304
CC="$$(CC_$(1))" \
316305
AR="$$(AR_$(1))" \
317306
RANLIB="$$(AR_$(1)) s" \
318307
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) -fno-stack-protector" \
319-
$(S)src/libbacktrace/configure --build=$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$(CFG_GNU_TRIPLE_$(1)))
308+
$(S)src/libbacktrace/configure --target=$(1) --host=$(CFG_BUILD))
320309
$$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \
321310
$$(BACKTRACE_BUILD_DIR_$(1))/config.h
322311
$$(Q)echo '#undef HAVE_SYNC_FUNCTIONS' >> \
@@ -328,7 +317,7 @@ $$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS)
328317
INCDIR=$(S)src/libbacktrace
329318
$$(Q)cp $$(BACKTRACE_BUILD_DIR_$(1))/.libs/libbacktrace.a $$@
330319

331-
endif # endif for msvc
320+
endif # endif for windowsy
332321
endif # endif for ios
333322
endif # endif for darwin
334323

branches/auto/src/doc/grammar.md

Lines changed: 11 additions & 8 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_item ;
309+
| const_item | static_item | trait_item | impl_item | extern_block ;
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,12 +688,13 @@ 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 '}' ] ;
691692
```
692693

693694
### While let loops
694695

695696
```antlr
696-
while_let_expr : [ lifetime ':' ] ? "while" "let" pat '=' expr '{' block '}' ;
697+
while_let_expr : "while" "let" pat '=' expr '{' block '}' ;
697698
```
698699

699700
### Return expressions
@@ -753,6 +754,8 @@ return_expr : "return" expr ? ;
753754
```antlr
754755
closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
755756
[ ':' bound-list ] [ '->' type ]
757+
procedure_type := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
758+
[ ':' bound-list ] [ '->' type ]
756759
lifetime-list := lifetime | lifetime ',' lifetime-list
757760
arg-list := ident ':' type | ident ':' type ',' arg-list
758761
bound-list := bound | bound '+' bound-list

branches/auto/src/doc/reference.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,6 +3200,16 @@ 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+
32033213
Multiple match patterns may be joined with the `|` operator. A range of values
32043214
may be specified with `...`. For example:
32053215

branches/auto/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 is that it lets us control the costs and guarantees
3+
One important feature of Rust as language 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 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:
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:
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/auto/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. Consider the following
93-
example.
92+
`Deref` will also kick in when calling a method. In other words, these are
93+
the same two things in Rust:
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` is a `&&Foo` and `foo` takes `&self`, this works. That’s
108-
because these things are the same:
107+
Even though `f` isn’t a reference, and `foo` takes `&self`, this works.
108+
That’s because these things are the same:
109109

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

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,6 @@ 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!
231220
done!
232221
$
233222
```

branches/auto/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 the word, ‘stack’,
54+
than a single function. We also haven’t talked about what that name, ‘stack’
5555
means. To do that, we need a slightly more complicated example:
5656

5757
```rust

branches/auto/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 "ConvertTo<i64>"
393+
// this is using ConvertTo as if it were "ConvertFrom<i32>"
394394
where i32: ConvertTo<T> {
395395
42.convert()
396396
}

branches/auto/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_BYTE_STR,
17-
LIT_BYTE_STR_RAW, QUESTION, IDENT, LIFETIME, WHITESPACE, DOC_COMMENT,
16+
LIT_INTEGER, LIT_FLOAT, LIT_STR, LIT_STR_RAW, LIT_BINARY,
17+
LIT_BINARY_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_BYTE_STR : 'b' LIT_STR ;
152-
LIT_BYTE_STR_RAW : 'b' LIT_STR_RAW ;
151+
LIT_BINARY : 'b' LIT_STR ;
152+
LIT_BINARY_RAW : 'b' LIT_STR_RAW ;
153153

154154
/* this is a bit messy */
155155

branches/auto/src/grammar/lexer.l

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ while { return WHILE; }
200200
<ltorchar><<EOF>> { BEGIN(INITIAL); return -1; }
201201

202202
b\x22 { BEGIN(bytestr); yymore(); }
203-
<bytestr>\x22 { BEGIN(suffix); return LIT_BYTE_STR; }
203+
<bytestr>\x22 { BEGIN(suffix); return LIT_BINARY; }
204204

205205
<bytestr><<EOF>> { return -1; }
206206
<bytestr>\\[n\nrt\\\x27\x220] { yymore(); }
@@ -210,7 +210,7 @@ b\x22 { BEGIN(bytestr); yymore(); }
210210
<bytestr>(.|\n) { yymore(); }
211211

212212
br\x22 { BEGIN(rawbytestr_nohash); yymore(); }
213-
<rawbytestr_nohash>\x22 { BEGIN(suffix); return LIT_BYTE_STR_RAW; }
213+
<rawbytestr_nohash>\x22 { BEGIN(suffix); return LIT_BINARY_RAW; }
214214
<rawbytestr_nohash>(.|\n) { yymore(); }
215215
<rawbytestr_nohash><<EOF>> { return -1; }
216216

@@ -228,7 +228,7 @@ br/# {
228228
end_hashes++;
229229
if (end_hashes == num_hashes) {
230230
BEGIN(INITIAL);
231-
return LIT_BYTE_STR_RAW;
231+
return LIT_BINARY_RAW;
232232
}
233233
}
234234
yymore();
@@ -237,7 +237,7 @@ br/# {
237237
end_hashes = 1;
238238
if (end_hashes == num_hashes) {
239239
BEGIN(INITIAL);
240-
return LIT_BYTE_STR_RAW;
240+
return LIT_BINARY_RAW;
241241
}
242242
yymore();
243243
}

0 commit comments

Comments
 (0)