-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1088 from passcod/improve-redirects
Improve redirects
- Loading branch information
Showing
57 changed files
with
1,064 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
% There is a new edition of the book | ||
% Attributes | ||
|
||
This is an old link. You can [continue to the exact older page][1]. | ||
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice. | ||
<small>There is a new edition of the book and this is an old link.</small> | ||
|
||
* [This page in the first edition of the The Rust Programming Language][1] | ||
> Any item declaration may have an attribute applied to it. | ||
* [Index of the second edition of The Rust Programming Language][2] | ||
```rust | ||
// A function marked as a unit test | ||
#[test] | ||
fn test_foo() { | ||
/* ... */ | ||
} | ||
``` | ||
|
||
--- | ||
|
||
Here are the relevant sections in the new and old books: | ||
|
||
* **[In the Rust Reference: Ch 5.3 — Attributes][2]** | ||
* <small>[In the first edition: Ch 3.27 — Attributes][1]</small> | ||
|
||
|
||
[1]: first-edition/attributes.html | ||
[2]: second-edition/index.html | ||
[2]: ../reference/attributes.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
% There is a new edition of the book | ||
% Bibliography | ||
|
||
This is an old link. You can [continue to the exact older page][1]. | ||
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice. | ||
<small>There is a new edition of the book and this is an old link.</small> | ||
|
||
* [This page in the first edition of the The Rust Programming Language][1] | ||
This page does not exist in [the second edition][2]. | ||
You might be interested in a similar page in [the Rust Reference][3]. | ||
|
||
* [Index of the second edition of The Rust Programming Language][2] | ||
* **[In the Rust Reference: Appendix — Influences][3]** | ||
* <small>[In the first edition: Section 7 — Bibliography][1]</small> | ||
|
||
|
||
[1]: first-edition/bibliography.html | ||
[2]: second-edition/index.html | ||
[3]: ../reference/influences.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
% There is a new edition of the book | ||
% Borrow and AsRef | ||
|
||
This is an old link. You can [continue to the exact older page][1]. | ||
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice. | ||
<small>There is a new edition of the book and this is an old link.</small> | ||
|
||
* [This page in the first edition of the The Rust Programming Language][1] | ||
> A cheap reference-to-reference conversion. | ||
> Used to convert a value to a reference value within generic code. | ||
* [Index of the second edition of The Rust Programming Language][2] | ||
```rust | ||
fn is_hello<T: AsRef<str>>(s: T) { | ||
assert_eq!("hello", s.as_ref()); | ||
} | ||
``` | ||
|
||
--- | ||
|
||
This chapter does not exist in [the second edition][2]. | ||
The best place to learn more about this is [the Rust documentation][3]. | ||
|
||
* **[In the Rust documentation: `convert::AsRef`][3]** | ||
* <small>[In the first edition: Ch 4.10 — Borrow and AsRef][1]</small> | ||
|
||
|
||
[1]: first-edition/borrow-and-asref.html | ||
[2]: second-edition/index.html | ||
[3]: ../std/convert/trait.AsRef.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,32 @@ | ||
% There is a new edition of the book | ||
% Casting between types | ||
|
||
This is an old link. You can [continue to the exact older page][1]. | ||
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice. | ||
<small>There is a new edition of the book and this is an old link.</small> | ||
|
||
* [This page in the first edition of the The Rust Programming Language][1] | ||
> A type cast expression is denoted with the binary operator `as`. | ||
> Executing an `as` expression casts the value on the left-hand side to the type on the right-hand side. | ||
* [Index of the second edition of The Rust Programming Language][2] | ||
```rust | ||
# fn sum(values: &[f64]) -> f64 { 0.0 } | ||
# fn len(values: &[f64]) -> i32 { 0 } | ||
|
||
fn average(values: &[f64]) -> f64 { | ||
let sum: f64 = sum(values); | ||
let size: f64 = len(values) as f64; | ||
sum / size | ||
} | ||
``` | ||
|
||
--- | ||
|
||
Here are the relevant sections in the new and old books: | ||
|
||
* **[In the second edition: Appendix B — Operators, section Type Cast Expressions][2]** | ||
* [In the Rust Reference: Type Cast Expressions][3] | ||
* [In the Rust documentation: `mem::transmute`][4] | ||
* <small>[In the first edition: Ch 3.29 — Casting between types][1]</small> | ||
|
||
|
||
[1]: first-edition/casting-between-types.html | ||
[2]: second-edition/index.html | ||
[2]: second-edition/appendix-02-operators.html#type-cast-expressions | ||
[3]: ../reference/expressions/operator-expr.html#type-cast-expressions | ||
[4]: ../std/mem/fn.transmute.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
% The Rust Programming Language Has Moved | ||
% Compiler Plugins | ||
|
||
This chapter of the book has moved to [a chapter in the Unstable | ||
Book][unstable book plugins]. Please check it out there. | ||
<small>There is a new edition of the book and this is an old link.</small> | ||
|
||
[unstable book plugins]: ../unstable-book/language-features/plugin.html | ||
> Compiler plugins are user-provided libraries that extend the compiler's behavior with new syntax extensions, lint checks, etc. | ||
--- | ||
|
||
This particular chapter has moved to [the Unstable Book][2]. | ||
|
||
* **[In the Unstable Rust Book: `plugin`][2]** | ||
* <small><del>[In the first edition: Compiler Plugins][1]</del> (does not exist anymore)</small> | ||
|
||
|
||
[1]: first-edition/compiler-plugins.html | ||
[2]: ../unstable-book/language-features/plugin.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
% There is a new edition of the book | ||
% Conditional Compilation | ||
|
||
This is an old link. You can [continue to the exact older page][1]. | ||
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice. | ||
<small>There is a new edition of the book and this is an old link.</small> | ||
|
||
* [This page in the first edition of the The Rust Programming Language][1] | ||
> Sometimes one wants to have different compiler outputs from the same code, depending on build target, such as targeted operating system, or to enable release builds. | ||
> Configuration options are either provided by the compiler or passed in on the command line using. | ||
> Rust code then checks for their presence using the `#[cfg(...)]` attribute | ||
* [Index of the second edition of The Rust Programming Language][2] | ||
```rust | ||
// The function is only included in the build when compiling for macOS | ||
#[cfg(target_os = "macos")] | ||
fn macos_only() { | ||
// ... | ||
} | ||
``` | ||
|
||
--- | ||
|
||
This particular chapter does not exist in [the second edition][2]. | ||
The best place to learn about it is [the Rust Reference][3]. | ||
|
||
* **[In the Rust Reference: Ch 5.3 — Attributes, Conditional Compilation section][3]** | ||
* <small>[In the first edition: Ch 4.3 — Conditional Compilation][1]</small> | ||
|
||
|
||
[1]: first-edition/conditional-compilation.html | ||
[2]: second-edition/index.html | ||
[2]: second-edition/ | ||
[3]: ../reference/attributes.html#conditional-compilation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
% There is a new edition of the book | ||
% Crates and Modules | ||
|
||
This is an old link. You can [continue to the exact older page][1]. | ||
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice. | ||
<small>There is a new edition of the book and this is an old link.</small> | ||
|
||
* [This page in the first edition of the The Rust Programming Language][1] | ||
> Rust has a module system that enables the reuse of code in an organized fashion. | ||
> A module is a namespace that contains definitions of functions or types, and you can choose whether those definitions are visible outside their module (public) or not (private). | ||
> | ||
> A crate is a project that other people can pull into their projects as a dependency. | ||
* [Related chapter about modules in the second edition of The Rust Programming Language][2] | ||
```rust | ||
mod network { | ||
fn connect() { | ||
} | ||
} | ||
``` | ||
|
||
* [Related chapter about crates in the second edition of The Rust Programming Language][3] | ||
--- | ||
|
||
Here are the relevant sections in the new and old books: | ||
|
||
* **[In the second edition: Ch 7.01 — `mod` and the Filesystem][2]** | ||
* [In the second edition: Ch 14.02 — Publishing a Crate to Crates.io][2] | ||
* <small>[In the first edition: Ch 3.25 — Crates and Modules][1]</small> | ||
|
||
|
||
[1]: first-edition/crates-and-modules.html | ||
[2]: second-edition/ch07-00-modules.html | ||
[3]: second-edition/ch14-00-more-about-cargo.html | ||
[2]: second-edition/ch07-01-mod-and-the-filesystem.html | ||
[3]: second-edition/ch14-02-publishing-to-crates-io.html |
Oops, something went wrong.