Skip to content

Commit 910ec6d

Browse files
committed
Auto merge of #56118 - steveklabnik:update-books, r=alexcrichton
Update books for Rust 2018 This PR: 1. updates all of the books * I don't know if @gankro has further plans for the nomicon or not 2. updates the build process because TRPL is only distributing one edition now 3. fixes up the stdlib links I think that this passes but it's 3:20 am and so I'm sending it in and will fix up anything i missed in the morning. /cc @alexcrichton for the big beta backport
2 parents ee7bb94 + d7b3f5c commit 910ec6d

File tree

17 files changed

+49
-62
lines changed

17 files changed

+49
-62
lines changed

Diff for: src/bootstrap/doc.rs

+15-11
Original file line numberDiff line numberDiff line change
@@ -260,22 +260,31 @@ impl Step for TheBook {
260260
let compiler = self.compiler;
261261
let target = self.target;
262262
let name = self.name;
263-
// build book first edition
263+
264+
// build book
264265
builder.ensure(Rustbook {
265266
target,
266-
name: INTERNER.intern_string(format!("{}/first-edition", name)),
267+
name: INTERNER.intern_string(name.to_string()),
267268
});
268269

269-
// build book second edition
270+
// building older edition redirects
271+
272+
let source_name = format!("{}/first-edition", name);
270273
builder.ensure(Rustbook {
271274
target,
272-
name: INTERNER.intern_string(format!("{}/second-edition", name)),
275+
name: INTERNER.intern_string(source_name),
273276
});
274277

275-
// build book 2018 edition
278+
let source_name = format!("{}/second-edition", name);
276279
builder.ensure(Rustbook {
277280
target,
278-
name: INTERNER.intern_string(format!("{}/2018-edition", name)),
281+
name: INTERNER.intern_string(source_name),
282+
});
283+
284+
let source_name = format!("{}/2018-edition", name);
285+
builder.ensure(Rustbook {
286+
target,
287+
name: INTERNER.intern_string(source_name),
279288
});
280289

281290
// build the version info page and CSS
@@ -284,11 +293,6 @@ impl Step for TheBook {
284293
target,
285294
});
286295

