Skip to content

Commit 26fc0f7

Browse files
committed
---
yaml --- r: 236478 b: refs/heads/auto c: 9f129a9 h: refs/heads/master v: v3
1 parent 929e5cf commit 26fc0f7

File tree

151 files changed

+1155
-787
lines changed

Some content is hidden

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

151 files changed

+1155
-787
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: 08181d2a3bec3484dc7d0cc7a903922f9d2a302f
11+
refs/heads/auto: 9f129a9698d2b113153ada9ffc599a4c77f587c6
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,12 @@ $ 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+
12981304
*)
12991305
;;
13001306
esac
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# x86_64-rumprun-netbsd configuration
2+
CROSS_PREFIX_x86_64-rumprun-netbsd=x86_64-rumprun-netbsd-
3+
CC_x86_64-rumprun-netbsd=gcc
4+
CXX_x86_64-rumprun-netbsd=g++
5+
CPP_x86_64-rumprun-netbsd=gcc -E
6+
AR_x86_64-rumprun-netbsd=ar
7+
CFG_INSTALL_ONLY_RLIB_x86_64-rumprun-netbsd = 1
8+
CFG_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).so
9+
CFG_STATIC_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).a
10+
CFG_LIB_GLOB_x86_64-rumprun-netbsd=lib$(1)-*.so
11+
CFG_JEMALLOC_CFLAGS_x86_64-rumprun-netbsd := -m64
12+
CFG_GCCISH_CFLAGS_x86_64-rumprun-netbsd := -Wall -Werror -g -fPIC -m64
13+
CFG_GCCISH_CXXFLAGS_x86_64-rumprun-netbsd :=
14+
CFG_GCCISH_LINK_FLAGS_x86_64-rumprun-netbsd :=
15+
CFG_GCCISH_DEF_FLAG_x86_64-rumprun-netbsd :=
16+
CFG_LLC_FLAGS_x86_64-rumprun-netbsd :=
17+
CFG_INSTALL_NAME_x86_64-rumprun-netbsd =
18+
CFG_EXE_SUFFIX_x86_64-rumprun-netbsd =
19+
CFG_WINDOWSY_x86_64-rumprun-netbsd :=
20+
CFG_UNIXY_x86_64-rumprun-netbsd := 1
21+
CFG_LDPATH_x86_64-rumprun-netbsd :=
22+
CFG_RUN_x86_64-rumprun-netbsd=$(2)
23+
CFG_RUN_TARG_x86_64-rumprun-netbsd=$(call CFG_RUN_x86_64-rumprun-netbsd,,$(2))
24+
CFG_GNU_TRIPLE_x86_64-rumprun-netbsd := x86_64-rumprun-netbsd

branches/auto/src/compiletest/compiletest.rs

Lines changed: 6 additions & 5 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])([^0-9]|$)"
351+
// used to be a regex "(^|[^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,11 +357,12 @@ 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-
if pos + 3 < full_version_line.len() &&
361-
full_version_line.char_at(pos + 3).is_digit(10) {
362-
continue
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;
363364
}
364-
return Some(full_version_line[pos..pos+3].to_owned());
365+
return Some(full_version_line[pos..end].to_owned());
365366
}
366367
println!("Could not extract GDB version from line '{}'",
367368
full_version_line);

branches/auto/src/doc/reference.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,6 +2093,8 @@ 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"`.
20962098
* `test` - Enabled when compiling the test harness (using the `--test` flag).
20972099
* `unix` - See `target_family`.
20982100
* `windows` - See `target_family`.
@@ -2269,7 +2271,7 @@ The currently implemented features of the reference compiler are:
22692271
* `advanced_slice_patterns` - See the [match expressions](#match-expressions)
22702272
section for discussion; the exact semantics of
22712273
slice patterns are subject to change, so some types
2272-
are still unstable.
2274+
are still unstable.
22732275

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

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

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,9 @@ 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 elision doesn’t kick in
415-
here. What lifetime can we choose? `'static`:
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`:
416417

417418
```rust,ignore
418419
fn factory() -> &'static (Fn(i32) -> i32) {
@@ -432,7 +433,7 @@ But we get another error:
432433
```text
433434
error: mismatched types:
434435
expected `&'static core::ops::Fn(i32) -> i32`,
435-
found `[closure <anon>:7:9: 7:20]`
436+
found `[closure@<anon>:7:9: 7:20]`
436437
(expected &-ptr,
437438
found closure) [E0308]
438439
|x| x + num
@@ -441,21 +442,17 @@ error: mismatched types:
441442
```
442443

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

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

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:
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:
459456

460457
```rust,ignore
461458
fn factory() -> Box<Fn(i32) -> i32> {
@@ -471,7 +468,7 @@ assert_eq!(6, answer);
471468
# }
472469
```
473470

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

476473
```text
477474
error: closure may outlive the current function, but it borrows `num`,
@@ -480,8 +477,12 @@ Box::new(|x| x + num)
480477
^~~~~~~~~~~
481478
```
482479

483-
We still have a reference to the parent stack frame. With one last fix, we can
484-
make this work:
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:
485486

486487
```rust
487488
fn factory() -> Box<Fn(i32) -> i32> {

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/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 { name: Name(0), ctxt: 0, }, token::Plain)
38+
token::Ident(ast::Ident::with_empty_ctxt(Name(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 { name: Name(0), ctxt: 0 }),
78+
"LIFETIME" => token::Lifetime(ast::Ident::with_empty_ctxt(Name(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 { name: nm, ctxt: 0 },
211+
token::Ident(..) => token::Ident(ast::Ident::with_empty_ctxt(nm)),
212212
token::ModName),
213-
token::Lifetime(..) => token::Lifetime(ast::Ident { name: nm, ctxt: 0 }),
213+
token::Lifetime(..) => token::Lifetime(ast::Ident::with_empty_ctxt(nm)),
214214
ref t => t.clone()
215215
};
216216

0 commit comments

Comments
 (0)