Skip to content

Commit 42a3b8f

Browse files
committed
---
yaml --- r: 196536 b: refs/heads/auto c: 2d19895 h: refs/heads/master v: v3
1 parent 931ebf7 commit 42a3b8f

File tree

7 files changed

+124
-100
lines changed

7 files changed

+124
-100
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: 083b8a40413eb3dfec7430150b8895f6c8bbafca
13+
refs/heads/auto: 2d198955d329904cbd54531e6f404a5648ace19f
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/trpl/crates-and-modules.md

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Cargo will build this crate as a library:
111111
```bash
112112
$ cargo build
113113
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
114-
$ ls target/debug
115-
build deps examples libphrases-a7448e02a0468eaa.rlib native
114+
$ ls target
115+
deps libphrases-a7448e02a0468eaa.rlib native
116116
```
117117

118118
`libphrase-hash.rlib` is the compiled crate. Before we see how to use this
@@ -163,12 +163,9 @@ $ tree .
163163
│   │   └── mod.rs
164164
│   └── lib.rs
165165
└── target
166-
└── debug
167-
├── build
168-
├── deps
169-
├── examples
170-
├── libphrases-a7448e02a0468eaa.rlib
171-
└── native
166+
├── deps
167+
├── libphrases-a7448e02a0468eaa.rlib
168+
└── native
172169
```
173170

174171
`src/lib.rs` is our crate root, and looks like this:
@@ -217,6 +214,8 @@ fn goodbye() -> String {
217214
Put this in `src/japanese/greetings.rs`:
218215

219216
```rust
217+
// in src/japanese/greetings.rs
218+
220219
fn hello() -> String {
221220
"こんにちは".to_string()
222221
}
@@ -276,15 +275,14 @@ this:
276275
```bash
277276
$ cargo build
278277
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
279-
src/main.rs:4:38: 4:72 error: function `hello` is private
280-
src/main.rs:4 println!("Hello in English: {}", phrases::english::greetings::hello());
281-
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278+
/home/you/projects/phrases/src/main.rs:4:38: 4:72 error: function `hello` is private
279+
/home/you/projects/phrases/src/main.rs:4 println!("Hello in English: {}", phrases::english::greetings::hello());
280+
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
282281
note: in expansion of format_args!
283-
<std macros>:2:25: 2:58 note: expansion site
284-
<std macros>:1:1: 2:62 note: in expansion of print!
285-
<std macros>:3:1: 3:54 note: expansion site
286-
<std macros>:1:1: 3:58 note: in expansion of println!
287-
phrases/src/main.rs:4:5: 4:76 note: expansion site
282+
<std macros>:2:23: 2:77 note: expansion site
283+
<std macros>:1:1: 3:2 note: in expansion of println!
284+
/home/you/projects/phrases/src/main.rs:4:5: 4:76 note: expansion site
285+
288286
```
289287
290288
By default, everything is private in Rust. Let's talk about this in some more
@@ -342,15 +340,15 @@ functions:
342340
```bash
343341
$ cargo run
344342
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
345-
src/japanese/greetings.rs:1:1: 3:2 warning: function is never used: `hello`, #[warn(dead_code)] on by default
346-
src/japanese/greetings.rs:1 fn hello() -> String {
347-
src/japanese/greetings.rs:2 "こんにちは".to_string()
348-
src/japanese/greetings.rs:3 }
349-
src/japanese/farewells.rs:1:1: 3:2 warning: function is never used: `goodbye`, #[warn(dead_code)] on by default
350-
src/japanese/farewells.rs:1 fn goodbye() -> String {
351-
src/japanese/farewells.rs:2 "さようなら".to_string()
352-
src/japanese/farewells.rs:3 }
353-
Running `target/debug/phrases`
343+
/home/you/projects/phrases/src/japanese/greetings.rs:1:1: 3:2 warning: code is never used: `hello`, #[warn(dead_code)] on by default
344+
/home/you/projects/phrases/src/japanese/greetings.rs:1 fn hello() -> String {
345+
/home/you/projects/phrases/src/japanese/greetings.rs:2 "こんにちは".to_string()
346+
/home/you/projects/phrases/src/japanese/greetings.rs:3 }
347+
/home/you/projects/phrases/src/japanese/farewells.rs:1:1: 3:2 warning: code is never used: `goodbye`, #[warn(dead_code)] on by default
348+
/home/you/projects/phrases/src/japanese/farewells.rs:1 fn goodbye() -> String {
349+
/home/you/projects/phrases/src/japanese/farewells.rs:2 "さようなら".to_string()
350+
/home/you/projects/phrases/src/japanese/farewells.rs:3 }
351+
Running `target/phrases`
354352
Hello in English: Hello!
355353
Goodbye in English: Goodbye.
356354
```
@@ -416,9 +414,9 @@ Rust will give us a compile-time error:
416414
417415
```text
418416
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
419-
src/main.rs:4:5: 4:40 error: a value named `hello` has already been imported in this module [E0252]
420-
src/main.rs:4 use phrases::japanese::greetings::hello;
421-
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
417+
/home/you/projects/phrases/src/main.rs:4:5: 4:40 error: a value named `hello` has already been imported in this module
418+
/home/you/projects/phrases/src/main.rs:4 use phrases::japanese::greetings::hello;
419+
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
422420
error: aborting due to previous error
423421
Could not compile `phrases`.
424422
```
@@ -525,7 +523,7 @@ This will build and run:
525523
```bash
526524
$ cargo run
527525
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
528-
Running `target/debug/phrases`
526+
Running `target/phrases`
529527
Hello in English: Hello!
530528
Goodbye in English: Goodbye.
531529
Hello in Japanese: こんにちは

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ If you are trying to execute a closure on an iterator for its side effects,
291291
just use `for` instead.
292292

293293
There are tons of interesting iterator adapters. `take(n)` will return an
294-
iterator over the next `n` elements of the original iterator. Note that this
294+
iterator over the next `n` elements of the original iterator, note that this
295295
has no side effect on the original iterator. Let's try it out with our infinite
296296
iterator from before:
297297

branches/auto/src/doc/trpl/method-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl CircleBuilder {
197197
}
198198
199199
fn y(&mut self, coordinate: f64) -> &mut CircleBuilder {
200-
self.y = coordinate;
200+
self.x = coordinate;
201201
self
202202
}
203203

branches/auto/src/libcore/convert.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ use marker::Sized;
2121
/// A cheap, reference-to-reference conversion.
2222
#[stable(feature = "rust1", since = "1.0.0")]
2323
pub trait AsRef<T: ?Sized> {
24-
/// Perform the conversion.
24+
/// Performs the conversion.
2525
#[stable(feature = "rust1", since = "1.0.0")]
2626
fn as_ref(&self) -> &T;
2727
}
2828

2929
/// A cheap, mutable reference-to-mutable reference conversion.
3030
#[stable(feature = "rust1", since = "1.0.0")]
3131
pub trait AsMut<T: ?Sized> {
32-
/// Perform the conversion.
32+
/// Performs the conversion.
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
fn as_mut(&mut self) -> &mut T;
3535
}
@@ -38,15 +38,15 @@ pub trait AsMut<T: ?Sized> {
3838
/// expensive.
3939
#[stable(feature = "rust1", since = "1.0.0")]
4040
pub trait Into<T>: Sized {
41-
/// Perform the conversion.
41+
/// Performs the conversion.
4242
#[stable(feature = "rust1", since = "1.0.0")]
4343
fn into(self) -> T;
4444
}
4545

4646
/// Construct `Self` via a conversion.
4747
#[stable(feature = "rust1", since = "1.0.0")]
4848
pub trait From<T> {
49-
/// Perform the conversion.
49+
/// Performs the conversion.
5050
#[stable(feature = "rust1", since = "1.0.0")]
5151
fn from(T) -> Self;
5252
}

0 commit comments

Comments
 (0)