Skip to content

Commit 1ec2242

Browse files
committed
---
yaml --- r: 37810 b: refs/heads/try c: ef2c404 h: refs/heads/master v: v3
1 parent 1d87bfe commit 1ec2242

File tree

464 files changed

+9055
-14201
lines changed

Some content is hidden

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

464 files changed

+9055
-14201
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 83a55ea73a985a331635fe5a8c505f7f74328c11
5+
refs/heads/try: ef2c404e01108a7bd7465bd23d40ff989848bffd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/AUTHORS.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ Graydon Hoare <[email protected]>
44

55
Other authors:
66

7-
87
Adam Bozanich <[email protected]>
98
Aleksander Balicki <[email protected]>
109
Alex Rønne Petersen <[email protected]>
1110
Alexander Stavonin <[email protected]>
1211
Andreas Gal <[email protected]>
13-
Andrew Dunham <[email protected]>
1412
Andrew Paseltiner <[email protected]>
1513
Arkaitz Jimenez <[email protected]>
1614
Armin Ronacher <[email protected]>
@@ -22,7 +20,6 @@ Benjamin Herr <[email protected]>
2220
Benjamin Jackman <[email protected]>
2321
Benjamin Kircher <[email protected]>
2422
Benjamin Peterson <[email protected]>
25-
Bilal Husain <[email protected]>
2623
Brendan Eich <[email protected]>
2724
Brian Anderson <[email protected]>
2825
Brian J. Burg <[email protected]>
@@ -32,7 +29,6 @@ Chris Peterson <[email protected]>
3229
Chris Pressey <[email protected]>
3330
Damian Gryski <[email protected]>
3431
Damien Grassart <[email protected]>
35-
Damien Schoof <[email protected]>
3632
Daniel Brooks <[email protected]>
3733
Daniel Luz <[email protected]>
3834
Daniel Patterson <[email protected]>
@@ -76,7 +72,7 @@ Jyun-Yan You <[email protected]>
7672
Kelly Wilson <[email protected]>
7773
Kevin Atkinson <[email protected]>
7874
Kevin Cantu <[email protected]>
79-
Lennart Kudling <[email protected]>
75+
Lennart Kudling
8076
Lindsey Kuper <[email protected]>
8177
Luca Bruno <[email protected]>
8278
Luqman Aden <[email protected]>
@@ -95,7 +91,6 @@ Orphée Lafond-Lummis <[email protected]>
9591
Patrick Walton <[email protected]>
9692
Patrik Kårlin <[email protected]>
9793
Paul Stansifer <[email protected]>
98-
Paul Woolcock <[email protected]>
9994
Peter Hull <[email protected]>
10095
Philipp Brüschweiler <[email protected]>
10196
Rafael Ávila de Espíndola <[email protected]>
@@ -107,15 +102,14 @@ Roland Tanglao <[email protected]>
107102
Roy Frostig <[email protected]>
108103
Ryan Scheel <[email protected]>
109104
Sean Stangl <[email protected]>
110-
Simon Barber-Dueck <[email protected]>
105+
Simon BD
111106
startling <[email protected]>
112107
Stefan Plantikow <[email protected]>
113108
Taras Shpot <[email protected]>
114109
Ted Horst <[email protected]>
115110
Tim Chevalier <[email protected]>
116111
117112
Tomoki Aonuma <[email protected]>
118-
Tony Young <[email protected]>
119113
Tycho Sci <[email protected]>
120114
Viktor Dahl <[email protected]>
121115
Vincent Belliard <[email protected]>

branches/try/doc/README

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

branches/try/doc/rust.md

Lines changed: 25 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
494494

495495
User-defined syntax extensions are called "macros", and they can be defined
496496
with the `macro_rules!` syntax extension. User-defined macros can currently
497-
be invoked as expressions, statements, or items.
497+
only be invoked in expression position.
498498

499499
(A `sep_token` is any token other than `*` and `+`. A `non_special_token` is
500500
any token other than a delimiter or `$`.)
@@ -510,8 +510,9 @@ For parsing reasons, delimiters must be balanced, but they are otherwise not spe
510510