287-
// build the index page
288-
let index = format!("{}/index.md", name);
289-
builder.info(&format!("Documenting book index ({})", target));
290-
invoke_rustdoc(builder, compiler, target, &index);
291-
292296
// build the redirect pages
293297
builder.info(&format!("Documenting book redirect pages ({})", target));
294298
for file in t!(fs::read_dir(builder.src.join("src/doc/book/redirects"))) {

Diff for: src/doc/book

Submodule book updated 438 files

Diff for: src/doc/nomicon

Diff for: src/doc/reference

Diff for: src/doc/unstable-book/src/language-features/macro-literal-matcher.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ The tracking issue for this feature is: [#35625]
44

55
The RFC is: [rfc#1576].
66

7-
With this feature gate enabled, the [list of fragment specifiers][frags] gains one more entry:
7+
With this feature gate enabled, the [list of designators] gains one more entry:
88

99
* `literal`: a literal. Examples: 2, "string", 'c'
1010

1111
A `literal` may be followed by anything, similarly to the `ident` specifier.
1212

1313
[rfc#1576]: http://rust-lang.github.io/rfcs/1576-macros-literal-matcher.html
1414
[#35625]: https://github.com/rust-lang/rust/issues/35625
15-
[frags]: ../book/first-edition/macros.html#syntactic-requirements
15+
[list of designators]: ../reference/macros-by-example.html
1616

1717
------------------------

Diff for: src/doc/unstable-book/src/language-features/plugin.md

-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ of extensions. See `Registry::register_syntax_extension` and the
137137

138138
## Tips and tricks
139139

140-
Some of the [macro debugging tips](../book/first-edition/macros.html#debugging-macro-code) are applicable.
141-
142140
You can use `syntax::parse` to turn token trees into
143141
higher-level syntax elements like expressions:
144142

Diff for: src/liballoc/rc.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
//!
4444
//! `Rc<T>` automatically dereferences to `T` (via the [`Deref`] trait),
4545
//! so you can call `T`'s methods on a value of type [`Rc<T>`][`Rc`]. To avoid name
46-
//! clashes with `T`'s methods, the methods of [`Rc<T>`][`Rc`] itself are [associated
47-
//! functions][assoc], called using function-like syntax:
46+
//! clashes with `T`'s methods, the methods of [`Rc<T>`][`Rc`] itself are associated
47+
//! functions, called using function-like syntax:
4848
//!
4949
//! ```
5050
//! use std::rc::Rc;
@@ -234,7 +234,6 @@
234234
//! [downgrade]: struct.Rc.html#method.downgrade
235235
//! [upgrade]: struct.Weak.html#method.upgrade
236236
//! [`None`]: ../../std/option/enum.Option.html#variant.None
237-
//! [assoc]: ../../book/first-edition/method-syntax.html#associated-functions
238237
//! [mutability]: ../../std/cell/index.html#introducing-mutability-inside-of-something-immutable
239238
240239
#![stable(feature = "rust1", since = "1.0.0")]

Diff for: src/liballoc/sync.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
120120
///
121121
/// `Arc<T>` automatically dereferences to `T` (via the [`Deref`][deref] trait),
122122
/// so you can call `T`'s methods on a value of type `Arc<T>`. To avoid name
123-
/// clashes with `T`'s methods, the methods of `Arc<T>` itself are [associated
124-
/// functions][assoc], called using function-like syntax:
123+
/// clashes with `T`'s methods, the methods of `Arc<T>` itself are associated
124+
/// functions, called using function-like syntax:
125125
///
126126
/// ```
127127
/// use std::sync::Arc;
@@ -146,7 +146,6 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
146146
/// [downgrade]: struct.Arc.html#method.downgrade
147147
/// [upgrade]: struct.Weak.html#method.upgrade
148148
/// [`None`]: ../../std/option/enum.Option.html#variant.None
149-
/// [assoc]: ../../book/first-edition/method-syntax.html#associated-functions
150149
/// [`RefCell<T>`]: ../../std/cell/struct.RefCell.html
151150
/// [`std::sync`]: ../../std/sync/index.html
152151
/// [`Arc::clone(&from)`]: #method.clone

Diff for: src/libcore/char/convert.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use super::MAX;
1919
/// Converts a `u32` to a `char`.
2020
///
2121
/// Note that all [`char`]s are valid [`u32`]s, and can be cast to one with
22-
/// [`as`]:
22+
/// `as`:
2323
///
2424
/// ```
2525
/// let c = '💯';
@@ -34,7 +34,6 @@ use super::MAX;
3434
///
3535
/// [`char`]: ../../std/primitive.char.html
3636
/// [`u32`]: ../../std/primitive.u32.html
37-
/// [`as`]: ../../book/first-edition/casting-between-types.html#as
3837
///
3938
/// For an unsafe version of this function which ignores these checks, see
4039
/// [`from_u32_unchecked`].
@@ -71,7 +70,7 @@ pub fn from_u32(i: u32) -> Option<char> {
7170
/// Converts a `u32` to a `char`, ignoring validity.
7271
///
7372
/// Note that all [`char`]s are valid [`u32`]s, and can be cast to one with
74-
/// [`as`]:
73+
/// `as`:
7574
///
7675
/// ```
7776
/// let c = '💯';
@@ -86,7 +85,6 @@ pub fn from_u32(i: u32) -> Option<char> {
8685
///
8786
/// [`char`]: ../../std/primitive.char.html
8887
/// [`u32`]: ../../std/primitive.u32.html
89-
/// [`as`]: ../../book/first-edition/casting-between-types.html#as
9088
///
9189
/// # Safety
9290
///

Diff for: src/libcore/iter/iterator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ pub trait Iterator {
532532
/// If you're doing some sort of looping for a side effect, it's considered
533533
/// more idiomatic to use [`for`] than `map()`.
534534
///
535-
/// [`for`]: ../../book/first-edition/loops.html#for
535+
/// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
536536
///
537537
/// # Examples
538538
///
@@ -580,7 +580,7 @@ pub trait Iterator {
580580
/// cases `for_each` may also be faster than a loop, because it will use
581581
/// internal iteration on adaptors like `Chain`.
582582
///
583-
/// [`for`]: ../../book/first-edition/loops.html#for
583+
/// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
584584
///
585585
/// # Examples
586586
///
@@ -1669,7 +1669,7 @@ pub trait Iterator {
16691669
/// use a `for` loop with a list of things to build up a result. Those
16701670
/// can be turned into `fold()`s:
16711671
///
1672-
/// [`for`]: ../../book/first-edition/loops.html#for
1672+
/// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
16731673
///
16741674
/// ```
16751675
/// let numbers = [1, 2, 3, 4, 5];

Diff for: src/libcore/mem.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ pub use intrinsics::transmute;
132132
/// [uninit]: fn.uninitialized.html
133133
/// [clone]: ../clone/trait.Clone.html
134134
/// [swap]: fn.swap.html
135-
/// [FFI]: ../../book/first-edition/ffi.html
136135
/// [box]: ../../std/boxed/struct.Box.html
137136
/// [leak]: ../../std/boxed/struct.Box.html#method.leak
138137
/// [into_raw]: ../../std/boxed/struct.Box.html#method.into_raw
@@ -479,7 +478,7 @@ pub const fn needs_drop<T>() -> bool {
479478
///
480479
/// This has the same effect as allocating space with
481480
/// [`mem::uninitialized`][uninit] and then zeroing it out. It is useful for
482-
/// [FFI] sometimes, but should generally be avoided.
481+
/// FFI sometimes, but should generally be avoided.
483482
///
484483
/// There is no guarantee that an all-zero byte-pattern represents a valid value of
485484
/// some type `T`. If `T` has a destructor and the value is destroyed (due to
@@ -490,7 +489,6 @@ pub const fn needs_drop<T>() -> bool {
490489
/// many of the same caveats.
491490
///
492491
/// [uninit]: fn.uninitialized.html
493-
/// [FFI]: ../../book/first-edition/ffi.html
494492
/// [ub]: ../../reference/behavior-considered-undefined.html
495493
///
496494
/// # Examples
@@ -514,11 +512,9 @@ pub unsafe fn zeroed<T>() -> T {
514512
/// **This is incredibly dangerous and should not be done lightly. Deeply
515513
/// consider initializing your memory with a default value instead.**
516514
///
517-
/// This is useful for [FFI] functions and initializing arrays sometimes,
515+
/// This is useful for FFI functions and initializing arrays sometimes,
518516
/// but should generally be avoided.
519517
///
520-
/// [FFI]: ../../book/first-edition/ffi.html
521-
///
522518
/// # Undefined behavior
523519
///
524520
/// It is [undefined behavior][ub] to read uninitialized memory, even just an
@@ -689,10 +685,9 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
689685
/// While this does call the argument's implementation of [`Drop`][drop],
690686
/// it will not release any borrows, as borrows are based on lexical scope.
691687
///
692-
/// This effectively does nothing for
693-
/// [types which implement `Copy`](../../book/first-edition/ownership.html#copy-types),
694-
/// e.g. integers. Such values are copied and _then_ moved into the function,
695-
/// so the value persists after this function call.
688+
/// This effectively does nothing for types which implement `Copy`, e.g.
689+
/// integers. Such values are copied and _then_ moved into the function, so the
690+
/// value persists after this function call.
696691
///
697692
/// This function is not magic; it is literally defined as
698693
///

Diff for: src/libcore/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
//! [`NonNull::dangling`] in such cases.
5959
//!
6060
//! [aliasing]: ../../nomicon/aliasing.html
61-
//! [book]: ../../book/second-edition/ch19-01-unsafe-rust.html#dereferencing-a-raw-pointer
61+
//! [book]: ../../book/ch19-01-unsafe-rust.html#dereferencing-a-raw-pointer
6262
//! [ub]: ../../reference/behavior-considered-undefined.html
6363
//! [null]: ./fn.null.html
6464
//! [zst]: ../../nomicon/exotic-sizes.html#zero-sized-types-zsts

Diff for: src/libcore/raw.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
/// The representation of a trait object like `&SomeTrait`.
2222
///
2323
/// This struct has the same layout as types like `&SomeTrait` and
24-
/// `Box<AnotherTrait>`. The [Trait Objects chapter of the
25-
/// Book][moreinfo] contains more details about the precise nature of
26-
/// these internals.
27-
///
28-
/// [moreinfo]: ../../book/first-edition/trait-objects.html#representation
24+
/// `Box<AnotherTrait>`.
2925
///
3026
/// `TraitObject` is guaranteed to match layouts, but it is not the
3127
/// type of trait objects (e.g. the fields are not directly accessible

Diff for: src/libstd/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
//! [slice]: primitive.slice.html
186186
//! [`atomic`]: sync/atomic/index.html
187187
//! [`collections`]: collections/index.html
188-
//! [`for`]: ../book/first-edition/loops.html#for
188+
//! [`for`]: ../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
189189
//! [`format!`]: macro.format.html
190190
//! [`fs`]: fs/index.html
191191
//! [`io`]: io/index.html
@@ -200,14 +200,14 @@
200200
//! [`sync`]: sync/index.html
201201
//! [`thread`]: thread/index.html
202202
//! [`use std::env`]: env/index.html
203-
//! [`use`]: ../book/first-edition/crates-and-modules.html#importing-modules-with-use
204-
//! [crate root]: ../book/first-edition/crates-and-modules.html#basic-terminology-crates-and-modules
203+
//! [`use`]: ../book/ch07-02-modules-and-use-to-control-scope-and-privacy.html#the-use-keyword-to-bring-paths-into-a-scope
204+
//! [crate root]: ../book/ch07-01-packages-and-crates-for-making-libraries-and-executables.html
205205
//! [crates.io]: https://crates.io
206-
//! [deref-coercions]: ../book/second-edition/ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods
206+
//! [deref-coercions]: ../book/ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods
207207
//! [files]: fs/struct.File.html
208208
//! [multithreading]: thread/index.html
209209
//! [other]: #what-is-in-the-standard-library-documentation
210-
//! [primitive types]: ../book/first-edition/primitive-types.html
210+
//! [primitive types]: ../book/ch03-02-data-types.html
211211
212212
#![stable(feature = "rust1", since = "1.0.0")]
213213
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

Diff for: src/libstd/macros.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
///
3333
/// [`Result`] enum is often a better solution for recovering from errors than
3434
/// using the `panic!` macro. This macro should be used to avoid proceeding using
35-
/// incorrect values, such as from external sources. Detailed information about
35+
/// incorrect values, such as from external sources. Detailed information about
3636
/// error handling is found in the [book].
3737
///
3838
/// The multi-argument form of this macro panics with a string and has the
@@ -45,7 +45,7 @@
4545
/// [`Result`]: ../std/result/enum.Result.html
4646
/// [`format!`]: ../std/macro.format.html
4747
/// [`compile_error!`]: ../std/macro.compile_error.html
48-
/// [book]: ../book/second-edition/ch09-01-unrecoverable-errors-with-panic.html
48+
/// [book]: ../book/ch09-00-error-handling.html
4949
///
5050
/// # Current implementation
5151
///
@@ -839,8 +839,8 @@ mod builtin {
839839
/// boolean expression evaluation of configuration flags. This frequently
840840
/// leads to less duplicated code.
841841
///
842-
/// The syntax given to this macro is the same syntax as [the `cfg`
843-
/// attribute](../book/first-edition/conditional-compilation.html).
842+
/// The syntax given to this macro is the same syntax as the `cfg`
843+
/// attribute.
844844
///
845845
/// # Examples
846846
///
@@ -915,7 +915,7 @@ mod builtin {
915915
/// Unsafe code relies on `assert!` to enforce run-time invariants that, if
916916
/// violated could lead to unsafety.
917917
///
918-
/// Other use-cases of `assert!` include [testing] and enforcing run-time
918+
/// Other use-cases of `assert!` include testing and enforcing run-time
919919
/// invariants in safe code (whose violation cannot result in unsafety).
920920
///
921921
/// # Custom Messages
@@ -926,7 +926,6 @@ mod builtin {
926926
///
927927
/// [`panic!`]: macro.panic.html
928928
/// [`debug_assert!`]: macro.debug_assert.html
929-
/// [testing]: ../book/second-edition/ch11-01-writing-tests.html#checking-results-with-the-assert-macro
930929
/// [`std::fmt`]: ../std/fmt/index.html
931930
///
932931
/// # Examples

Diff for: src/libstd/primitive_docs.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/// `bool` implements various traits, such as [`BitAnd`], [`BitOr`], [`Not`], etc.,
2323
/// which allow us to perform boolean operations using `&`, `|` and `!`.
2424
///
25-
/// [`if`] always demands a `bool` value. [`assert!`], being an important macro in testing,
25+
/// `if` always demands a `bool` value. [`assert!`], being an important macro in testing,
2626
/// checks whether an expression returns `true`.
2727
///
2828
/// ```
@@ -31,7 +31,6 @@
3131
/// ```
3232
///
3333
/// [`assert!`]: macro.assert.html
34-
/// [`if`]: ../book/first-edition/if.html
3534
/// [`BitAnd`]: ops/trait.BitAnd.html
3635
/// [`BitOr`]: ops/trait.BitOr.html
3736
/// [`Not`]: ops/trait.Not.html
@@ -695,7 +694,7 @@ mod prim_str { }
695694
/// assert_eq!(tuple.2, 'c');
696695
/// ```
697696
///
698-
/// For more about tuples, see [the book](../book/first-edition/primitive-types.html#tuples).
697+
/// For more about tuples, see [the book](../book/ch03-02-data-types.html#the-tuple-type).
699698
///
700699
/// # Trait implementations
701700
///

0 commit comments

Comments
 (0)