Commit Graph

5735 Commits

Author SHA1 Message Date
Chris Krycho
e16dd73690 Merge pull request #4097 from rust-lang/new-baseline
Correct baseline after running update-rustc.sh again
async-2024
2024-11-06 13:51:50 -07:00
Chris Krycho
da611679cd Correct baseline after running update-rustc.sh again 2024-11-06 13:45:39 -07:00
Chris Krycho
777a5ba14c Merge pull request #4062 from rust-lang/unsafe-fixes
Ch. 20: Address soundness issues and introduce Miri
2024-11-06 13:36:40 -07:00
Chris Krycho
af61f9529c Fix output paths for updates in Ch. 20 2024-11-06 12:57:59 -07:00
Chris Krycho
3e725cdf9c Add 'Miri' and 'miri' to the dictionary 2024-11-06 12:43:04 -07:00
Chris Krycho
e934f31610 Ch. 20: correct text about how we got raw pointers
We no longer get the raw pointers from references, although we *could*,
because we can now use the raw pointer operator rather than an `as` cast
and thus can get them directly from a variable in scope.
2024-11-06 12:36:43 -07:00
Chris Krycho
3fdb520364 Introduce basic usage of Miri in the unsafe chapter 2024-11-06 12:36:43 -07:00
Chris Krycho
48d0b7686b Ch. 20: Fix safety handling in the static mut example
- Add `SAFETY` documentation on the unsafe function and comments on the
  unsafe invocation in the code samples.
- Discuss the soundness issues in more depth and explain the idiomatic
  use of those `SAFETY` comments.
2024-11-06 12:36:43 -07:00
Chris Krycho
2b1ddf4911 Use new &raw feature for sound raw pointer usage.
Note: this requires Rust 1.82.0, and will be easiest to merge after that
version is stabilized in two weeks. Since it is blocked on that anyway,
I am also basing it on top of the listing changes.
2024-11-06 12:36:43 -07:00
Chris Krycho
978e994f19 Merge pull request #4096 from rust-lang/rust-1.82-manual-regen
Rust 1.82: also update all cases of manual regeneration
2024-11-06 12:36:24 -07:00
Chris Krycho
7ee012f18b infra: *some* file paths can also contain file:///home
Rust recently began printing error messages which include the full path
to the source of the file with an error in it; when that path is in the
standard library, that includes the user's home directory (or similar).
A previous change (b9241f6) added support for those paths in the output
files; this one adds support to the local file paths linter.