511511
In the matcher, `$` _name_ `:` _designator_ matches the nonterminal in the
512512
Rust syntax named by _designator_. Valid designators are `item`, `block`,
513-
`stmt`, `pat`, `expr`, `ty` (type), `ident`, `path`, `matchers` (lhs of the `=>` in macro rules),
514-
`tt` (rhs of the `=>` in macro rules). In the transcriber, the designator is already known, and so only
513+
`stmt`, `pat`, `expr`, `ty`, `ident`, `path`, `tt`, `matchers`. The last two
514+
are the right-hand side and the left-hand side respectively of the `=>` in
515+
macro rules. In the transcriber, the designator is already known, and so only
515516
the name of a matched nonterminal comes after the dollar sign.
516517

517518
In both the matcher and transcriber, the Kleene star-like operator indicates repetition.
@@ -798,7 +799,7 @@ extern mod ruststd (name = "std"); // linking to 'std' under another name
798799
##### Use declarations
799800

800801
~~~~~~~~ {.ebnf .gram}
801-
use_decl : "pub"? "use" ident [ '=' path
802+
use_decl : "use" ident [ '=' path
802803
| "::" path_glob ] ;
803804
804805
path_glob : ident [ "::" path_glob ] ?
@@ -1103,27 +1104,6 @@ Constants are declared with the `const` keyword.
11031104
A constant item must have an expression giving its definition.
11041105
The definition expression of a constant is limited to expression forms that can be evaluated at compile time.
11051106

1106-
Constants must be explicitly typed. The type may be ```bool```, ```char```, a number, or a type derived from
1107-
those primitive types. The derived types are borrowed pointers, static arrays, tuples, and structs.
1108-
1109-
~~~~
1110-
const bit1: uint = 1 << 0;
1111-
const bit2: uint = 1 << 1;
1112-
1113-
const bits: [uint * 2] = [bit1, bit2];
1114-
const string: &str = "bitstring";
1115-
1116-
struct BitsNStrings {
1117-
mybits: [uint *2],
1118-
mystring: &str
1119-
}
1120-
1121-
const bits_n_strings: BitsNStrings = BitsNStrings {
1122-
mybits: bits,
1123-
mystring: string
1124-
};
1125-
~~~~
1126-
11271107
### Traits
11281108

11291109
A _trait_ describes a set of method types.
@@ -1195,9 +1175,6 @@ Values with a trait type can have [methods called](#method-call-expressions) on
11951175
for any method in the trait,
11961176
and can be used to instantiate type parameters that are bounded by the trait.
11971177

1198-
Trait methods may be static. Currently implementations of static methods behave like
1199-
functions declared in the implentation's module.
1200-
12011178
### Implementations
12021179

12031180
An _implementation_ is an item that implements a [trait](#traits) for a specific type.
@@ -1327,8 +1304,9 @@ Attributes may appear as any of
13271304
* An identifier followed by the equals sign '=' and a literal, providing a key/value pair
13281305
* An identifier followed by a parenthesized list of sub-attribute arguments
13291306

1330-
Attributes terminated by a semi-colon apply to the entity that the attribute is declared
1331-
within. Attributes that are not terminated by a semi-colon apply to the next entity.
1307+
Attributes are applied to an entity by placing them within a hash-list
1308+
(`#[...]`) as either a prefix to the entity or as a semicolon-delimited
1309+
declaration within the entity body.
13321310

13331311
An example of attributes:
13341312

@@ -1348,9 +1326,9 @@ mod bar {
13481326
...
13491327
}
13501328
1351-
// A lint attribute used to suppress a warning/error
1352-
#[allow(non_camel_case_types)]
1353-
pub type int8_t = i8;
1329+
// A documentation attribute
1330+
#[doc = "Add two numbers together."]
1331+
fn add(x: int, y: int) { x + y }
13541332
~~~~~~~~
13551333

13561334
> **Note:** In future versions of Rust, user-provided extensions to the compiler will be able to interpret attributes.
@@ -1363,8 +1341,6 @@ names are effectively reserved. Some significant attributes include:
13631341
* The `cfg` attribute, for conditional-compilation by build-configuration.
13641342
* The `link` attribute, for describing linkage metadata for a crate.
13651343
* The `test` attribute, for marking functions as unit tests.
1366-
* The `allow`, `warn`, `forbid`, and `deny` attributes, for controling lint checks. Lint checks supported
1367-
by the compiler can be found via `rustc -W help`.
13681344

13691345
Other attributes may be added or removed during development of the language.
13701346

@@ -1570,9 +1546,7 @@ it is automatically derferenced to make the field access possible.
15701546
### Vector expressions
15711547

15721548
~~~~~~~~{.ebnf .gram}
1573-
vec_expr : '[' "mut"? vec_elems? ']'
1574-
1575-
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
1549+
vec_expr : '[' "mut" ? [ expr [ ',' expr ] * ] ? ']'
15761550
~~~~~~~~
15771551

15781552
A [_vector_](#vector-types) _expression_ is written by enclosing zero or
@@ -1584,7 +1558,6 @@ When no mutability is specified, the vector is immutable.
15841558
~~~~
15851559
[1, 2, 3, 4];
15861560
["a", "b", "c", "d"];
1587-
[0, ..128]; // vector with 128 zeros
15881561
[mut 0u8, 0u8, 0u8, 0u8];
15891562
~~~~
15901563

@@ -1916,7 +1889,7 @@ let x: int = add(1, 2);
19161889

19171890
~~~~~~~~ {.abnf .gram}
19181891
ident_list : [ ident [ ',' ident ]* ] ? ;
1919-
lambda_expr : '|' ident_list '|' expr ;
1892+
lambda_expr : '|' ident_list '| expr ;
19201893
~~~~~~~~
19211894

19221895
A _lambda expression_ (a.k.a. "anonymous function expression") defines a function and denotes it as a value,
@@ -2197,6 +2170,17 @@ When matching fields of a record,
21972170
the fields being matched are specified first,
21982171
then a placeholder (`_`) represents the remaining fields.
21992172

2173+
A pattern that's just a variable binding,
2174+
like `Nil` in the previous answer,
2175+
could either refer to an enum variant that's in scope,
2176+
or bind a new variable.
2177+
The compiler resolves this ambiguity by forbidding variable bindings that occur in ```match``` patterns from shadowing names of variants that are in scope.
2178+
For example, wherever ```List``` is in scope,
2179+
a ```match``` pattern would not be able to bind ```Nil``` as a new name.
2180+
The compiler interprets a variable pattern `x` as a binding _only_ if there is no variant named `x` in scope.
2181+
A convention you can use to avoid conflicts is simply to name variants with upper-case letters,
2182+
and local variables with lower-case letters.
2183+
22002184
~~~~
22012185
# type options = {choose: bool, size: ~str};
22022186
# type player = {player: ~str, stats: (), options: options};
@@ -2228,22 +2212,6 @@ fn main() {
22282212
}
22292213
~~~~
22302214

2231-
Patterns that bind variables default to binding to a copy of the matched value. This can be made
2232-
explicit using the ```copy``` keyword, changed to bind to a borrowed pointer by using the ```ref```
2233-
keyword, or to a mutable borrowed pointer using ```ref mut```, or the value can be moved into
2234-
the new binding using ```move```.
2235-
2236-
A pattern that's just an identifier,
2237-
like `Nil` in the previous answer,
2238-
could either refer to an enum variant that's in scope,
2239-
or bind a new variable.
2240-
The compiler resolves this ambiguity by forbidding variable bindings that occur in ```match``` patterns from shadowing names of variants that are in scope.
2241-
For example, wherever ```List``` is in scope,
2242-
a ```match``` pattern would not be able to bind ```Nil``` as a new name.
2243-
The compiler interprets a variable pattern `x` as a binding _only_ if there is no variant named `x` in scope.
2244-
A convention you can use to avoid conflicts is simply to name variants with upper-case letters,
2245-
and local variables with lower-case letters.
2246-
22472215
Multiple match patterns may be joined with the `|` operator. A
22482216
range of values may be specified with `..`. For example:
22492217

@@ -2726,12 +2694,11 @@ The kinds are:
27262694
structural types containing only other sendable types.
27272695
`Owned`
27282696
: Types of this kind do not contain any borrowed pointers;
2729-
this can be a useful guarantee for code that breaks borrowing assumptions using [`unsafe` operations](#unsafe-functions).
2697+
this can be a useful guarantee for code that breaks borrowing assumptions using [`unsafe` operations](#unsafe-functions).
27302698
`Copy`
27312699
: This kind includes all types that can be copied. All types with
27322700
sendable kind are copyable, as are managed boxes, managed closures,
27332701
trait types, and structural types built out of these.
2734-
Types with destructors (types that implement `Drop`) can not implement `Copy`.
27352702
_Default_
27362703
: Types with destructors, closure environments,
27372704
and various other _non-first-class_ types,

branches/try/doc/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,8 @@ them. In the rare case where the compiler needs assistance, though, the
15401540
arguments and return types may be annotated.
15411541

15421542
~~~~
1543-
let square = |x: int| -> uint { x * x as uint };
1543+
# type mygoodness = fn(~str) -> ~str; type what_the = int;
1544+
let bloop = |well, oh: mygoodness| -> what_the { fail oh(well) };
15441545
~~~~
15451546

15461547
There are several forms of closure, each with its own role. The most
@@ -1913,7 +1914,7 @@ struct TimeBomb {
19131914
}
19141915
19151916
impl TimeBomb : Drop {
1916-
fn finalize(&self) {
1917+
fn finalize() {
19171918
for iter::repeat(self.explosivity) {
19181919
io::println("blam!");
19191920
}
@@ -2042,9 +2043,8 @@ as in this version of `print_all` that copies elements.
20422043
fn print_all<T: Printable Copy>(printable_things: ~[T]) {
20432044
let mut i = 0;
20442045
while i < printable_things.len() {
2045-
let copy_of_thing = printable_things[i];
2046+
let copy_of_thing = printable_things[0];
20462047
copy_of_thing.print();
2047-
i += 1;
20482048
}
20492049
}
20502050
~~~

branches/try/mk/clean.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ clean$(1)_T_$(2)_H_$(3):
110110
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM)
111111
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
112112
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
113-
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass*
114113
endef
115114

116115
$(foreach host, $(CFG_TARGET_TRIPLES), \

branches/try/mk/tools.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
1010

1111
# Cargo, the package manager
1212
CARGO_LIB := $(S)src/libcargo/cargo.rc
13-
CARGO_INPUTS := $(wildcard $(S)src/libcargo/*rs)
13+
CARGO_INPUTS := $(wildcard $(S)src/cargo/*rs)
1414

1515
# Rustdoc, the documentation tool
1616
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rc
17-
RUSTDOC_INPUTS := $(wildcard $(S)src/librustdoc/*.rs)
17+
RUSTDOC_INPUTS := $(wildcard $(S)src/rustdoc/*.rs)
1818

1919
# Rusti, the JIT REPL
2020
RUSTI_LIB := $(S)src/librusti/rusti.rc

branches/try/src/README.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ This is a preliminary version of the Rust compiler, libraries and tools
22

33
Source layout:
44

5-
librustc/ The self-hosted compiler
5+
rustc/ The self-hosted compiler
66

77
libcore/ The core library (imported and linked by default)
88
libstd/ The standard library (slightly more peripheral code)
@@ -28,18 +28,18 @@ test/auxiliary - Dependencies of tests
2828

2929
compiletest/ The test runner
3030

31-
libcargo/ The package manager
31+
cargo/ The package manager
3232

33-
librusti/ The JIT REPL
33+
rusti/ The JIT REPL
3434

35-
librustdoc/ The Rust API documentation tool
35+
rustdoc/ The Rust API documentation tool
3636

3737
llvm/ The LLVM submodule
3838

3939
libuv/ The libuv submodule
4040

4141
rustllvm/ LLVM support code
4242

43-
libfuzzer/ A collection of fuzz testers
43+
fuzzer/ A collection of fuzz testers
4444

4545
etc/ Scripts, editor support, misc

branches/try/src/compiletest/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, }
22

33
impl mode : cmp::Eq {
4-
pure fn eq(&self, other: &mode) -> bool {
5-
(*other) as int == (*self) as int
4+
pure fn eq(other: &mode) -> bool {
5+
(*other) as int == self as int
66
}
7-
pure fn ne(&self, other: &mode) -> bool { !(*self).eq(other) }
7+
pure fn ne(other: &mode) -> bool { !self.eq(other) }
88
}
99

1010
type config = {

0 commit comments

Comments
 (0)