diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:24 +0000 |
commit | 023939b627b7dc93b01471f7d41fb8553ddb4ffa (patch) | |
tree | 60fc59477c605c72b0a1051409062ddecc43f877 /src/doc/book | |
parent | Adding debian version 1.72.1+dfsg1-1. (diff) | |
download | rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.tar.xz rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/doc/book')
-rw-r--r-- | src/doc/book/redirects/using-rust-without-the-standard-library.md | 6 | ||||
-rw-r--r-- | src/doc/book/src/ch08-02-strings.md | 2 | ||||
-rw-r--r-- | src/doc/book/src/ch10-03-lifetime-syntax.md | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/doc/book/redirects/using-rust-without-the-standard-library.md b/src/doc/book/redirects/using-rust-without-the-standard-library.md index 75145429d..0fbdfebdd 100644 --- a/src/doc/book/redirects/using-rust-without-the-standard-library.md +++ b/src/doc/book/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]** * <small>[In the first edition: Ch 4.12 — Using Rust without the Standard Library][1]</small> [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 diff --git a/src/doc/book/src/ch08-02-strings.md b/src/doc/book/src/ch08-02-strings.md index 9663d36ab..f38803ee3 100644 --- a/src/doc/book/src/ch08-02-strings.md +++ b/src/doc/book/src/ch08-02-strings.md @@ -244,7 +244,7 @@ encoded UTF-8 example strings from Listing 8-14. First, this one: In this case, `len` will be 4, which means the vector storing the string “Hola” is 4 bytes long. Each of these letters takes 1 byte when encoded in UTF-8. The following line, however, may surprise you. (Note that this string begins with -the capital Cyrillic letter Ze, not the Arabic number 3.) +the capital Cyrillic letter Ze, not the number 3.) ```rust {{#rustdoc_include ../listings/ch08-common-collections/listing-08-14/src/main.rs:russian}} diff --git a/src/doc/book/src/ch10-03-lifetime-syntax.md b/src/doc/book/src/ch10-03-lifetime-syntax.md index 5229ab74b..498f01f0b 100644 --- a/src/doc/book/src/ch10-03-lifetime-syntax.md +++ b/src/doc/book/src/ch10-03-lifetime-syntax.md @@ -8,13 +8,13 @@ One detail we didn’t discuss in the [“References and Borrowing”][references-and-borrowing]<!-- ignore --> 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. @@ -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 |