Skip to content

Commit 8896fbb

Browse files
committed
---
yaml --- r: 209914 b: refs/heads/try c: 23782ad h: refs/heads/master v: v3
1 parent a85353f commit 8896fbb

File tree

55 files changed

+83
-74
lines changed

Some content is hidden

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

55 files changed

+83
-74
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: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: b66f858e8f7902ff9e293b10ce9439cb25d4ad6e
5+
refs/heads/try: 23782ad9a844ea283e0ea692b361ef5885ce296f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/reference.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ r##"foo #"# bar"##; // foo #"# bar
269269
##### Byte literals
270270

271271
A _byte literal_ is a single ASCII character (in the `U+0000` to `U+007F`
272-
range) enclosed within two `U+0027` (single-quote) characters, with the
273-
exception of `U+0027` itself, which must be _escaped_ by a preceding U+005C
274-
character (`\`), or a single _escape_. It is equivalent to a `u8` unsigned
275-
8-bit integer _number literal_.
272+
range) or a single _escape_ preceded by the characters `U+0062` (`b`) and
273+
`U+0027` (single-quote), and followed by the character `U+0027`. If the character
274+
`U+0027` is present within the literal, it must be _escaped_ by a preceding
275+
`U+005C` (`\`) character. It is equivalent to a `u8` unsigned 8-bit integer
276+
_number literal_.
276277

277278
##### Byte string literals
278279

branches/try/src/doc/style/testing/unit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
% Unit testing
22

3-
Unit tests should live in a `test` submodule at the bottom of the module they
4-
test. Mark the `test` submodule with `#[cfg(test)]` so it is only compiled when
3+
Unit tests should live in a `tests` submodule at the bottom of the module they
4+
test. Mark the `tests` submodule with `#[cfg(test)]` so it is only compiled when
55
testing.
66

7-
The `test` module should contain:
7+
The `tests` module should contain:
88

99
* Imports needed only for testing.
1010
* Functions marked with `#[test]` striving for full coverage of the parent module's
@@ -17,7 +17,7 @@ For example:
1717
// Excerpt from std::str
1818

1919
#[cfg(test)]
20-
mod test {
20+
mod tests {
2121
#[test]
2222
fn test_eq() {
2323
assert!((eq(&"".to_owned(), &"".to_owned())));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Getting Started
22

33
This first section of the book will get you going with Rust and its tooling.
4-
First, we’ll install Rust. Then: the classic ‘Hello World’ program. Finally,
4+
First, we’ll install Rust. Then, the classic ‘Hello World’ program. Finally,
55
we’ll talk about Cargo, Rust’s build system and package manager.

branches/try/src/doc/trpl/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In the example above `x` and `y` have arity 2. `z` has arity 3.
1919

2020
When a compiler is compiling your program, it does a number of different
2121
things. One of the things that it does is turn the text of your program into an
22-
'abstract syntax tree,' or 'AST.' This tree is a representation of the
22+
abstract syntax tree’, orAST’. This tree is a representation of the
2323
structure of your program. For example, `2 + 3` can be turned into a tree:
2424

2525
```text

branches/try/src/doc/trpl/primitive-types.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ let y = 1.0; // y has type f64
6262
Here’s a list of the different numeric types, with links to their documentation
6363
in the standard library:
6464

65+
* [i8](../std/primitive.i8.html)
6566
* [i16](../std/primitive.i16.html)
6667
* [i32](../std/primitive.i32.html)
6768
* [i64](../std/primitive.i64.html)
68-
* [i8](../std/primitive.i8.html)
69+
* [u8](../std/primitive.u8.html)
6970
* [u16](../std/primitive.u16.html)
7071
* [u32](../std/primitive.u32.html)
7172
* [u64](../std/primitive.u64.html)
72-
* [u8](../std/primitive.u8.html)
7373
* [isize](../std/primitive.isize.html)
7474
* [usize](../std/primitive.usize.html)
7575
* [f32](../std/primitive.f32.html)
@@ -82,12 +82,12 @@ Let’s go over them by category:
8282
Integer types come in two varieties: signed and unsigned. To understand the
8383
difference, let’s consider a number with four bits of size. A signed, four-bit
8484
number would let you store numbers from `-8` to `+7`. Signed numbers use
85-
two’s compliment representation. An unsigned four bit number, since it does
85+
two’s compliment representation. An unsigned four bit number, since it does
8686
not need to store negatives, can store values from `0` to `+15`.
8787

8888
Unsigned types use a `u` for their category, and signed types use `i`. The `i`
8989
is for ‘integer’. So `u8` is an eight-bit unsigned number, and `i8` is an
90-
eight-bit signed number.
90+
eight-bit signed number.
9191

9292
## Fixed size types
9393

@@ -103,7 +103,7 @@ and unsigned varieties. This makes for two types: `isize` and `usize`.
103103

104104
## Floating-point types
105105

106-
Rust also two floating point types: `f32` and `f64`. These correspond to
106+
Rust also has two floating point types: `f32` and `f64`. These correspond to
107107
IEEE-754 single and double precision numbers.
108108

109109
# Arrays
@@ -241,8 +241,8 @@ println!("x is {}", x);
241241
Remember [before][let] when I said the left-hand side of a `let` statement was more
242242
powerful than just assigning a binding? Here we are. We can put a pattern on
243243
the left-hand side of the `let`, and if it matches up to the right-hand side,
244-
we can assign multiple bindings at once. In this case, `let` "destructures,"
245-
or "breaks up," the tuple, and assigns the bits to three bindings.
244+
we can assign multiple bindings at once. In this case, `let` destructures
245+
or breaks up the tuple, and assigns the bits to three bindings.
246246

247247
[let]: variable-bindings.html
248248

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ fn it_works() {
219219
This is a very common use of `assert_eq!`: call some function with
220220
some known arguments and compare it to the expected output.
221221

222-
# The `test` module
222+
# The `tests` module
223223

224224
There is one way in which our existing example is not idiomatic: it's
225-
missing the test module. The idiomatic way of writing our example
225+
missing the `tests` module. The idiomatic way of writing our example
226226
looks like this:
227227

228228
```{rust,ignore}
@@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 {
231231
}
232232
233233
#[cfg(test)]
234-
mod test {
234+
mod tests {
235235
use super::add_two;
236236
237237
#[test]
@@ -241,7 +241,7 @@ mod test {
241241
}
242242
```
243243

244-
There's a few changes here. The first is the introduction of a `mod test` with
244+
There's a few changes here. The first is the introduction of a `mod tests` with
245245
a `cfg` attribute. The module allows us to group all of our tests together, and
246246
to also define helper functions if needed, that don't become a part of the rest
247247
of our crate. The `cfg` attribute only compiles our test code if we're
@@ -260,7 +260,7 @@ pub fn add_two(a: i32) -> i32 {
260260
}
261261
262262
#[cfg(test)]
263-
mod test {
263+
mod tests {
264264
use super::*;
265265
266266
#[test]
@@ -279,7 +279,7 @@ $ cargo test
279279
Running target/adder-91b3e234d4ed382a
280280

281281
running 1 test
282-
test test::it_works ... ok
282+
test tests::it_works ... ok
283283

284284
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
285285

@@ -292,7 +292,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
292292

293293
It works!
294294

295-
The current convention is to use the `test` module to hold your "unit-style"
295+
The current convention is to use the `tests` module to hold your "unit-style"
296296
tests. Anything that just tests one small bit of functionality makes sense to
297297
go here. But what about "integration-style" tests instead? For that, we have
298298
the `tests` directory
@@ -325,7 +325,7 @@ $ cargo test
325325
Running target/adder-91b3e234d4ed382a
326326

327327
running 1 test
328-
test test::it_works ... ok
328+
test tests::it_works ... ok
329329

330330
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
331331

@@ -346,7 +346,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
346346
Now we have three sections: our previous test is also run, as well as our new
347347
one.
348348

349-
That's all there is to the `tests` directory. The `test` module isn't needed
349+
That's all there is to the `tests` directory. The `tests` module isn't needed
350350
here, since the whole thing is focused on tests.
351351

352352
Let's finally check out that third section: documentation tests.
@@ -382,7 +382,7 @@ pub fn add_two(a: i32) -> i32 {
382382
}
383383
384384
#[cfg(test)]
385-
mod test {
385+
mod tests {
386386
use super::*;
387387
388388
#[test]
@@ -405,7 +405,7 @@ $ cargo test
405405
Running target/adder-91b3e234d4ed382a
406406

407407
running 1 test
408-
test test::it_works ... ok
408+
test tests::it_works ... ok
409409

410410
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
411411

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

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

3-
Vitually every non-Hello World’ Rust program uses *variable bindings*. They
3+
Virtually every non-Hello World’Rust program uses *variable bindings*. They
44
look like this:
55

66
```rust

branches/try/src/liballoc/heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ mod imp {
384384
}
385385

386386
#[cfg(test)]
387-
mod test {
387+
mod tests {
388388
extern crate test;
389389
use self::test::Bencher;
390390
use boxed::Box;

branches/try/src/libcollections/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ impl<A: Hash> Hash for LinkedList<A> {
933933
}
934934

935935
#[cfg(test)]
936-
mod test {
936+
mod tests {
937937
use std::clone::Clone;
938938
use std::iter::{Iterator, IntoIterator};
939939
use std::option::Option::{Some, None, self};

branches/try/src/libcollections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ impl<T: fmt::Debug> fmt::Debug for VecDeque<T> {
17721772
}
17731773

17741774
#[cfg(test)]
1775-
mod test {
1775+
mod tests {
17761776
use core::iter::{Iterator, self};
17771777
use core::option::Option::Some;
17781778

branches/try/src/libcoretest/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn test_num<T>(ten: T, two: T) where
4545
}
4646

4747
#[cfg(test)]
48-
mod test {
48+
mod tests {
4949
use core::option::Option;
5050
use core::option::Option::{Some, None};
5151
use core::num::Float;

branches/try/src/librand/chacha.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl Rand for ChaChaRng {
202202

203203

204204
#[cfg(test)]
205-
mod test {
205+
mod tests {
206206
use std::prelude::v1::*;
207207

208208
use core::iter::order;

branches/try/src/librand/distributions/exponential.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl IndependentSample<f64> for Exp {
8282
}
8383

8484
#[cfg(test)]
85-
mod test {
85+
mod tests {
8686
use std::prelude::v1::*;
8787

8888
use distributions::{Sample, IndependentSample};

branches/try/src/librand/distributions/gamma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl IndependentSample<f64> for StudentT {
276276
}
277277

278278
#[cfg(test)]
279-
mod test {
279+
mod tests {
280280
use std::prelude::v1::*;
281281

282282
use distributions::{Sample, IndependentSample};

branches/try/src/librand/isaac.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ impl Rand for Isaac64Rng {
510510

511511

512512
#[cfg(test)]
513-
mod test {
513+
mod tests {
514514
use std::prelude::v1::*;
515515

516516
use core::iter::order;

branches/try/src/librand/reseeding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl Default for ReseedWithDefault {
120120
}
121121

122122
#[cfg(test)]
123-
mod test {
123+
mod tests {
124124
use std::prelude::v1::*;
125125

126126
use core::iter::{order, repeat};

branches/try/src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ impl fmt::Display for CrateType {
11111111
}
11121112

11131113
#[cfg(test)]
1114-
mod test {
1114+
mod tests {
11151115

11161116
use session::config::{build_configuration, optgroups, build_session_options};
11171117
use session::build_session;

branches/try/src/librustc_back/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn realpath(original: &Path) -> io::Result<PathBuf> {
4141
}
4242

4343
#[cfg(all(not(windows), test))]
44-
mod test {
44+
mod tests {
4545
use tempdir::TempDir;
4646
use std::fs::{self, File};
4747
use super::realpath;

branches/try/src/librustc_back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn minimize_rpaths(rpaths: &[String]) -> Vec<String> {
171171
}
172172

173173
#[cfg(all(unix, test))]
174-
mod test {
174+
mod tests {
175175
use super::{RPathConfig};
176176
use super::{minimize_rpaths, rpaths_to_flags, get_rpath_relative_to_output};
177177
use std::path::{Path, PathBuf};

branches/try/src/librustc_data_structures/graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use std::usize;
3636
use snapshot_vec::{SnapshotVec, SnapshotVecDelegate};
3737

3838
#[cfg(test)]
39-
mod test;
39+
mod tests;
4040

4141
pub struct Graph<N,E> {
4242
nodes: SnapshotVec<Node<N>> ,

branches/try/src/librustc_data_structures/unify/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::marker::PhantomData;
1414
use snapshot_vec as sv;
1515

1616
#[cfg(test)]
17-
mod test;
17+
mod tests;
1818

1919
/// This trait is implemented by any type that can serve as a type
2020
/// variable. We call such variables *unification keys*. For example,

branches/try/src/librustdoc/html/toc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl fmt::Display for Toc {
198198
}
199199

200200
#[cfg(test)]
201-
mod test {
201+
mod tests {
202202
use super::{TocBuilder, Toc, TocEntry};
203203

204204
#[test]

branches/try/src/libstd/dynamic_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl DynamicLibrary {
117117
}
118118

119119
#[cfg(all(test, not(target_os = "ios")))]
120-
mod test {
120+
mod tests {
121121
use super::*;
122122
use prelude::v1::*;
123123
use libc;

branches/try/src/libstd/io/stdio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ pub fn _print(args: fmt::Arguments) {
418418
}
419419

420420
#[cfg(test)]
421-
mod test {
421+
mod tests {
422422
use thread;
423423
use super::*;
424424

branches/try/src/libstd/io/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl Write for Sink {
102102
}
103103

104104
#[cfg(test)]
105-
mod test {
105+
mod tests {
106106
use prelude::v1::*;
107107

108108
use io::prelude::*;

branches/try/src/libstd/path.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,14 @@ impl Path {
12411241
///
12421242
/// Path::new("foo.txt");
12431243
/// ```
1244+
///
1245+
/// You can create `Path`s from `String`s, or even other `Path`s:
1246+
///
1247+
/// ```
1248+
/// let s = String::from("bar.txt");
1249+
/// let p = Path::new(&s);
1250+
/// Path::new(&p);
1251+
/// ```
12441252
#[stable(feature = "rust1", since = "1.0.0")]
12451253
pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &Path {
12461254
unsafe { mem::transmute(s.as_ref()) }

0 commit comments

Comments
 (0)