Commit Graph

2702 Commits

Author SHA1 Message Date
Chris Krycho
38b2b8537f infra: dprint, part 2
- Reformat everything now that the bug in dprint for wrapping lines with
  inline code is fixed.
- Additionally, apply the formatting rules I *should have* applied the
  first time, so the repo has the same style it has historically used.
2024-12-05 14:05:53 -07:00
Dane Harrigan
bf43b7a516 Revise sentence to not refer to two subjects as it 2024-12-05 10:44:47 -05:00
Chris Krycho
63a31763d9 Merge pull request #4132 from rust-lang/ignore-internal-links
Ch. 17: ignore internal links
2024-12-04 17:04:28 -07:00
Chris Krycho
303918057a Ch. 17: ignore internal links 2024-12-04 16:58:33 -07:00
Chris Krycho
b6ef8eb6b5 Update src/ch21-01-single-threaded.md 2024-12-04 12:09:09 -07:00
Dahuage
d10bac898c fix: fix a garden-path expression that can be confusing.
Fix a garden-path expression that can be confusing for those who are familiar with referring to packages using dots, especially when English is a second language for the reader.
2024-12-04 10:44:16 +08:00
Chris Krycho
1611a39557 Ch. 18: use “dyn compatibility” instead of “object safety”
- Introduce the concept at the end of 18.2 when discussing the tradeoffs
  of dynamic dispatch, with a link to the reference. The link is not
  currently valid, because of the versioning timeline, but it will be
  when this stabilizes!
- In 18.3, simply replace “object safe” with “dyn compatible”. There is
  still probably not enough discussion of it, but with the introduction
  and link in 18.2, it is *probably* enough for now?
2024-12-03 15:49:22 -07:00
Chris Krycho
d83137d9ac Merge pull request #4125 from rust-lang/dprint
infra: introduce dprint for easier formatting
2024-12-03 10:00:54 -07:00
Chris Krycho
3a30e4c1fb Apply dprint fmt to active files in the repo 2024-12-02 16:09:20 -07:00
Chris Krycho
b1be1fe87d Ch. 18: unwrap a link split across two lines
This appears to still work with pulldown-cmark, but not necessarily in
all renderers, and (more to the point at present) is not compatible with
dprint, which does not like the line wrapping that way!
2024-12-02 15:25:30 -07:00
Daniel Mouritzen
0dfa24c1fe Correct chapter numbers in introduction 2024-12-02 23:10:11 +01:00
Chris Krycho
5d395b70da Merge pull request #3745 from SergioRibera/main
Adding reference to an actively maintained Spanish translation
2024-12-02 10:20:04 -07:00
Chris Krycho
f347bb5e0e Ch. 2: tweak a phrase to avoid derailing some readers
Multiple people have filed or commented on issues over the past few
years (at least #3782, #4101, #4090, and #3921; and possibly others I
have not found) because seeing “compare” here led them to jump ahead to
the conversion (in the next paragraph). The text was technically correct
as it stood, but since it kept derailing/hijacking people’s train of
thought, tweaking it seems helpful.
2024-12-02 10:16:07 -07:00
Chris Krycho
b2e71e8818 Fix more inverted uses of “shadowed”
Follow-on for #3773 and #4121: I missed how the rest of this paragraph
also had “shadowed” inverted!
2024-12-02 09:16:41 -07:00
Chris Krycho
e945e17d91 Fix a couple inverted uses of “shadowed”
Fixes #3773.
2024-12-02 08:51:19 -07:00
Chris Krycho
61d741742c Merge branch 'main' into main 2024-12-02 07:35:06 -07:00
Chris Krycho
daf8d828cc Fix confusion between variable hello and string "hello"
Fixes #3803
2024-11-27 14:19:33 -07:00
Chris Krycho
294b80dda8 Ch. 17: fix some wording issues 2024-11-27 10:53:03 -07:00
Chris Krycho
871ace83d1 Link to the rustc book for docs about cargo test -- <this stuff> 2024-11-27 07:57:25 -07:00
Peteris Ledins
3afd582a96 Refer to --exact for running exact one test 2024-11-27 07:57:25 -07:00
Chris Krycho
d119e947df Drop a pedantry-triggering sentence about IEEE-754
The pedantry is accurate, but since we can just drop this entirely, it
will cut the potential distraction for readers who might get hung up on
it otherwise!

Fixes #3818
2024-11-26 17:02:42 -07:00
Chris Krycho
fb3b8fc820 Merge pull request #4113 from rust-lang/push-lplqmmmnzrnr
Very small clarification on if let
2024-11-26 16:02:09 -07:00
Chris Krycho
398eb06581 Very small clarification on if let
Fixes #3999
2024-11-26 15:55:15 -07:00
Chris Krycho
dffa6a9c8e Merge pull request #4099 from jpmelos/jpmelos-ch17-05-typos
Ch17-05: Typos
2024-11-26 14:47:29 -07:00
Chris Krycho
6cee3d6da0 Merge pull request #4105 from jpmelos/jpmelos-ch20-01-fix-typos
Ch20-01: Fix typos
2024-11-26 14:33:37 -07:00
Chris Krycho
c4afacc2f9 Add a short paragraph on editors and IDEs in installation
Fixes #4107
2024-11-26 14:25:41 -07:00
Chris Krycho
93d741a77b Rust 2024: update Ch. 20 for new unsafe rules
- `extern` now requires `unsafe extern`, but in turn allows functions
  within it to be marked as `safe`. Add examples to both effects within
  the text, and update listing numbers accordingly.
- `#[no_mangle]` now requires `#[unsafe(no_mangle)]`

These are all backwards-compatible, so we can opt the chapter into using
the new rules without issue.
2024-11-22 14:52:18 -07:00
João Sampaio
c7e7f8fa13 Ch20-01: Fix typos 2024-11-18 14:42:22 +00:00
João Sampaio
a9c38c2d37 Drop the comma change 2024-11-12 18:31:27 +00:00
João Sampaio
77b52a82c5 Ch17-05: Typos 2024-11-10 11:37:28 +00: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
f04d20fe8d Rust 1.82: also update all cases of manual regeneration 2024-11-06 11:49:14 -07:00
Chris Krycho
96501370c2 Update to Rust 1.82 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
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
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
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
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
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