Skip to content

Commit e7f8e63

Browse files
committed
Convert old doc links to current edition
Use footnote style to bypass the tidy check
1 parent 6bba352 commit e7f8e63

File tree

15 files changed

+65
-50
lines changed

15 files changed

+65
-50
lines changed

Diff for: src/doc/guide-error-handling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% Error Handling in Rust
22

33
This content has moved into
4-
[the Rust Programming Language book](book/error-handling.html).
4+
[the Rust Programming Language book](book/ch09-00-error-handling.html).

Diff for: src/doc/guide-ownership.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% The (old) Rust Ownership Guide
22

33
This content has moved into
4-
[the Rust Programming Language book](book/ownership.html).
4+
[the Rust Programming Language book](book/ch04-00-understanding-ownership.html).

Diff for: src/doc/guide-pointers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
This content has been removed, with no direct replacement. Rust only
44
has two built-in pointer types now,
5-
[references](book/references-and-borrowing.html) and [raw
5+
[references](book/ch04-02-references-and-borrowing.html) and [raw
66
pointers](book/raw-pointers.html). Older Rusts had many more pointer
77
types, they’re gone now.

Diff for: src/doc/guide-testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% The (old) Rust Testing Guide
22

33
This content has moved into
4-
[the Rust Programming Language book](book/testing.html).
4+
[the Rust Programming Language book](book/ch11-00-testing.html).

Diff for: src/libcore/convert.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ pub const fn identity<T>(x: T) -> T { x }
113113
/// - Use `Borrow` when the goal is related to writing code that is agnostic to
114114
/// the type of borrow and whether it is a reference or value
115115
///
116-
/// See [the book][book] for a more detailed comparison.
117-
///
118-
/// [book]: ../../book/first-edition/borrow-and-asref.html
119116
/// [`Borrow`]: ../../std/borrow/trait.Borrow.html
120117
///
121118
/// **Note: this trait must not fail**. If the conversion can fail, use a
@@ -348,7 +345,7 @@ pub trait Into<T>: Sized {
348345
/// [`String`]: ../../std/string/struct.String.html
349346
/// [`Into<U>`]: trait.Into.html
350347
/// [`from`]: trait.From.html#tymethod.from
351-
/// [book]: ../../book/first-edition/error-handling.html
348+
/// [book]: ../../book/ch09-00-error-handling.html
352349
#[stable(feature = "rust1", since = "1.0.0")]
353350
pub trait From<T>: Sized {
354351
/// Performs the conversion.

Diff for: src/libcore/marker.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl<T: ?Sized> !Send for *mut T { }
7878
/// // be made into an object
7979
/// ```
8080
///
81-
/// [trait object]: ../../book/first-edition/trait-objects.html
81+
/// [trait object]: ../../book/ch17-02-trait-objects.html
8282
#[stable(feature = "rust1", since = "1.0.0")]
8383
#[lang = "sized"]
8484
#[rustc_on_unimplemented(
@@ -518,7 +518,7 @@ macro_rules! impls{
518518
/// types. We track the Rust type using a phantom type parameter on
519519
/// the struct `ExternalResource` which wraps a handle.
520520
///
521-
/// [FFI]: ../../book/first-edition/ffi.html
521+
/// [FFI]: ../../book/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code
522522
///
523523
/// ```
524524
/// # #![allow(dead_code)]

Diff for: src/libcore/mem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ pub const fn size_of<T>() -> usize {
298298
/// then `size_of_val` can be used to get the dynamically-known size.
299299
///
300300
/// [slice]: ../../std/primitive.slice.html
301-
/// [trait object]: ../../book/first-edition/trait-objects.html
301+
/// [trait object]: ../../book/ch17-02-trait-objects.html
302302
///
303303
/// # Examples
304304
///

Diff for: src/libproc_macro/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
//! function-like macros `#[proc_macro]`, macro attributes `#[proc_macro_attribute]` and
66
//! custom derive attributes`#[proc_macro_derive]`.
77
//!
8-
//! See [the book](../book/first-edition/procedural-macros.html) for more.
8+
//! See [the book] for more.
9+
//!
10+
//! [the book]: ../book/ch19-06-macros.html#procedural-macros-for-generating-code-from-attributes
911
1012
#![stable(feature = "proc_macro_lib", since = "1.15.0")]
1113
#![deny(missing_docs)]

Diff for: src/librustc/diagnostics.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore-tidy-linelength
12
#![allow(non_snake_case)]
23

34
// Error messages for EXXXX errors.
@@ -406,7 +407,7 @@ fn baz<'a>(x: &'a str, y: &str) -> &str { }
406407
Lifetime elision in implementation headers was part of the lifetime elision
407408
RFC. It is, however, [currently unimplemented][iss15872].
408409
409-
[book-le]: https://doc.rust-lang.org/nightly/book/first-edition/lifetimes.html#lifetime-elision
410+
[book-le]: https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#lifetime-elision
410411
[iss15872]: https://github.com/rust-lang/rust/issues/15872
411412
"##,
412413

@@ -642,7 +643,9 @@ attributes:
642643
#![no_std]
643644
```
644645
645-
See also https://doc.rust-lang.org/book/first-edition/no-stdlib.html
646+
See also the [unstable book][1].
647+
648+
[1]: https://doc.rust-lang.org/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib
646649
"##,
647650

648651
E0214: r##"
@@ -1680,7 +1683,7 @@ fn main() {
16801683
```
16811684
16821685
To understand better how closures work in Rust, read:
1683-
https://doc.rust-lang.org/book/first-edition/closures.html
1686+
https://doc.rust-lang.org/book/ch13-01-closures.html
16841687
"##,
16851688

16861689
E0580: r##"

Diff for: src/librustc_metadata/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern {}
3535
```
3636
3737
See more:
38-
https://doc.rust-lang.org/book/first-edition/conditional-compilation.html
38+
https://doc.rust-lang.org/reference/attributes.html#conditional-compilation
3939
"##,
4040

4141
E0458: r##"

Diff for: src/librustc_mir/diagnostics.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ fn main() {
690690
}
691691
```
692692
693-
See also https://doc.rust-lang.org/book/first-edition/unsafe.html
693+
See also https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
694694
"##,
695695

696696
E0373: r##"
@@ -873,7 +873,7 @@ that at most one writer or multiple readers can access the data at any one time.
873873
If you wish to learn more about ownership in Rust, start with the chapter in the
874874
Book:
875875
876-
https://doc.rust-lang.org/book/first-edition/ownership.html
876+
https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html
877877
"##,
878878

879879
E0383: r##"
@@ -1207,7 +1207,7 @@ let mut a = &mut i;
12071207
12081208
Please note that in rust, you can either have many immutable references, or one
12091209
mutable reference. Take a look at
1210-
https://doc.rust-lang.org/stable/book/references-and-borrowing.html for more
1210+
https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html for more
12111211
information. Example:
12121212
12131213
@@ -1374,7 +1374,7 @@ fn foo(a: &mut i32) {
13741374
```
13751375
13761376
For more information on the rust ownership system, take a look at
1377-
https://doc.rust-lang.org/stable/book/references-and-borrowing.html.
1377+
https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html.
13781378
"##,
13791379

13801380
E0503: r##"
@@ -1430,7 +1430,7 @@ fn main() {
14301430
```
14311431
14321432
You can find more information about borrowing in the rust-book:
1433-
http://doc.rust-lang.org/stable/book/references-and-borrowing.html
1433+
http://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html
14341434
"##,
14351435

14361436
E0504: r##"
@@ -1614,7 +1614,7 @@ fn main() {
16141614
```
16151615
16161616
You can find more information about borrowing in the rust-book:
1617-
http://doc.rust-lang.org/stable/book/references-and-borrowing.html
1617+
http://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html
16181618
"##,
16191619

16201620
E0506: r##"
@@ -1825,7 +1825,7 @@ mem::replace(&mut borrowed.knight, TheDarkKnight).nothing_is_true(); // ok!
18251825
```
18261826
18271827
You can find more information about borrowing in the rust-book:
1828-
http://doc.rust-lang.org/book/first-edition/references-and-borrowing.html
1828+
http://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html
18291829
"##,
18301830

18311831
E0508: r##"

Diff for: src/librustc_typeck/diagnostics.rs

+34-21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore-tidy-linelength
12
#![allow(non_snake_case)]
23

34
register_long_diagnostics! {
@@ -1543,7 +1544,9 @@ fn f<T>() {}
15431544
15441545
It is not possible to declare type parameters on a function that has the `start`
15451546
attribute. Such a function must have the following type signature (for more
1546-
information: http://doc.rust-lang.org/stable/book/first-edition/no-stdlib.html):
1547+
information, view [the unstable book][1]):
1548+
1549+
[1]: https://doc.rust-lang.org/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib
15471550
15481551
```
15491552
# let _:
@@ -2917,10 +2920,11 @@ impl Baz for Bar { } // Note: This is OK
29172920

29182921
E0374: r##"
29192922
A struct without a field containing an unsized type cannot implement
2920-
`CoerceUnsized`. An
2921-
[unsized type](https://doc.rust-lang.org/book/first-edition/unsized-types.html)
2922-
is any type that the compiler doesn't know the length or alignment of at
2923-
compile time. Any struct containing an unsized type is also unsized.
2923+
`CoerceUnsized`. An [unsized type][1] is any type that the compiler
2924+
doesn't know the length or alignment of at compile time. Any struct
2925+
containing an unsized type is also unsized.
2926+
2927+
[1]: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
29242928
29252929
Example of erroneous code:
29262930
@@ -2977,9 +2981,9 @@ A struct with more than one field containing an unsized type cannot implement
29772981
`CoerceUnsized`. This only occurs when you are trying to coerce one of the
29782982
types in your struct to another type in the struct. In this case we try to
29792983
impl `CoerceUnsized` from `T` to `U` which are both types that the struct
2980-
takes. An [unsized type] is any type that the compiler doesn't know the length
2981-
or alignment of at compile time. Any struct containing an unsized type is also
2982-
unsized.
2984+
takes. An [unsized type][1] is any type that the compiler doesn't know the
2985+
length or alignment of at compile time. Any struct containing an unsized type
2986+
is also unsized.
29832987
29842988
Example of erroneous code:
29852989
@@ -3024,19 +3028,20 @@ fn coerce_foo<T: CoerceUnsized<U>, U>(t: T) -> Foo<U> {
30243028
}
30253029
```
30263030
3027-
[unsized type]: https://doc.rust-lang.org/book/first-edition/unsized-types.html
3031+
[1]: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
30283032
"##,
30293033

30303034
E0376: r##"
30313035
The type you are trying to impl `CoerceUnsized` for is not a struct.
30323036
`CoerceUnsized` can only be implemented for a struct. Unsized types are
30333037
already able to be coerced without an implementation of `CoerceUnsized`
30343038
whereas a struct containing an unsized type needs to know the unsized type
3035-
field it's containing is able to be coerced. An
3036-
[unsized type](https://doc.rust-lang.org/book/first-edition/unsized-types.html)
3039+
field it's containing is able to be coerced. An [unsized type][1]
30373040
is any type that the compiler doesn't know the length or alignment of at
30383041
compile time. Any struct containing an unsized type is also unsized.
30393042
3043+
[1]: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
3044+
30403045
Example of erroneous code:
30413046
30423047
```compile_fail,E0376
@@ -3882,8 +3887,10 @@ let c = 86u8 as char; // ok!
38823887
assert_eq!(c, 'V');
38833888
```
38843889
3885-
For more information about casts, take a look at The Book:
3886-
https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3890+
For more information about casts, take a look at the Type cast section in
3891+
[The Reference Book][1].
3892+
3893+
[1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
38873894
"##,
38883895

38893896
E0605: r##"
@@ -3911,8 +3918,10 @@ let v = 0 as *const u8;
39113918
v as *const i8; // ok!
39123919
```
39133920
3914-
For more information about casts, take a look at The Book:
3915-
https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3921+
For more information about casts, take a look at the Type cast section in
3922+
[The Reference Book][1].
3923+
3924+
[1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
39163925
"##,
39173926

39183927
E0606: r##"
@@ -3933,8 +3942,10 @@ let x = &0u8;
39333942
let y: u32 = *x as u32; // We dereference it first and then cast it.
39343943
```
39353944
3936-
For more information about casts, take a look at The Book:
3937-
https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3945+
For more information about casts, take a look at the Type cast section in
3946+
[The Reference Book][1].
3947+
3948+
[1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
39383949
"##,
39393950

39403951
E0607: r##"
@@ -3960,8 +3971,10 @@ pointer holds is their size.
39603971
39613972
To fix this error, don't try to cast directly between thin and fat pointers.
39623973
3963-
For more information about casts, take a look at The Book:
3964-
https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3974+
For more information about casts, take a look at the Type cast section in
3975+
[The Reference Book][1].
3976+
3977+
[1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
39653978
"##,
39663979

39673980
E0609: r##"
@@ -4019,8 +4032,8 @@ println!("x: {}, y: {}", variable.x, variable.y);
40194032
```
40204033
40214034
For more information about primitives and structs, take a look at The Book:
4022-
https://doc.rust-lang.org/book/first-edition/primitive-types.html
4023-
https://doc.rust-lang.org/book/first-edition/structs.html
4035+
https://doc.rust-lang.org/book/ch03-02-data-types.html
4036+
https://doc.rust-lang.org/book/ch05-00-structs.html
40244037
"##,
40254038

40264039
E0614: r##"

Diff for: src/librustc_typeck/structured_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ To fix this error, don't try to cast directly between thin and fat
137137
pointers.
138138
139139
For more information about casts, take a look at The Book:
140-
https://doc.rust-lang.org/book/first-edition/casting-between-types.html");
140+
https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions");
141141
err
142142
}
143143
}

Diff for: src/libstd/prelude/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@
129129
//! [`std::string`]: ../string/index.html
130130
//! [`std::vec`]: ../vec/index.html
131131
//! [`to_owned`]: ../borrow/trait.ToOwned.html#tymethod.to_owned
132-
//! [book-closures]: ../../book/first-edition/closures.html
133-
//! [book-dtor]: ../../book/first-edition/drop.html
134-
//! [book-enums]: ../../book/first-edition/enums.html
135-
//! [book-iter]: ../../book/first-edition/iterators.html
132+
//! [book-closures]: ../../book/ch13-01-closures.html
133+
//! [book-dtor]: ../../book/ch15-03-drop.html
134+
//! [book-enums]: ../../book/ch06-01-defining-an-enum.html
135+
//! [book-iter]: ../../book/ch13-02-iterators.html
136136
137137
#![stable(feature = "rust1", since = "1.0.0")]
138138

Diff for: src/libtest/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! benchmarks themselves) should be done via the `#[test]` and
77
//! `#[bench]` attributes.
88
//!
9-
//! See the [Testing Chapter](../book/first-edition/testing.html) of the book for more details.
9+
//! See the [Testing Chapter](../book/ch11-00-testing.html) of the book for more details.
1010
1111
// Currently, not much of this is meant for users. It is intended to
1212
// support the simplest interface possible for representing and

0 commit comments

Comments
 (0)