Skip to content

Commit 6c6af41

Browse files
committed
---
yaml --- r: 158575 b: refs/heads/try c: c1b1951 h: refs/heads/master i: 158573: 934cf6e 158571: e5b0765 158567: 1032c4d 158559: cc74a42 v: v3
1 parent 3e0ec27 commit 6c6af41

File tree

181 files changed

+4239
-3240
lines changed

Some content is hidden

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

181 files changed

+4239
-3240
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: a0a7ab461283322215f0343cd2b5e66fc19a7bd5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 1b2ad7831f1745bf4a4709a1fa1772afb47c933c
5-
refs/heads/try: 2b6c2b6e348407ceaac749209e26f0dbf67227fd
5+
refs/heads/try: c1b19513ee75a36e3bee604531028af394673c1c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ fn find_rust_src_root(config: &Config) -> Option<Path> {
627627
let path_postfix = Path::new("src/etc/lldb_batchmode.py");
628628

629629
while path.pop() {
630-
if path.join(path_postfix.clone()).is_file() {
630+
if path.join(&path_postfix).is_file() {
631631
return Some(path);
632632
}
633633
}

branches/try/src/doc/guide-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ The benchmarking runner offers two ways to avoid this. Either, the
287287
closure that the `iter` method receives can return an arbitrary value
288288
which forces the optimizer to consider the result used and ensures it
289289
cannot remove the computation entirely. This could be done for the
290-
example above by adjusting the `bh.iter` call to
290+
example above by adjusting the `b.iter` call to
291291

292292
~~~
293293
# struct X; impl X { fn iter<T>(&self, _: || -> T) {} } let b = X;

branches/try/src/doc/guide.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ fn add_one(x: int) -> int {
777777
x + 1;
778778
}
779779
780-
note: consider removing this semicolon:
780+
help: consider removing this semicolon:
781781
x + 1;
782782
^
783783
```
@@ -4467,18 +4467,19 @@ see why consumers matter.
44674467

44684468
## Iterators
44694469

4470-
As we've said before, an iterator is something that we can call the `.next()`
4471-
method on repeatedly, and it gives us a sequence of things. Because you need
4472-
to call the method, this means that iterators are **lazy**. This code, for
4473-
example, does not actually generate the numbers `1-100`, and just creates a
4474-
value that represents the sequence:
4470+
As we've said before, an iterator is something that we can call the
4471+
`.next()` method on repeatedly, and it gives us a sequence of things.
4472+
Because you need to call the method, this means that iterators
4473+
are **lazy** and don't need to generate all of the values upfront.
4474+
This code, for example, does not actually generate the numbers
4475+
`1-100`, and just creates a value that represents the sequence:
44754476

44764477
```{rust}
44774478
let nums = range(1i, 100i);
44784479
```
44794480

44804481
Since we didn't do anything with the range, it didn't generate the sequence.
4481-
Once we add the consumer:
4482+
Let's add the consumer:
44824483

44834484
```{rust}
44844485
let nums = range(1i, 100i).collect::<Vec<int>>();
@@ -4507,8 +4508,8 @@ std::iter::count(1i, 5i);
45074508
```
45084509

45094510
This iterator counts up from one, adding five each time. It will give
4510-
you a new integer every time, forever. Well, technically, until the
4511-
maximum number that an `int` can represent. But since iterators are lazy,
4511+
you a new integer every time, forever (well, technically, until it reaches the
4512+
maximum number representable by an `int`). But since iterators are lazy,
45124513
that's okay! You probably don't want to use `collect()` on it, though...
45134514

45144515
That's enough about iterators. Iterator adapters are the last concept
@@ -5251,8 +5252,8 @@ to do something that it can't currently do? You may be able to write a macro
52515252
to extend Rust's capabilities.
52525253

52535254
You've already used one macro extensively: `println!`. When we invoke
5254-
a Rust macro, we need to use the exclamation mark (`!`). There's two reasons
5255-
that this is true: the first is that it makes it clear when you're using a
5255+
a Rust macro, we need to use the exclamation mark (`!`). There are two reasons
5256+
why this is so: the first is that it makes it clear when you're using a
52565257
macro. The second is that macros allow for flexible syntax, and so Rust must
52575258
be able to tell where a macro starts and ends. The `!(...)` helps with this.
52585259

@@ -5267,7 +5268,7 @@ println!("x is: {}", x);
52675268

52685269
The `println!` macro does a few things:
52695270

5270-
1. It parses the string to find any `{}`s
5271+
1. It parses the string to find any `{}`s.
52715272
2. It checks that the number of `{}`s matches the number of other arguments.
52725273
3. It generates a bunch of Rust code, taking this in mind.
52735274

@@ -5276,8 +5277,8 @@ Rust will generate code that takes all of the types into account. If
52765277
`println!` was a function, it could still do this type checking, but it
52775278
would happen at run time rather than compile time.
52785279

5279-
We can check this out using a special flag to `rustc`. This code, in a file
5280-
`print.rs`:
5280+
We can check this out using a special flag to `rustc`. Put this code in a file
5281+
called `print.rs`:
52815282

52825283
```{rust}
52835284
fn main() {
@@ -5286,7 +5287,7 @@ fn main() {
52865287
}
52875288
```
52885289

5289-
Can have its macros expanded like this: `rustc print.rs --pretty=expanded`, will
5290+
You can have the macros expanded like this: `rustc print.rs --pretty=expanded` – which will
52905291
give us this huge result:
52915292

52925293
```{rust,ignore}
@@ -5325,12 +5326,12 @@ invoke the `println_args` function with the generated arguments.
53255326
This is the code that Rust actually compiles. You can see all of the extra
53265327
information that's here. We get all of the type safety and options that it
53275328
provides, but at compile time, and without needing to type all of this out.
5328-
This is how macros are powerful. Without them, you would need to type all of
5329-
this by hand to get a type checked `println`.
5329+
This is how macros are powerful: without them you would need to type all of
5330+
this by hand to get a type-checked `println`.
53305331

53315332
For more on macros, please consult [the Macros Guide](guide-macros.html).
5332-
Macros are a very advanced and still slightly experimental feature, but don't
5333-
require a deep understanding to call, since they look just like functions. The
5333+
Macros are a very advanced and still slightly experimental feature, but they don't
5334+
require a deep understanding to be called, since they look just like functions. The
53345335
Guide can help you if you want to write your own.
53355336

53365337
# Unsafe
@@ -5347,8 +5348,8 @@ keyword, which indicates that the function may not behave properly.
53475348

53485349
Second, if you'd like to create some sort of shared-memory data structure, Rust
53495350
won't allow it, because memory must be owned by a single owner. However, if
5350-
you're planning on making access to that shared memory safe, such as with a
5351-
mutex, _you_ know that it's safe, but Rust can't know. Writing an `unsafe`
5351+
you're planning on making access to that shared memory safe such as with a
5352+
mutex _you_ know that it's safe, but Rust can't know. Writing an `unsafe`
53525353
block allows you to ask the compiler to trust you. In this case, the _internal_
53535354
implementation of the mutex is considered unsafe, but the _external_ interface
53545355
we present is safe. This allows it to be effectively used in normal Rust, while

branches/try/src/doc/intro.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,14 @@ non-deterministic aspect:
494494
$ cargo run
495495
Compiling hello_world v0.0.1 (file:///Users/you/src/hello_world)
496496
Running `target/hello_world`
497-
numbers[1] is 2
498-
numbers[0] is 1
499-
numbers[2] is 3
497+
numbers[1] is 3
498+
numbers[0] is 2
499+
numbers[2] is 4
500500
$ cargo run
501501
Running `target/hello_world`
502-
numbers[2] is 3
503-
numbers[1] is 2
504-
numbers[0] is 1
502+
numbers[2] is 4
503+
numbers[1] is 3
504+
numbers[0] is 2
505505
```
506506

507507
Each time, we get a slightly different output, because each thread works in a

branches/try/src/doc/reference.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,11 @@ An _integer literal_ has one of four forms:
400400
* A _decimal literal_ starts with a *decimal digit* and continues with any
401401
mixture of *decimal digits* and _underscores_.
402402
* A _hex literal_ starts with the character sequence `U+0030` `U+0078`
403-
(`0x`) and continues as any mixture hex digits and underscores.
403+
(`0x`) and continues as any mixture of hex digits and underscores.
404404
* An _octal literal_ starts with the character sequence `U+0030` `U+006F`
405-
(`0o`) and continues as any mixture octal digits and underscores.
405+
(`0o`) and continues as any mixture of octal digits and underscores.
406406
* A _binary literal_ starts with the character sequence `U+0030` `U+0062`
407-
(`0b`) and continues as any mixture binary digits and underscores.
407+
(`0b`) and continues as any mixture of binary digits and underscores.
408408

409409
An integer literal may be followed (immediately, without any spaces) by an
410410
_integer suffix_, which changes the type of the literal. There are two kinds of
@@ -944,10 +944,10 @@ An example of `use` declarations:
944944
```
945945
use std::iter::range_step;
946946
use std::option::{Some, None};
947-
use std::collections::hashmap::{mod, HashMap};
947+
use std::collections::hash_map::{mod, HashMap};
948948
949-
# fn foo<T>(_: T){}
950-
# fn bar(map: HashMap<String, uint>, set: hashmap::HashSet<String>){}
949+
fn foo<T>(_: T){}
950+
fn bar(map1: HashMap<String, uint>, map2: hash_map::HashMap<String, uint>){}
951951
952952
fn main() {
953953
// Equivalent to 'std::iter::range_step(0u, 10u, 2u);'
@@ -957,10 +957,10 @@ fn main() {
957957
// std::option::None]);'
958958
foo(vec![Some(1.0f64), None]);
959959
960-
// Both `hash` and `HashMap` are in scope.
961-
let map = HashMap::new();
962-
let set = hashmap::HashSet::new();
963-
bar(map, set);
960+
// Both `hash_map` and `HashMap` are in scope.
961+
let map1 = HashMap::new();
962+
let map2 = hash_map::HashMap::new();
963+
bar(map1, map2);
964964
}
965965
```
966966

@@ -2100,15 +2100,15 @@ plugins](guide-plugin.html#lint-plugins) can provide additional lint checks.
21002100
```{.ignore}
21012101
mod m1 {
21022102
// Missing documentation is ignored here
2103-
#[allow(missing_doc)]
2103+
#[allow(missing_docs)]
21042104
pub fn undocumented_one() -> int { 1 }
21052105
21062106
// Missing documentation signals a warning here
2107-
#[warn(missing_doc)]
2107+
#[warn(missing_docs)]
21082108
pub fn undocumented_too() -> int { 2 }
21092109
21102110
// Missing documentation signals an error here
2111-
#[deny(missing_doc)]
2111+
#[deny(missing_docs)]
21122112
pub fn undocumented_end() -> int { 3 }
21132113
}
21142114
```
@@ -2117,16 +2117,16 @@ This example shows how one can use `allow` and `warn` to toggle a particular
21172117
check on and off.
21182118

21192119
```{.ignore}
2120-
#[warn(missing_doc)]
2120+
#[warn(missing_docs)]
21212121
mod m2{
2122-
#[allow(missing_doc)]
2122+
#[allow(missing_docs)]
21232123
mod nested {
21242124
// Missing documentation is ignored here
21252125
pub fn undocumented_one() -> int { 1 }
21262126
21272127
// Missing documentation signals a warning here,
21282128
// despite the allow above.
2129-
#[warn(missing_doc)]
2129+
#[warn(missing_docs)]
21302130
pub fn undocumented_two() -> int { 2 }
21312131
}
21322132
@@ -2139,10 +2139,10 @@ This example shows how one can use `forbid` to disallow uses of `allow` for
21392139
that lint check.
21402140

21412141
```{.ignore}
2142-
#[forbid(missing_doc)]
2142+
#[forbid(missing_docs)]
21432143
mod m3 {
21442144
// Attempting to toggle warning signals an error here
2145-
#[allow(missing_doc)]
2145+
#[allow(missing_docs)]
21462146
/// Returns 2.
21472147
pub fn undocumented_too() -> int { 2 }
21482148
}
@@ -4096,7 +4096,7 @@ cause transitions between the states. The lifecycle states of a task are:
40964096

40974097
* running
40984098
* blocked
4099-
* panicked
4099+
* panicked
41004100
* dead
41014101

41024102
A task begins its lifecycle &mdash; once it has been spawned &mdash; in the

branches/try/src/doc/rust.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ body {
6262
font-size: 18px;
6363
color: #333;
6464
line-height: 1.428571429;
65+
66+
-webkit-font-feature-settings: "kern", "liga";
67+
-moz-font-feature-settings: "kern", "liga";
68+
font-feature-settings: "kern", "liga";
6569
}
6670
@media (min-width: 768px) {
6771
body {

branches/try/src/etc/unicode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
3535
// NOTE: The following code was generated by "src/etc/unicode.py", do not edit directly
3636
37-
#![allow(missing_doc, non_uppercase_statics, non_snake_case)]
37+
#![allow(missing_docs, non_uppercase_statics, non_snake_case)]
3838
'''
3939

4040
# Mapping taken from Table 12 from:

branches/try/src/etc/vim/autoload/rust.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ function! s:WithPath(func, ...)
178178
call mkdir(tmpdir)
179179

180180
let save_cwd = getcwd()
181-
silent exe 'lcd' tmpdir
181+
silent exe 'lcd' fnameescape(tmpdir)
182182

183183
let path = 'unnamed.rs'
184184

185185
let save_mod = &mod
186186
set nomod
187187

188-
silent exe 'keepalt write! ' . path
188+
silent exe 'keepalt write! ' . fnameescape(path)
189189
if pathisempty
190190
silent keepalt 0file
191191
endif
@@ -195,10 +195,10 @@ function! s:WithPath(func, ...)
195195

196196
call call(a:func, [path] + a:000)
197197
finally
198-
if exists("save_mod") | let &mod = save_mod | endif
199-
if exists("save_write") | let &write = save_write | endif
200-
if exists("save_cwd") | silent exe 'lcd' save_cwd | endif
201-
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
198+
if exists("save_mod") | let &mod = save_mod | endif
199+
if exists("save_write") | let &write = save_write | endif
200+
if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif
201+
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
202202
endtry
203203
endfunction
204204

0 commit comments

Comments
 (0)