Skip to content

Commit 732fe24

Browse files
committed
---
yaml --- r: 236594 b: refs/heads/tmp c: 54f7b1d h: refs/heads/master v: v3
1 parent aeb4342 commit 732fe24

File tree

183 files changed

+1258
-1049
lines changed

Some content is hidden

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

183 files changed

+1258
-1049
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: d5f2d3b1773d70bf3d32b94ad2a2bf3125bf743e
28+
refs/heads/tmp: 54f7b1d455915794ab000448799c5092c57535c1
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/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/tmp/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/tmp/src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provides only one kind of material:
99

1010
This document does not serve as an introduction to the language. Background
1111
familiarity with the language is assumed. A separate [guide] is available to
12-
help acquire such background familiarity.
12+
help acquire such background.
1313

1414
This document also does not serve as a reference to the [standard] library
1515
included in the language distribution. Those libraries are documented

branches/tmp/src/doc/reference.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ There are several kinds of item:
674674
* [modules](#modules)
675675
* [functions](#functions)
676676
* [type definitions](grammar.html#type-definitions)
677-
* [structures](#structures)
677+
* [structs](#structs)
678678
* [enumerations](#enumerations)
679679
* [constant items](#constant-items)
680680
* [static items](#static-items)
@@ -900,9 +900,10 @@ fn main() {}
900900

901901
### Functions
902902

903-
A _function item_ defines a sequence of [statements](#statements) and an
904-
optional final [expression](#expressions), along with a name and a set of
905-
parameters. Functions are declared with the keyword `fn`. Functions declare a
903+
A _function item_ defines a sequence of [statements](#statements) and a
904+
final [expression](#expressions), along with a name and a set of
905+
parameters. Other than a name, all these are optional.
906+
Functions are declared with the keyword `fn`. Functions may declare a
906907
set of *input* [*variables*](#variables) as parameters, through which the caller
907908
passes arguments into the function, and the *output* [*type*](#types)
908909
of the value the function will return to its caller on completion.
@@ -921,7 +922,7 @@ An example of a function:
921922

922923
```
923924
fn add(x: i32, y: i32) -> i32 {
924-
return x + y;
925+
x + y
925926
}
926927
```
927928

@@ -1155,7 +1156,7 @@ type Point = (u8, u8);
11551156
let p: Point = (41, 68);
11561157
```
11571158

1158-
### Structures
1159+
### Structs
11591160

11601161
A _structure_ is a nominal [structure type](#structure-types) defined with the
11611162
keyword `struct`.
@@ -2092,6 +2093,8 @@ The following configurations must be defined by the implementation:
20922093
* `target_pointer_width = "..."` - Target pointer width in bits. This is set
20932094
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20942095
64-bit pointers.
2096+
* `target_vendor = "..."` - Vendor of the target, for example `apple`, `pc`, or
2097+
simply `"unknown"`.
20952098
* `test` - Enabled when compiling the test harness (using the `--test` flag).
20962099
* `unix` - See `target_family`.
20972100
* `windows` - See `target_family`.
@@ -2268,7 +2271,7 @@ The currently implemented features of the reference compiler are:
22682271
* `advanced_slice_patterns` - See the [match expressions](#match-expressions)
22692272
section for discussion; the exact semantics of
22702273
slice patterns are subject to change, so some types
2271-
are still unstable.
2274+
are still unstable.
22722275

22732276
* `slice_patterns` - OK, actually, slice patterns are just scary and
22742277
completely unstable.
@@ -2289,6 +2292,9 @@ The currently implemented features of the reference compiler are:
22892292
* `box_syntax` - Allows use of `box` expressions, the exact semantics of which
22902293
is subject to change.
22912294

2295+
* `cfg_target_vendor` - Allows conditional compilation using the `target_vendor`
2296+
matcher which is subject to change.
2297+
22922298
* `concat_idents` - Allows use of the `concat_idents` macro, which is in many
22932299
ways insufficient for concatenating identifiers, and may be
22942300
removed entirely for something more wholesome.
@@ -2614,21 +2620,21 @@ comma:
26142620
### Structure expressions
26152621

26162622
There are several forms of structure expressions. A _structure expression_
2617-
consists of the [path](#paths) of a [structure item](#structures), followed by
2623+
consists of the [path](#paths) of a [structure item](#structs), followed by
26182624
a brace-enclosed list of one or more comma-separated name-value pairs,
26192625
providing the field values of a new instance of the structure. A field name
26202626
can be any identifier, and is separated from its value expression by a colon.
26212627
The location denoted by a structure field is mutable if and only if the
26222628
enclosing structure is mutable.
26232629

26242630
A _tuple structure expression_ consists of the [path](#paths) of a [structure
2625-
item](#structures), followed by a parenthesized list of one or more
2631+
item](#structs), followed by a parenthesized list of one or more
26262632
comma-separated expressions (in other words, the path of a structure item
26272633
followed by a tuple expression). The structure item must be a tuple structure
26282634
item.
26292635

26302636
A _unit-like structure expression_ consists only of the [path](#paths) of a
2631-
[structure item](#structures).
2637+
[structure item](#structs).
26322638

26332639
The following are examples of structure expressions:
26342640

@@ -3145,7 +3151,7 @@ if` condition is evaluated. If all `if` and `else if` conditions evaluate to
31453151

31463152
A `match` expression branches on a *pattern*. The exact form of matching that
31473153
occurs depends on the pattern. Patterns consist of some combination of
3148-
literals, destructured arrays or enum constructors, structures and tuples,
3154+
literals, destructured arrays or enum constructors, structs and tuples,
31493155
variable binding specifications, wildcards (`..`), and placeholders (`_`). A
31503156
`match` expression has a *head expression*, which is the value to compare to
31513157
the patterns. The type of the patterns must equal the type of the head
@@ -3469,7 +3475,7 @@ named reference to an [`enum` item](#enumerations).
34693475
### Recursive types
34703476

34713477
Nominal types &mdash; [enumerations](#enumerated-types) and
3472-
[structures](#structure-types) &mdash; may be recursive. That is, each `enum`
3478+
[structs](#structure-types) &mdash; may be recursive. That is, each `enum`
34733479
constructor or `struct` field may refer, directly or indirectly, to the
34743480
enclosing `enum` or `struct` type itself. Such recursion has restrictions:
34753481

@@ -3497,7 +3503,7 @@ let a: List<i32> = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
34973503
### Pointer types
34983504

34993505
All pointers in Rust are explicit first-class values. They can be copied,
3500-
stored into data structures, and returned from functions. There are two
3506+
stored into data structs, and returned from functions. There are two
35013507
varieties of pointer in Rust:
35023508

35033509
* References (`&`)
@@ -3897,7 +3903,7 @@ references to boxes are dropped.
38973903
### Variables
38983904

38993905
A _variable_ is a component of a stack frame, either a named function parameter,
3900-
an anonymous [temporary](#lvalues,-rvalues-and-temporaries), or a named local
3906+
an anonymous [temporary](#lvalues-rvalues-and-temporaries), or a named local
39013907
variable.
39023908

39033909
A _local variable_ (or *stack-local* allocation) holds a value directly,
@@ -4036,10 +4042,6 @@ In general, `--crate-type=bin` or `--crate-type=lib` should be sufficient for
40364042
all compilation needs, and the other options are just available if more
40374043
fine-grained control is desired over the output format of a Rust crate.
40384044

4039-
# Appendix: Rationales and design trade-offs
4040-
4041-
*TODO*.
4042-
40434045
# Appendix: Influences
40444046

40454047
Rust is not a particularly original language, with design elements coming from

branches/tmp/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/tmp/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/tmp/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)