Skip to content

Commit 0a2b06c

Browse files
committed
---
yaml --- r: 172507 b: refs/heads/auto c: 6773651 h: refs/heads/master i: 172505: b23b7c0 172503: 08630f1 v: v3
1 parent 8649f36 commit 0a2b06c

Some content is hidden

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

59 files changed

+656
-233
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 8af47508e9dcc9537468989ccf7f656024ead176
13+
refs/heads/auto: 67736510aed0090f7bed69dbe6218a3d6b45e491
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/header.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ pub struct TestProps {
4242
pub pretty_compare_only: bool,
4343
// Patterns which must not appear in the output of a cfail test.
4444
pub forbid_output: Vec<String>,
45-
// Ignore errors which originate from a command line span
46-
pub ignore_command_line: bool,
4745
}
4846

4947
// Load any test directives embedded in the file
@@ -62,8 +60,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
6260
let mut pretty_mode = None;
6361
let mut pretty_compare_only = false;
6462
let mut forbid_output = Vec::new();
65-
let mut ignore_command_line = false;
66-
6763
iter_header(testfile, |ln| {
6864
match parse_error_pattern(ln) {
6965
Some(ep) => error_patterns.push(ep),
@@ -106,10 +102,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
106102
pretty_compare_only = parse_pretty_compare_only(ln);
107103
}
108104

109-
if !ignore_command_line {
110-
ignore_command_line = parse_ignore_command_line(ln);
111-
}
112-
113105
match parse_aux_build(ln) {
114106
Some(ab) => { aux_builds.push(ab); }
115107
None => {}
@@ -148,7 +140,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
148140
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
149141
pretty_compare_only: pretty_compare_only,
150142
forbid_output: forbid_output,
151-
ignore_command_line: ignore_command_line,
152143
}
153144
}
154145

@@ -300,10 +291,6 @@ fn parse_pretty_compare_only(line: &str) -> bool {
300291
parse_name_directive(line, "pretty-compare-only")
301292
}
302293

303-
fn parse_ignore_command_line(line: &str) -> bool {
304-
parse_name_directive(line, "ignore-command-line")
305-
}
306-
307294
fn parse_exec_env(line: &str) -> Option<(String, String)> {
308295
parse_name_value_directive(line, "exec-env").map(|nv| {
309296
// nv is either FOO or FOO=BAR

branches/auto/src/compiletest/runtest.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
104104
if !props.error_patterns.is_empty() {
105105
fatal("both error pattern and expected errors specified");
106106
}
107-
check_expected_errors(props, expected_errors, testfile, &proc_res);
107+
check_expected_errors(expected_errors, testfile, &proc_res);
108108
} else {
109109
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
110110
}
@@ -941,8 +941,7 @@ fn check_forbid_output(props: &TestProps,
941941
}
942942
}
943943

944-
fn check_expected_errors(props: &TestProps,
945-
expected_errors: Vec<errors::ExpectedError> ,
944+
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
946945
testfile: &Path,
947946
proc_res: &ProcRes) {
948947

@@ -997,11 +996,6 @@ fn check_expected_errors(props: &TestProps,
997996
was_expected = true;
998997
}
999998

1000-
if line.starts_with("<command line option>") &&
1001-
props.ignore_command_line {
1002-
was_expected = true;
1003-
}
1004-
1005999
if !was_expected && is_compiler_error_or_warning(line) {
10061000
fatal_proc_rec(format!("unexpected compiler error or warning: '{}'",
10071001
line).as_slice(),

branches/auto/src/doc/intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ use semver::Version;
106106
107107
fn main() {
108108
assert!(Version::parse("1.2.3") == Ok(Version {
109-
major: 1u,
110-
minor: 2u,
111-
patch: 3u,
109+
major: 1u64,
110+
minor: 2u64,
111+
patch: 3u64,
112112
pre: vec!(),
113113
build: vec!(),
114114
}));

branches/auto/src/doc/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,13 +2921,13 @@ automatically dereferenced to make the field access possible.
29212921
```{.ebnf .gram}
29222922
array_expr : '[' "mut" ? vec_elems? ']' ;
29232923
2924-
array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
2924+
array_elems : [expr [',' expr]*] | [expr ';' expr] ;
29252925
```
29262926

29272927
An [array](#array,-and-slice-types) _expression_ is written by enclosing zero
29282928
or more comma-separated expressions of uniform type in square brackets.
29292929

2930-
In the `[expr ',' ".." expr]` form, the expression after the `".."` must be a
2930+
In the `[expr ';' expr]` form, the expression after the `';'` must be a
29312931
constant expression that can be evaluated at compile time, such as a
29322932
[literal](#literals) or a [static item](#static-items).
29332933

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ navigate through the menu on the left.
1111
## Basics
1212

1313
This section is a linear introduction to the basic syntax and semantics of
14-
Rust. It has individual sections on each part of Rust's syntax, and cumulates
14+
Rust. It has individual sections on each part of Rust's syntax, and culminates
1515
in a small project: a guessing game.
1616

1717
After reading "Basics," you will have a good foundation to learn more about
@@ -27,7 +27,7 @@ and will be able to understand most Rust code and write more complex programs.
2727

2828
## Advanced
2929

30-
In a similar fashion to "Intermediate," this setion is full of individual,
30+
In a similar fashion to "Intermediate," this section is full of individual,
3131
deep-dive chapters, which stand alone and can be read in any order. These
3232
chapters focus on the most complex features, as well as some things that
3333
are only available in upcoming versions of Rust.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Advanced
22

3-
In a similar fashion to "Intermediate," this setion is full of individual,
3+
In a similar fashion to "Intermediate," this section is full of individual,
44
deep-dive chapters, which stand alone and can be read in any order. These
55
chapters focus on the most complex features, as well as some things that
66
are only available in upcoming versions of Rust.

branches/auto/src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ backed by arrays. Slices have type `&[T]`, which we'll talk about when we cover
9494
generics.
9595

9696
We have now learned all of the most basic Rust concepts. We're ready to start
97-
building our guessing game, we just need to know one last thing: how to get
98-
input from the keyboard. You can't have a guessing game without the ability to
99-
guess!
97+
building ourselves a guessing game, we just need to know one last thing: how to
98+
get input from the keyboard. You can't have a guessing game without the ability
99+
to guess!

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,25 +110,27 @@ passing two variables: one is an i32, and one is a function."
110110
Next, let's look at how `twice` is defined:
111111

112112
```{rust,ignore}
113-
fn twice(x: i32, f: |i32| -> i32) -> i32 {
113+
fn twice<F: Fn(i32) -> i32>(x: i32, f: F) -> i32 {
114114
```
115115

116116
`twice` takes two arguments, `x` and `f`. That's why we called it with two
117117
arguments. `x` is an `i32`, we've done that a ton of times. `f` is a function,
118-
though, and that function takes an `i32` and returns an `i32`. Notice
119-
how the `|i32| -> i32` syntax looks a lot like our definition of `square`
120-
above, if we added the return type in:
121-
122-
```{rust}
123-
let square = |&: x: i32| -> i32 { x * x };
124-
// |i32| -> i32
125-
```
126-
127-
This function takes an `i32` and returns an `i32`.
118+
though, and that function takes an `i32` and returns an `i32`. This is
119+
what the requirement `Fn(i32) -> i32` for the type parameter `F` says.
120+
You might ask yourself: why do we need to introduce a type parameter here?
121+
That is because in Rust each closure has its own unique type.
122+
So, not only do closures with different signatures have different types,
123+
but different closures with the *same* signature have *different* types!
124+
You can think of it this way: the behaviour of a closure is part of its type.
125+
And since we want to support many different closures that all take
126+
an `i32` and return an `i32` we introduced a type parameter that is able
127+
to represent all these closures.
128128

129129
This is the most complicated function signature we've seen yet! Give it a read
130130
a few times until you can see how it works. It takes a teeny bit of practice, and
131-
then it's easy.
131+
then it's easy. The good news is that this kind of passing a closure around
132+
can be very efficient. With all the type information available at compile-time
133+
the compiler can do wonders.
132134

133135
Finally, `twice` returns an `i32` as well.
134136

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ fn hello(name: &str) {
4040
```
4141

4242
When writing doc comments, adding sections for any arguments, return values,
43-
and providing some examples of usage is very, very helpful.
43+
and providing some examples of usage is very, very helpful. Don't worry about
44+
the `&str`, we'll get to it soon.
4445

4546
You can use the [`rustdoc`](../rustdoc.html) tool to generate HTML documentation
4647
from these doc comments.

branches/auto/src/doc/trpl/compound-data-types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ let x: (i32, &str) = (1, "hello");
2323
As you can see, the type of a tuple looks just like the tuple, but with each
2424
position having a type name rather than the value. Careful readers will also
2525
note that tuples are heterogeneous: we have an `i32` and a `&str` in this tuple.
26-
You haven't seen `&str` as a type before, and we'll discuss the details of
27-
strings later. In systems programming languages, strings are a bit more complex
28-
than in other languages. For now, just read `&str` as a *string slice*, and
29-
we'll learn more soon.
26+
You have briefly seen `&str` used as a type before, and we'll discuss the
27+
details of strings later. In systems programming languages, strings are a bit
28+
more complex than in other languages. For now, just read `&str` as a *string
29+
slice*, and we'll learn more soon.
3030

3131
You can access the fields in a tuple through a *destructuring let*. Here's
3232
an example:
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
% Conclusion
22

33
We covered a lot of ground here. When you've mastered everything in this Guide,
4-
you will have a firm grasp of basic Rust development. There's a whole lot more
5-
out there, we've just covered the surface. There's tons of topics that you can
6-
dig deeper into, and we've built specialized guides for many of them. To learn
7-
more, dig into the [full documentation
8-
index](index.html).
4+
you will have a firm grasp of Rust development. There's a whole lot more
5+
out there, though, we've just covered the surface. There's tons of topics that
6+
you can dig deeper into, e.g. by reading the API documentation of the
7+
[standard library](http://doc.rust-lang.org/std/), by discovering solutions for
8+
common problems on [Rust by Example](http://rustbyexample.com/), or by browsing
9+
crates written by the community on [crates.io](https://crates.io/).
910

1011
Happy hacking!

branches/auto/src/doc/trpl/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Error Handling in Rust
22

3-
> The best-laid plans of mice and men
3+
> The best-laid plans of mice and men
44
> Often go awry
55
>
66
> "Tae a Moose", Robert Burns

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ Unlike `let`, you _must_ declare the types of function arguments. This does
5959
not work:
6060

6161
```{ignore}
62-
fn print_number(x, y) {
62+
fn print_sum(x, y) {
6363
println!("x is: {}", x + y);
6464
}
6565
```
6666

6767
You get this error:
6868

6969
```text
70-
hello.rs:5:18: 5:19 error: expected `:` but found `,`
70+
hello.rs:5:18: 5:19 expected one of `!`, `:`, or `@`, found `)`
7171
hello.rs:5 fn print_number(x, y) {
7272
```
7373

branches/auto/src/doc/trpl/hello-cargo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Rust projects, and so it is assumed that Rust projects will use Cargo from the
77
beginning.
88

99
Cargo manages three things: building your code, downloading the dependencies
10-
your code needs, and building the dependencies your code needs. At first, your
10+
your code needs, and building those dependencies. At first, your
1111
program doesn't have any dependencies, so we'll only be using the first part of
1212
its functionality. Eventually, we'll add more. Since we started off by using
1313
Cargo, it'll be easy to add later.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ let y: i32 = if x == 5 { 10; } else { 15; };
126126
Note the semicolons after the 10 and 15. Rust will give us the following error:
127127

128128
```text
129-
error: mismatched types: expected `i32` but found `()` (expected i32 but found ())
129+
error: mismatched types: expected `i32`, found `()` (expected i32, found ())
130130
```
131131

132132
We expected an integer, but we got `()`. `()` is pronounced *unit*, and is a

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Here are the three rules:
488488
parameter.
489489

490490
* If there is exactly one input lifetime, elided or not, that lifetime is
491-
assigned to all elided lifetimes in the return values of that function..
491+
assigned to all elided lifetimes in the return values of that function.
492492

493493
* If there are multiple input lifetimes, but one of them is `&self` or `&mut
494494
self`, the lifetime of `self` is assigned to all elided output lifetimes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ extern crate adder;
309309
310310
#[test]
311311
fn it_works() {
312-
assert_eq(4, adder::add_two(2));
312+
assert_eq!(4, adder::add_two(2));
313313
}
314314
```
315315

branches/auto/src/doc/trpl/variable-bindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ let x;
9898
...we'll get an error:
9999

100100
```text
101-
src/main.rs:2:9: 2:10 error: cannot determine a type for this local variable: unconstrained type
101+
src/main.rs:2:9: 2:10 error: unable to infer enough type information about `_`; type annotations required
102102
src/main.rs:2 let x;
103103
^
104104
```

branches/auto/src/etc/vim/syntax/rust.vim

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ syn match rustMacroVariable "$\w\+"
5959
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro
6060

6161
" Built-in types {{{2
62-
syn keyword rustType int isize uint usize float char bool u8 u16 u32 u64 f32
62+
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32
6363
syn keyword rustType f64 i8 i16 i32 i64 str Self
6464

6565
" Things from the prelude (src/libstd/prelude.rs) {{{2
@@ -95,8 +95,6 @@ syn keyword rustTrait Vec
9595
syn keyword rustTrait Path GenericPath
9696
" FIXME: remove when I/O reform lands
9797
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
98-
" FIXME: remove when range syntax lands
99-
syn keyword rustFunction range
10098

10199
" Other syntax {{{2
102100
syn keyword rustSelf self
@@ -139,10 +137,10 @@ syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDe
139137
syn region rustDerive start="derive(" end=")" contained contains=rustTrait
140138

141139
" Number literals
142-
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
143-
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
144-
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
145-
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
140+
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\="
141+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
142+
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
143+
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
146144

147145
" Special case for numbers of the form "1." which are float literals, unless followed by
148146
" an identifier, which makes them integer literals with a method call or field access,

0 commit comments

Comments
 (0)