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.
- 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.
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.
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`.
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.
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.
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.
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`.
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>