Skip to content

Commit 65a544a

Browse files
committed
---
yaml --- r: 196537 b: refs/heads/auto c: f73f323 h: refs/heads/master i: 196535: 931ebf7 v: v3
1 parent 42a3b8f commit 65a544a

File tree

6 files changed

+96
-120
lines changed

6 files changed

+96
-120
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: 2d198955d329904cbd54531e6f404a5648ace19f
13+
refs/heads/auto: f73f3233f10e506ec41c17126e66953ed6996feb
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: 29 additions & 27 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
115-
deps libphrases-a7448e02a0468eaa.rlib native
114+
$ ls target/debug
115+
build deps examples libphrases-a7448e02a0468eaa.rlib native
116116
```
117117

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

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

216219
```rust
217-
// in src/japanese/greetings.rs
218-
219220
fn hello() -> String {
220221
"こんにちは".to_string()
221222
}
@@ -275,14 +276,15 @@ this:
275276
```bash
276277
$ cargo build
277278
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
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-
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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+
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
281282
note: in expansion of format_args!
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-
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
286288
```
287289
288290
By default, everything is private in Rust. Let's talk about this in some more
@@ -340,15 +342,15 @@ functions:
340342
```bash
341343
$ cargo run
342344
Compiling phrases v0.0.1 (file:///home/you/projects/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`
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`
352354
Hello in English: Hello!
353355
Goodbye in English: Goodbye.
354356
```
@@ -414,9 +416,9 @@ Rust will give us a compile-time error:
414416
415417
```text
416418
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
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-
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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+
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
420422
error: aborting due to previous error
421423
Could not compile `phrases`.
422424
```
@@ -523,7 +525,7 @@ This will build and run:
523525
```bash
524526
$ cargo run
525527
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
526-
Running `target/phrases`
528+
Running `target/debug/phrases`
527529
Hello in English: Hello!
528530
Goodbye in English: Goodbye.
529531
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.x = coordinate;
200+
self.y = coordinate;
201201
self
202202
}
203203

0 commit comments

Comments
 (0)