Skip to content

Commit 307f99f

Browse files
committed
---
yaml --- r: 236495 b: refs/heads/auto c: db18718 h: refs/heads/master i: 236493: cb9bb54 236491: 5ab51dd 236487: f1640eb 236479: 726999d v: v3
1 parent 0694927 commit 307f99f

File tree

164 files changed

+851
-1356
lines changed

Some content is hidden

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

164 files changed

+851
-1356
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: 219eca11b044de3644b3e9101124513c1a842b09
11+
refs/heads/auto: db187188098ebce87ad5d9cf0cb2d7faf8673ba5
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,12 +1295,6 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
12951295
putvar CFG_MSVC_LIB_PATH_${bits}
12961296
;;
12971297

1298-
*-rumprun-netbsd)
1299-
step_msg "targeting rumprun-netbsd, disabling jemalloc"
1300-
CFG_DISABLE_JEMALLOC=1
1301-
putvar CFG_DISABLE_JEMALLOC
1302-
;;
1303-
13041298
*)
13051299
;;
13061300
esac

branches/auto/mk/cfg/x86_64-rumprun-netbsd.mk

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

branches/auto/src/compiletest/compiletest.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
348348
if !full_version_line.trim().is_empty() => {
349349
let full_version_line = full_version_line.trim();
350350

351-
// used to be a regex "(^|[^0-9])([0-9]\.[0-9]+)"
351+
// used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)"
352352
for (pos, c) in full_version_line.char_indices() {
353353
if !c.is_digit(10) { continue }
354354
if pos + 2 >= full_version_line.len() { continue }
@@ -357,12 +357,11 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
357357
if pos > 0 && full_version_line.char_at_reverse(pos).is_digit(10) {
358358
continue
359359
}
360-
let mut end = pos + 3;
361-
while end < full_version_line.len() &&
362-
full_version_line.char_at(end).is_digit(10) {
363-
end += 1;
360+
if pos + 3 < full_version_line.len() &&
361+
full_version_line.char_at(pos + 3).is_digit(10) {
362+
continue
364363
}
365-
return Some(full_version_line[pos..end].to_owned());
364+
return Some(full_version_line[pos..pos+3].to_owned());
366365
}
367366
println!("Could not extract GDB version from line '{}'",
368367
full_version_line);

branches/auto/src/doc/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
## Building
44

5-
To generate all the docs, follow the "Building Documentation" instructions in
6-
the README in the root of the repository. This will convert the distributed
7-
Markdown docs to HTML and generate HTML doc for the books, 'std' and 'extra'
8-
libraries.
5+
To generate all the docs, just run `make docs` from the root of the repository.
6+
This will convert the distributed Markdown docs to HTML and generate HTML doc
7+
for the 'std' and 'extra' libraries.
98

109
To generate HTML documentation from one source file/crate, do something like:
1110

branches/auto/src/doc/reference.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ mod foo {
881881
}
882882
883883
use foo::example::iter; // good: foo is at crate root
884-
// use example::iter; // bad: example is not at the crate root
884+
// use example::iter; // bad: core is not at the crate root
885885
use self::baz::foobaz; // good: self refers to module 'foo'
886886
use foo::bar::foobar; // good: foo is at crate root
887887
@@ -2093,8 +2093,6 @@ The following configurations must be defined by the implementation:
20932093
* `target_pointer_width = "..."` - Target pointer width in bits. This is set
20942094
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20952095
64-bit pointers.
2096-
* `target_vendor = "..."` - Vendor of the target, for example `apple`, `pc`, or
2097-
simply `"unknown"`.
20982096
* `test` - Enabled when compiling the test harness (using the `--test` flag).
20992097
* `unix` - See `target_family`.
21002098
* `windows` - See `target_family`.
@@ -2271,7 +2269,7 @@ The currently implemented features of the reference compiler are:
22712269
* `advanced_slice_patterns` - See the [match expressions](#match-expressions)
22722270
section for discussion; the exact semantics of
22732271
slice patterns are subject to change, so some types
2274-
are still unstable.
2272+
are still unstable.
22752273

22762274
* `slice_patterns` - OK, actually, slice patterns are just scary and
22772275
completely unstable.
@@ -2292,9 +2290,6 @@ The currently implemented features of the reference compiler are:
22922290
* `box_syntax` - Allows use of `box` expressions, the exact semantics of which
22932291
is subject to change.
22942292

2295-
* `cfg_target_vendor` - Allows conditional compilation using the `target_vendor`
2296-
matcher which is subject to change.
2297-
22982293
* `concat_idents` - Allows use of the `concat_idents` macro, which is in many
22992294
ways insufficient for concatenating identifiers, and may be
23002295
removed entirely for something more wholesome.

branches/auto/src/doc/trpl/closures.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,8 @@ fn factory() -> &(Fn(i32) -> i32) {
411411
```
412412

413413
Right. Because we have a reference, we need to give it a lifetime. But
414-
our `factory()` function takes no arguments, so
415-
[elision](lifetimes.html#lifetime-elision) doesn’t kick in here. Then what
416-
choices do we have? Try `'static`:
414+
our `factory()` function takes no arguments, so elision doesn’t kick in
415+
here. What lifetime can we choose? `'static`:
417416

418417
```rust,ignore
419418
fn factory() -> &'static (Fn(i32) -> i32) {
@@ -433,7 +432,7 @@ But we get another error:
433432
```text
434433
error: mismatched types:
435434
expected `&'static core::ops::Fn(i32) -> i32`,
436-
found `[closure@<anon>:7:9: 7:20]`
435+
found `[closure <anon>:7:9: 7:20]`
437436
(expected &-ptr,
438437
found closure) [E0308]
439438
|x| x + num
@@ -442,17 +441,21 @@ error: mismatched types:
442441
```
443442

444443
This error is letting us know that we don’t have a `&'static Fn(i32) -> i32`,
445-
we have a `[closure@<anon>:7:9: 7:20]`. Wait, what?
444+
we have a `[closure <anon>:7:9: 7:20]`. Wait, what?
446445

447446
Because each closure generates its own environment `struct` and implementation
448447
of `Fn` and friends, these types are anonymous. They exist just solely for
449-
this closure. So Rust shows them as `closure@<anon>`, rather than some
448+
this closure. So Rust shows them as `closure <anon>`, rather than some
450449
autogenerated name.
451450

452-
The error also points out that the return type is expected to be a reference,
453-
but what we are trying to return is not. Further, we cannot directly assign a
454-
`'static` lifetime to an object. So we'll take a different approach and return
455-
a "trait object" by `Box`ing up the `Fn`. This _almost_ works:
451+
But why doesn’t our closure implement `&'static Fn`? Well, as we discussed before,
452+
closures borrow their environment. And in this case, our environment is based
453+
on a stack-allocated `5`, the `num` variable binding. So the borrow has a lifetime
454+
of the stack frame. So if we returned this closure, the function call would be
455+
over, the stack frame would go away, and our closure is capturing an environment
456+
of garbage memory!
457+
458+
So what to do? This _almost_ works:
456459

457460
```rust,ignore
458461
fn factory() -> Box<Fn(i32) -> i32> {
@@ -468,7 +471,7 @@ assert_eq!(6, answer);
468471
# }
469472
```
470473

471-
There’s just one last problem:
474+
We use a trait object, by `Box`ing up the `Fn`. There’s just one last problem:
472475

473476
```text
474477
error: closure may outlive the current function, but it borrows `num`,
@@ -477,12 +480,8 @@ Box::new(|x| x + num)
477480
^~~~~~~~~~~
478481
```
479482

480-
Well, as we discussed before, closures borrow their environment. And in this
481-
case, our environment is based on a stack-allocated `5`, the `num` variable
482-
binding. So the borrow has a lifetime of the stack frame. So if we returned
483-
this closure, the function call would be over, the stack frame would go away,
484-
and our closure is capturing an environment of garbage memory! With one last
485-
fix, we can make this work:
483+
We still have a reference to the parent stack frame. With one last fix, we can
484+
make this work:
486485

487486
```rust
488487
fn factory() -> Box<Fn(i32) -> i32> {

branches/auto/src/doc/trpl/iterators.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,15 @@ let greater_than_forty_two = (0..100)
150150
.find(|x| *x > 42);
151151

152152
match greater_than_forty_two {
153-
Some(_) => println!("Found a match!"),
154-
None => println!("No match found :("),
153+
Some(_) => println!("We got some numbers!"),
154+
None => println!("No numbers found :("),
155155
}
156156
```
157157

158158
`find` takes a closure, and works on a reference to each element of an
159159
iterator. This closure returns `true` if the element is the element we're
160-
looking for, and `false` otherwise. `find` returns the first element satisfying
161-
the specified predicate. Because we might not find a matching element, `find`
162-
returns an `Option` rather than the element itself.
160+
looking for, and `false` otherwise. Because we might not find a matching
161+
element, `find` returns an `Option` rather than the element itself.
163162

164163
Another important consumer is `fold`. Here's what it looks like:
165164

branches/auto/src/doc/trpl/lifetimes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is
349349
fn get_mut(&mut self) -> &mut T; // elided
350350
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded
351351
352-
fn args<T:ToCStr>(&mut self, args: &[T]) -> &mut Command; // elided
353-
fn args<'a, 'b, T:ToCStr>(&'a mut self, args: &'b [T]) -> &'a mut Command; // expanded
352+
fn args<T:ToCStr>(&mut self, args: &[T]) -> &mut Command // elided
353+
fn args<'a, 'b, T:ToCStr>(&'a mut self, args: &'b [T]) -> &'a mut Command // expanded
354354
355355
fn new(buf: &mut [u8]) -> BufWriter; // elided
356-
fn new<'a>(buf: &'a mut [u8]) -> BufWriter<'a>; // expanded
356+
fn new<'a>(buf: &'a mut [u8]) -> BufWriter<'a> // expanded
357357
```

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ You can define a `struct` with no members at all:
184184

185185
```rust
186186
struct Electron;
187-
188-
let x = Electron;
189187
```
190188

191189
Such a `struct` is called ‘unit-like’ because it resembles the empty

branches/auto/src/grammar/verify.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use syntax::parse::lexer::TokenAndSpan;
3535

3636
fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
3737
fn id() -> token::Token {
38-
token::Ident(ast::Ident::with_empty_ctxt(Name(0))), token::Plain)
38+
token::Ident(ast::Ident { name: Name(0), ctxt: 0, }, token::Plain)
3939
}
4040

4141
let mut res = HashMap::new();
@@ -75,7 +75,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
7575
"RPAREN" => token::CloseDelim(token::Paren),
7676
"SLASH" => token::BinOp(token::Slash),
7777
"COMMA" => token::Comma,
78-
"LIFETIME" => token::Lifetime(ast::Ident::with_empty_ctxt(Name(0))),
78+
"LIFETIME" => token::Lifetime(ast::Ident { name: Name(0), ctxt: 0 }),
7979
"CARET" => token::BinOp(token::Caret),
8080
"TILDE" => token::Tilde,
8181
"IDENT" => id(),
@@ -208,9 +208,9 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_
208208
token::Literal(token::ByteStr(..), n) => token::Literal(token::ByteStr(nm), n),
209209
token::Literal(token::ByteStrRaw(..), n) => token::Literal(token::ByteStrRaw(fix(content),
210210
count(content)), n),
211-
token::Ident(..) => token::Ident(ast::Ident::with_empty_ctxt(nm)),
211+
token::Ident(..) => token::Ident(ast::Ident { name: nm, ctxt: 0 },
212212
token::ModName),
213-
token::Lifetime(..) => token::Lifetime(ast::Ident::with_empty_ctxt(nm)),
213+
token::Lifetime(..) => token::Lifetime(ast::Ident { name: nm, ctxt: 0 }),
214214
ref t => t.clone()
215215
};
216216

0 commit comments

Comments
 (0)