From 4d988c795a28a076778bf1ee9a47a639255481bc Mon Sep 17 00:00:00 2001 From: Jaime Terreu Date: Thu, 3 Aug 2023 22:36:34 +0930 Subject: [PATCH 1/9] Improve sentence --- src/ch10-03-lifetime-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch10-03-lifetime-syntax.md b/src/ch10-03-lifetime-syntax.md index 5229ab74b3..eacbbd2818 100644 --- a/src/ch10-03-lifetime-syntax.md +++ b/src/ch10-03-lifetime-syntax.md @@ -44,7 +44,7 @@ The outer scope declares a variable named `r` with no initial value, and the inner scope declares a variable named `x` with the initial value of 5. Inside the inner scope, we attempt to set the value of `r` as a reference to `x`. Then the inner scope ends, and we attempt to print the value in `r`. This code won’t -compile because the value `r` is referring to has gone out of scope before we +compile because what the value `r` is referring to has gone out of scope before we try to use it. Here is the error message: ```console From 66aedb4a61bf208c69d61b2f89bac25f70d6cdad Mon Sep 17 00:00:00 2001 From: Mike Krisher Date: Wed, 2 Aug 2023 15:25:31 -0400 Subject: [PATCH 2/9] Small wording changes --- src/ch10-03-lifetime-syntax.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch10-03-lifetime-syntax.md b/src/ch10-03-lifetime-syntax.md index eacbbd2818..498f01f0b5 100644 --- a/src/ch10-03-lifetime-syntax.md +++ b/src/ch10-03-lifetime-syntax.md @@ -8,13 +8,13 @@ One detail we didn’t discuss in the [“References and Borrowing”][references-and-borrowing] section in Chapter 4 is that every reference in Rust has a *lifetime*, which is the scope for which that reference is valid. Most of the time, lifetimes are implicit and inferred, -just like most of the time, types are inferred. We only must annotate types +just like most of the time, types are inferred. We must only annotate types when multiple types are possible. In a similar way, we must annotate lifetimes when the lifetimes of references could be related in a few different ways. Rust requires us to annotate the relationships using generic lifetime parameters to ensure the actual references used at runtime will definitely be valid. -Annotating lifetimes is not even a concept most other programming languages +Annotating lifetimes is not a concept most other programming languages have, so this is going to feel unfamiliar. Although we won’t cover lifetimes in their entirety in this chapter, we’ll discuss common ways you might encounter lifetime syntax so you can get comfortable with the concept. From 72187f5cd0beaaa9c6f584156bcd88f921871e83 Mon Sep 17 00:00:00 2001 From: kadiwa Date: Sat, 15 Jul 2023 17:02:35 +0200 Subject: [PATCH 3/9] redirects: change link for `#![no_std]` tutorial --- redirects/using-rust-without-the-standard-library.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redirects/using-rust-without-the-standard-library.md b/redirects/using-rust-without-the-standard-library.md index 75145429d4..0fbdfebdd6 100644 --- a/redirects/using-rust-without-the-standard-library.md +++ b/redirects/using-rust-without-the-standard-library.md @@ -7,11 +7,11 @@ --- -This particular chapter has moved to [the Unstable Book][2]. +This particular chapter has moved to [the Rustonomicon][2]. -* **[In the Unstable Rust Book: `lang_items` — Writing an executable without stdlib][2]** +* **[In the Rustonomicon: Beneath std][2]** * [In the first edition: Ch 4.12 — Using Rust without the Standard Library][1] [1]: https://doc.rust-lang.org/1.30.0/book/first-edition/using-rust-without-the-standard-library.html -[2]: ../unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib +[2]: ../nomicon/beneath-std.html From 3dca2fc50b922a8efb94903b9fee8bb42ab48f38 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 19 Oct 2023 09:10:43 -0700 Subject: [PATCH 4/9] Fix cargo doc links --- src/ch02-00-guessing-game-tutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch02-00-guessing-game-tutorial.md b/src/ch02-00-guessing-game-tutorial.md index 4f28573333..5e27fb114d 100644 --- a/src/ch02-00-guessing-game-tutorial.md +++ b/src/ch02-00-guessing-game-tutorial.md @@ -930,8 +930,8 @@ discusses structs and method syntax, and Chapter 6 explains how enums work. [randcrate]: https://crates.io/crates/rand [semver]: http://semver.org [cratesio]: https://crates.io/ -[doccargo]: http://doc.crates.io -[doccratesio]: http://doc.crates.io/crates-io.html +[doccargo]: https://doc.rust-lang.org/cargo/ +[doccratesio]: https://doc.rust-lang.org/cargo/reference/publishing.html [match]: ch06-02-match.html [shadowing]: ch03-01-variables-and-mutability.html#shadowing [parse]: ../std/primitive.str.html#method.parse From 5b6c1ceaa62ecbd6caef08df39b33b3938e99deb Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 31 Oct 2023 09:22:17 +1100 Subject: [PATCH 5/9] Prepare for removal of compiler plugin support. https://github.com/rust-lang/rust/pull/116412 will remove support for compiler plugins from rustc, which includes the entry in The Rust Unstable Book. This commit removes a link to that entry so it won't be broken when that PR merges. --- redirects/compiler-plugins.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/redirects/compiler-plugins.md b/redirects/compiler-plugins.md index 66061adf5a..67187f5f6b 100644 --- a/redirects/compiler-plugins.md +++ b/redirects/compiler-plugins.md @@ -2,12 +2,5 @@ There is a new edition of the book and this is an old link. -> 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]** - -[2]: ../unstable-book/language-features/plugin.html +> Compiler plugins were user-provided libraries that extended the compiler's behavior in certain ways. +> Support for them has been removed. From d0473bee36c64303989075bd61abe4ada42fed0f Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Sun, 5 Nov 2023 22:25:22 +0100 Subject: [PATCH 6/9] Fix mdBook links --- CONTRIBUTING.md | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a58ea42038..a20cb58501 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,4 +70,4 @@ a new language! We're waiting on [mdbook support] for multiple languages before we merge any in, but feel free to start! [Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations -[mdbook support]: https://github.com/rust-lang-nursery/mdBook/issues/5 +[mdbook support]: https://github.com/rust-lang/mdBook/issues/5 diff --git a/README.md b/README.md index f6341efc9c..c70c85e727 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ See the [releases] to download just the code of all the code listings that appea Building the book requires [mdBook], ideally the same version that rust-lang/rust uses in [this file][rust-mdbook]. To get it: -[mdBook]: https://github.com/rust-lang-nursery/mdBook +[mdBook]: https://github.com/rust-lang/mdBook [rust-mdbook]: https://github.com/rust-lang/rust/blob/master/src/tools/rustbook/Cargo.toml ```bash @@ -93,7 +93,7 @@ a new language! We're waiting on [mdbook support] for multiple languages before we merge any in, but feel free to start! [Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations -[mdbook support]: https://github.com/rust-lang-nursery/mdBook/issues/5 +[mdbook support]: https://github.com/rust-lang/mdBook/issues/5 ## Spellchecking From 44c783863ad2e587f19a8c54ace153b79e883958 Mon Sep 17 00:00:00 2001 From: Aryan Malik Date: Wed, 8 Nov 2023 00:04:02 +0530 Subject: [PATCH 7/9] Fixed 'troubleshooting' link --- src/ch01-02-hello-world.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch01-02-hello-world.md b/src/ch01-02-hello-world.md index 8d8d754d7b..9cbbc514ca 100644 --- a/src/ch01-02-hello-world.md +++ b/src/ch01-02-hello-world.md @@ -102,7 +102,7 @@ first line declares a function named `main` that has no parameters and returns nothing. If there were parameters, they would go inside the parentheses `()`. The function body is wrapped in `{}`. Rust requires curly brackets around all -function bodies. It’s good style to place the opening curly bracket on the same +function bodies. It’s a good style to place the opening curly bracket on the same line as the function declaration, adding one space in between. > Note: If you want to stick to a standard style across Rust projects, you can @@ -197,5 +197,5 @@ grows, you’ll want to manage all the options and make it easy to share your code. Next, we’ll introduce you to the Cargo tool, which will help you write real-world Rust programs. -[troubleshooting]: ch01-01-installation.html#troubleshooting +[troubleshooting]: ch01-01-installation.md#troubleshooting [devtools]: appendix-04-useful-development-tools.md From 98f0eefaaa7474d645c8c3ea51a25e71851f8586 Mon Sep 17 00:00:00 2001 From: Aryan Malik Date: Wed, 8 Nov 2023 22:27:52 +0530 Subject: [PATCH 8/9] Update ch01-02-hello-world.md --- src/ch01-02-hello-world.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch01-02-hello-world.md b/src/ch01-02-hello-world.md index 9cbbc514ca..fd4ebfce94 100644 --- a/src/ch01-02-hello-world.md +++ b/src/ch01-02-hello-world.md @@ -102,7 +102,7 @@ first line declares a function named `main` that has no parameters and returns nothing. If there were parameters, they would go inside the parentheses `()`. The function body is wrapped in `{}`. Rust requires curly brackets around all -function bodies. It’s a good style to place the opening curly bracket on the same +function bodies. It’s good style to place the opening curly bracket on the same line as the function declaration, adding one space in between. > Note: If you want to stick to a standard style across Rust projects, you can @@ -198,4 +198,4 @@ code. Next, we’ll introduce you to the Cargo tool, which will help you write real-world Rust programs. [troubleshooting]: ch01-01-installation.md#troubleshooting -[devtools]: appendix-04-useful-development-tools.md +[devtools]: appendix-04-useful-development-tools.html From 71352deb20727b4dda9ebfe8182709d5bf17dfea Mon Sep 17 00:00:00 2001 From: Aryan Malik Date: Wed, 8 Nov 2023 23:22:24 +0530 Subject: [PATCH 9/9] Update ch01-02-hello-world.md --- src/ch01-02-hello-world.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch01-02-hello-world.md b/src/ch01-02-hello-world.md index fd4ebfce94..f291463799 100644 --- a/src/ch01-02-hello-world.md +++ b/src/ch01-02-hello-world.md @@ -197,5 +197,5 @@ grows, you’ll want to manage all the options and make it easy to share your code. Next, we’ll introduce you to the Cargo tool, which will help you write real-world Rust programs. -[troubleshooting]: ch01-01-installation.md#troubleshooting +[troubleshooting]: ch01-01-installation.html#troubleshooting [devtools]: appendix-04-useful-development-tools.html