Specifically allow exactly and only paths in the home directory which
include `.rustup` or `.cargo`.
2024-11-06 12:18:08 -07:00
Chris Krycho
91381a1e11 Add new terms to dictionary 2024-11-06 11:57:23 -07:00
Chris Krycho
f04d20fe8d Rust 1.82: also update all cases of manual regeneration 2024-11-06 11:49:14 -07:00
Chris Krycho
f4b22544bc Merge pull request #4089 from rust-lang/rust-1.82
Update to Rust 1.82
2024-11-05 16:46:21 -07:00
Chris Krycho
96501370c2 Update to Rust 1.82 2024-11-05 15:53:09 -07:00
Chris Krycho
c913659d62 infra: correctly report skipped paths in listings 2024-11-05 15:53:09 -07:00
Chris Krycho
effecb884e infra: rewrite rustup toolchain paths in update-rustc.sh
As with project paths, we do not want these to have the paths from the
user who runs `update-rustc.sh`, but some totally generic path.
2024-11-05 15:53:09 -07:00
Chris Krycho
e28cd5b13f Set the correct baseline for current Rust version
Unfortunately missed some of this when updating to Rust 1.81
2024-11-04 13:15:19 -07:00
Chris Krycho
a92d8e6c2d Update Cargo.lock for all Ch. 17 listings 2024-11-04 12:48:51 -07:00
Chris Krycho
b9241f6b14 infra: support listing deps in update-rustc.sh 2024-11-04 12:48:08 -07:00
Chris Krycho
c57c34b86b Merge pull request #4093 from jpmelos/jpmelos-ch17-05-fix-typos
ch17-05: Fix typos
2024-11-04 09:38:32 -07:00
Chris Krycho
a5379a3d79 Merge pull request #4092 from jpmelos/jpmelos-ch17-01-fix-typo
ch17-01: Fix typos
2024-11-04 09:32:16 -07:00
Chris Krycho
be7d802e5b Revert comma deletion 2024-11-04 09:21:34 -07:00
João Sampaio
4072934a60 Add links to be after the last paragraph 2024-11-03 12:20:45 +00:00
João Sampaio
850ddec6ae Add what seems to be a missing link 2024-11-03 12:20:45 +00:00
João Sampaio
3acd2768be Fix a typo 2024-11-03 12:20:45 +00:00
João Sampaio
f612444e70 ch17-01: Fix typos 2024-11-03 10:32:43 +00:00
Chris Krycho
44b246efd4 Merge pull request #4088 from rust-lang/final-project-tweaks
Ch. 21: Update to mention async/await as appropriate
2024-10-31 16:42:07 -06:00
Chris Krycho
5f04987e24 Ch. 21: Update to mention async/await as appropriate
This does not significantly change the flow or text of the chapter; it
merely acknowledges that we *did* do async and await and refers to the
concepts or suggests the reader think about how things would differ if
using futures and async.
2024-10-31 13:25:51 -06:00
Chris Krycho
4b65ace894 Merge pull request #4087 from rust-lang/fix-bad-link
Ch. 17 fixes: correct a bad link in the 2018 edition pages
2024-10-30 16:51:45 -06:00
Chris Krycho
7c75ed3cc4 Ch. 17 fixes: correct a bad link in the 2018 edition pages
Looks like I basically accidentally did the find-and-replace operation
twice on this one. Whoops!
2024-10-30 16:36:51 -06:00
Chris Krycho
0b8b81e857 Merge pull request #4086 from rust-lang/dependabot/cargo/packages/trpl/quinn-proto-0.11.8
Bump quinn-proto from 0.11.6 to 0.11.8 in /packages/trpl
2024-10-30 11:03:42 -06:00
dependabot[bot]
5b80fa3d18 Bump quinn-proto from 0.11.6 to 0.11.8 in /packages/trpl
Bumps [quinn-proto](https://github.com/quinn-rs/quinn) from 0.11.6 to 0.11.8.
- [Release notes](https://github.com/quinn-rs/quinn/releases)
- [Commits](https://github.com/quinn-rs/quinn/compare/quinn-proto-0.11.6...quinn-proto-0.11.8)

---
updated-dependencies:
- dependency-name: quinn-proto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-29 20:50:32 +00:00
Chris Krycho
f04c685123 Merge pull request #4085 from rust-lang/rustls-for-trpl-reqwest
infra: switch to `rustls` in `reqwest` dep for `trpl`
2024-10-29 14:49:40 -06:00
Chris Krycho
55a2693f20 infra: switch to rustls in reqwest dep for trpl
Set `reqwest.default-features = false`, since it includes `native-tls`
by default, and explicitly opt into `rustls-tls` instead. This also
implicitly drops http2 support, but we do not use that in the examples,
so that is actually just a small win.

Contributes to rust-lang/rust#131859, which is failing because using
`native-tis` requires the environment to have an OpenSSL installation,
and the `rust-lang/rust` CI environment does not.
2024-10-28 16:25:07 -06:00
Chris Krycho
aa5427d1d9 Merge pull request #4079 from jasonodonnell/main
Add missing semicolon in listing 19-15 and 19-16
2024-10-25 19:49:20 -06:00
Chris Krycho
7f1f98e4d7 Merge pull request #4083 from rust-lang/fix-workspace-config
infra: change how packages are opted out of workspaces
2024-10-25 17:14:55 -06:00
Chris Krycho
be84fe8322 infra: change how packages are opted out of workspaces
The `trpl`, `mdbook-trpl-note`, and `mdbook-trpl-listing` crates should
*never* be part of a host workspace: neither in `rust-lang/book` nor in
`rust-lang/rust`. They are always built as independent packages, so they
do not end up depending implicitly on the host’s workspace dependencies.

Accordingly, opt out by setting an empty `[workspace]` key in each of
the packages' `Cargo.toml` files so that they do not have to be
configured in both places they might be used.
2024-10-25 15:26:31 -06:00
Jason O'Donnell
b1f6e062b4 add semicolon to 19-16 2024-10-24 09:26:15 -04:00
Jason O'Donnell
1c6c44568e add missing semicolon in listing 19-15 2024-10-24 09:17:05 -04:00
Chris Krycho
9b812c6278 Merge pull request #4075 from rust-lang/ch19-for-ch17
Ch. 19: discuss `while let` referencing ch. 17
2024-10-17 07:53:36 -06:00
Chris Krycho
62d441060d Ch. 19: discuss while let referencing ch. 17
This is no longer the first time people see `while let` in the book, so
(a) update the text to mention Chapter 17, and (b) change the example to
show a `Result`-based scenario in addition to the an `Option`-based that
readers saw back in Chapter 17, to make it clear that `while let` is not
limited to working with `Option`.
2024-10-17 07:41:42 -06:00
Chris Krycho
1cbfc5c7c5 Merge pull request #4073 from rust-lang/ch17-pin-corrections
Ch. 17: Correct several points about `Pin` and `Unpin`
2024-10-15 11:50:45 -06:00
Chris Krycho
1a9f1ebb01 Ch. 17: Correct several points about Pin and Unpin
Thanks very much to @tmandry (<tmandry@gmail.com>) for the corrections
and feedback!
2024-10-15 11:43:43 -06:00
Chris Krycho
d9202d8a91 Merge pull request #4072 from rust-lang/ch15-listing-work
Use `<Listing>` for Chapter 15
2024-10-15 11:26:11 -06:00
Chris Krycho
d8a10b865f Use <Listing> for Chapter 15
This restores the work originally done in #3956, which had to be dropped
from that PR because this chapter was blocked on XML handling, which was
resolved in #3975.

Co-authored-by: Bryan Zierk <bryan.zierk@gmail.com>
2024-10-15 09:31:45 -06:00
Chris Krycho
206bb69c31 Merge pull request #3980 from SpectralPixel/listing-preprocessor-chapter-09
Convert Listings in Chapter 09 to `<Listing>`
2024-10-15 09:12:17 -06:00
Chris Krycho
ec6b1b402c Merge pull request #4070 from rust-lang/ch17-reader-feedback
Ch. 17: integrate early reader feedback
2024-10-15 09:09:23 -06:00
Chris Krycho
5749ade35e Merge pull request #4071 from rust-lang/listing-attr-handling
infra: improve error handling for `Listing`
2024-10-15 09:08:32 -06:00
Chris Krycho
3b96a4b7c6 Ch. 18: fix bad attribute on a <Listing> 2024-10-15 09:04:36 -06:00