1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-10-09 19:12:06 +02:00
Commit Graph

2511 Commits

Author SHA1 Message Date
dependabot[bot]
97c73ab7fc cargo: bump the patch group in /src/bare-metal/aps/examples with 3 updates (#2935)
Bumps the patch group in /src/bare-metal/aps/examples with 3 updates:
[bitflags](https://github.com/bitflags/bitflags),
[log](https://github.com/rust-lang/log) and
[zerocopy](https://github.com/google/zerocopy).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 10:23:08 +00:00
dependabot[bot]
787f0f7646 cargo: bump the patch group in /src/exercises/bare-metal/rtc with 4 updates (#2934)
Bumps the patch group in /src/exercises/bare-metal/rtc with 4 updates:
[bitflags](https://github.com/bitflags/bitflags),
[chrono](https://github.com/chronotope/chrono),
[log](https://github.com/rust-lang/log) and
[zerocopy](https://github.com/google/zerocopy).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 10:19:04 +00:00
dependabot[bot]
9fcca2f346 build(deps): bump actions/setup-node from 4 to 5 (#2937)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4
to 5.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 10:18:36 +00:00
dependabot[bot]
6375ab05b6 build(deps): bump actions/labeler from 5 to 6 (#2938)
Bumps [actions/labeler](https://github.com/actions/labeler) from 5 to 6.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 10:17:44 +00:00
dependabot[bot]
c59d441845 cargo: bump arm-gic from 0.6.1 to 0.7.1 in /src/exercises/bare-metal/rtc in the minor group (#2933)
Bumps the minor group in /src/exercises/bare-metal/rtc with 1 update:
arm-gic.

Updates `arm-gic` from 0.6.1 to 0.7.1

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Walbran <qwandor@google.com>
2025-10-06 10:13:22 +00:00
dependabot[bot]
6758b454fe build(deps): bump crate-ci/typos from 1.35.7 to 1.37.0 (#2939)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.35.7 to
1.37.0.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Walbran <qwandor@google.com>
2025-10-06 10:12:00 +00:00
dependabot[bot]
7b022bb4e9 cargo: bump the patch group with 10 updates (#2940)
Bumps the patch group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.99` | `1.0.100` |
| [clap](https://github.com/clap-rs/clap) | `4.5.47` | `4.5.48` |
| [regex](https://github.com/rust-lang/regex) | `1.11.2` | `1.11.3` |
| [serde](https://github.com/serde-rs/serde) | `1.0.219` | `1.0.228` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.143` | `1.0.145`
|
| [zerocopy](https://github.com/google/zerocopy) | `0.8.26` | `0.8.27` |
| [tokio-websockets](https://github.com/Gelbpunkt/tokio-websockets) |
`0.12.1` | `0.12.3` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.16` |
`2.0.17` |
| [cxx](https://github.com/dtolnay/cxx) | `1.0.175` | `1.0.180` |
| [cxx-build](https://github.com/dtolnay/cxx) | `1.0.175` | `1.0.186` |

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 09:51:38 +00:00
michael-kerscher
483a9ec9f0 web tests: run style guide compliance check only for modified markdown files (#2942)
In the CI environment, only changes in the current PR are taken into
account.
This speeds up the test process and reduces failure potential if no
Markdown files have been changed.

Mitigates #2941 but does not fix the root cause
2025-10-06 11:34:00 +02:00
Martin Geisler
17a04070ed Don’t automatically install recommended packages (#2923)
Co-authored-by: Michael Kerscher <kerscher@google.com>
2025-10-01 20:33:48 +00:00
Dmitri Gribenko
0a734e9f02 docs(style): Document mdbook-xgettext skip comment (#2929) 2025-09-27 11:13:16 +02:00
Dmitri Gribenko
00e3e194ae feat(docs): Update and apply kbd tag style guide (#2930)
- Based on feed back from @mgeisler, update the kbd tag guidance in
GEMINI.md to require wrapping each key in its own tag (e.g.,
`<kbd>Ctrl</kbd> + <kbd>S</kbd>`).
- Apply this new convention to existing content in the `src` directory
to ensure consistency.
2025-09-27 11:13:03 +02:00
dependabot[bot]
096a0a6ff3 build(deps-dev): bump tar-fs from 3.0.9 to 3.1.1 in /tests in the npm_and_yarn group across 1 directory (#2931)
Bumps the npm_and_yarn group with 1 update in the /tests directory:
[tar-fs](https://github.com/mafintosh/tar-fs).

Updates `tar-fs` from 3.0.9 to 3.1.1
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0aa57de79e"><code>0aa57de</code></a>
3.1.1</li>
<li><a
href="0bd54cdf06"><code>0bd54cd</code></a>
expand check</li>
<li><a
href="cb1c571fba"><code>cb1c571</code></a>
3.1.0</li>
<li><a
href="374460e997"><code>374460e</code></a>
add optional disablement of symlink validation (<a
href="https://redirect.github.com/mafintosh/tar-fs/issues/119">#119</a>)</li>
<li><a
href="5bfe6dfb9d"><code>5bfe6df</code></a>
3.0.10</li>
<li><a
href="63e12f9474"><code>63e12f9</code></a>
bare support</li>
<li>See full diff in <a
href="https://github.com/mafintosh/tar-fs/compare/v3.0.9...v3.1.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tar-fs&package-manager=npm_and_yarn&previous-version=3.0.9&new-version=3.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/google/comprehensive-rust/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-27 10:57:27 +02:00
Dmitri Gribenko
4671b3455b docs(style): Reorganize code block and formatting sections (#2928)
- Consolidates all guidance related to code block mechanics under a new
top-level heading, "Code Blocks Mechanics".
- Moves the "Rust Code Formatting" guidance to be a subsection under
this new heading.
- The rest of the former "Rust Code" section is now directly under
"Course Slides".

This restructuring improves the logical flow of the style guide by
grouping all code-related formatting and tooling conventions into a
single, easy-to-find section.
2025-09-24 10:25:01 +02:00
Dmitri Gribenko
a6e18b6866 docs(style): Add Live, Interactive Instruction principle (#2927)
Adds a new pedagogical principle to STYLE.md to formalize the course's
core philosophy of live, interactive instruction.

This principle clarifies the expectation that instructors will interact
with code snippets live, use compiler errors as a teaching tool, and
engage with audience questions dynamically.
2025-09-24 10:08:40 +02:00
Dmitri Gribenko
3cbcd7e0b5 docs(style): Add mdbook and mdbook-course conventions (#2926)
Adds a new section to STYLE.md to document mandatory conventions for
using `mdbook` and the custom `mdbook-course` preprocessor.

This section mandates the use of YAML frontmatter, outline helpers, and
file includes for exercises, and links to the `mdbook-course` README for
more detailed technical explanations.
2025-09-24 10:08:28 +02:00
Dmitri Gribenko
31a8af33a1 docs(gemini): Add kbd tag formatting rule (#2925)
Adds a specific style convention to GEMINI.md for formatting keyboard
key combinations using the `<kbd>` tag.

The required format is `<kbd>Ctrl + S</kbd>`, which is consistent with
existing usage in the course. This rule will be enforced by the AI
assistant to ensure uniformity.
2025-09-24 10:08:19 +02:00
Dmitri Gribenko
a77ea82cde feat(docs): Centralize code block style guide (#2922)
- Moves the canonical documentation for code block annotations and
language identifiers into STYLE.md.
- Removes the redundant, partial documentation from GEMINI.md.
- Updates GEMINI.md to instruct the AI assistant to always refer to
STYLE.md for guidance.

This change makes STYLE.md the single source of truth for all markdown
and code style conventions, ensuring consistency for both human and AI
contributors.
2025-09-23 20:17:00 +02:00
Nicole L
b183ee2f56 Simplify type cast and remove error handling in protobuf exercise (#2755)
Co-authored-by: Dustin J. Mitchell <dustin@v.igoro.us>
2025-09-22 09:58:18 -07:00
Dmitri Gribenko
36c07e30b6 docs: Clarify speaker note style for instructors (#2917)
The previous STYLE.md advised against using speaker notes as a 'script'
but didn't provide clear examples of what that meant. This could be
interpreted by LLMs as disallowing any kind of instructor prompt.

This change clarifies the guideline by:

1. Distinguishing between long-form, verbatim 'scripts' (bad) and short,
actionable 'teaching prompts' (good).

2. Providing concrete 'good' and 'bad' examples to make the distinction
unambiguous for future contributors.
2025-09-22 11:44:49 +02:00
Dmitri Gribenko
4d755f67cc docs(style): Add guideline for code block annotations (#2920) 2025-09-22 11:25:16 +02:00
Dmitri Gribenko
4ffd664f47 docs(gemini): Explain mdbook's isolated snippet compilation (#2918)
Add a new "Technical Context: mdbook" section to GEMINI.md.

This section clarifies two key behaviors of mdbook that are essential
for accurate code analysis and review:

- Rust code snippets are compiled in isolation.

- Annotations like 'compile_fail' describe the expected test outcome.

This information is added to prevent incorrect assumptions about shared
scope between code blocks, ensuring more accurate analysis in the
future.
2025-09-22 10:34:48 +02:00
Dmitri Gribenko
9e9786bafd docs(style): Overhaul STYLE.md with course philosophy and principles (#2919)
Make STYLE.md a comprehensive guide for contributors by incorporating
the core,
public-facing principles from the internal design document. This ensures
that a
ll contributions align with the course's pedagogical goals and
structure.

The key additions and changes include:

- **Add "Course Philosophy and Design" Section:**
  - Define the target audience (experienced SWEs new to Rust).
  - State the course goals (solid foundation in a bounded time).
  - Codify the core pedagogical principles:
    - Build on a Foundation
    - Provide a Working Mental Model (The "No Magic" Rule)
    - Use a Spiral Approach

- **Define Course Structure and Pacing:**
- Add a "Pacing and Structure" section explaining the 5-hour daily
schedule and the `minutes` frontmatter convention.
- Add a "Course Structure" section detailing the distinction between the
time-bounded "Fundamentals" course and optional "deep dives".
- Clarify the high bar for adding new content to the Fundamentals
course.

- **Add Guidelines for Course Content:**
- Add an "Exercises" section with principles for creating focused,
time-bounded exercises.
- Add an "Interactive Code Snippets" section explaining the importance
of live, editable code blocks.
- Add a "Pedagogical Flow" section advising a concrete-to-abstract
progression.

- **Refine Existing Sections:**
- Update "Speaker Notes" to clarify their role in guiding the
instructor's live-coding sessions.
- Remove redundant text from "Language and Tone" that is now covered in
the new philosophy section.
2025-09-22 10:34:22 +02:00
Martin Geisler
11f2831933 Optimize apt update calls (#2916)
This introduces a new local GitHub action for installing Debian
packages. I noticed that it often takes several minutes to install a few
small packages, and a large part of that time is spent updating the man
page database:

    2025-09-20T11:39:25.3001853Z Setting up yapf3 (0.33.0-1) ...
2025-09-20T11:39:25.3045329Z Processing triggers for libc-bin
(2.39-0ubuntu8.5) ...
2025-09-20T11:39:25.4420933Z Processing triggers for man-db
(2.12.0-4build2) ...
2025-09-20T11:41:42.8522570Z Processing triggers for install-info
(7.1-3build2) ...

Excluding the documentation files should make the man-db run much
faster. Compare these two runs:

*
[Before](https://github.com/google/comprehensive-rust/actions/runs/17879390708/job/50845084995):
2m 41s.
*
[After](https://github.com/google/comprehensive-rust/actions/runs/17880418155/job/50847334471):
11s.
2025-09-22 09:33:42 +02:00
Martin Geisler
1e3be175fa Introduce a cargo clippy run (#2025)
This might help catch stylistic problems in our Rust code.

Related to #2587.
2025-09-20 11:38:54 +00:00
Martin Geisler
80a2f2ff71 Add more prominent references to cargo xtask (#2904)
I found that Gemini didn’t know how to install the necessary tools
make `dprint fmt` work, so I’m adding more references to `cargo xtask`
in our documentation.
2025-09-20 11:15:28 +00:00
michael-kerscher
f4a11a4fc5 Speed up rust crate installs in workflow by using cargo-binstall (#2915)
When cargo xtask install-tools --binstall is used, precompiled binaries
are fetched if available.
Triggers a regular (compilation) install if binary releases do not
exist.

This is now configured to be used by the CI to speed up the build and
deploy workflows where possible.

Currently binary packages exist for:
- mdbook
- mdbook-pandoc
2025-09-19 13:28:03 +02:00
Nicole L
8b4849854a Add a speaker note about mut function args (#2910) 2025-09-18 17:25:47 -07:00
Nicole L
9e32680064 Improve speaker notes and exercise in tuples and arrays section (#2909) 2025-09-18 17:23:32 -07:00
Nicole L
3eae5be59e Remove macro hygiene from hello world slide (#2908) 2025-09-18 17:22:15 -07:00
Martin Geisler
b222e4fa34 Add links to glossary entries (#2906)
This is again done with Gemini, though I double checked most of the
entries.
2025-09-18 22:02:06 +00:00
michael-kerscher
33bc3f4088 refactor cargo xtasks (#2907)
* improve error handling
* show executed command lines
* reduce code duplication (run_command, run_mdbook_command)
2025-09-18 23:48:15 +02:00
Martin Geisler
d6be949511 Give Gemini details on our Markdown conventions (#2905)
This should help it produce more consistent slides. For example, it will
now know not to add sub-headings to slides.

The initial version of this was generated by Gemini itself, and I then
tweaked it by adding some more constraints.
2025-09-18 23:26:12 +02:00
Martin Geisler
19116d263f Add speaker notes to Fibonacci exercise (#2898)
The speaker notes should prompt a deeper discussion around the
exercise by calling out the non-obvious integer overflow pitfall and
encourage instructors to explore alternative implementations with
students, moving beyond a surface-level recursive solution.
2025-09-18 23:09:32 +02:00
Martin Geisler
6ab9858cbe Add speaker notes to instructor-focused slides (#2899)
Following the style guide, these notes provide additional context for
instructors and self-learners. The notes focus on practical tips for
running the course and highlighting key information for students.
2025-09-18 23:08:56 +02:00
Martin Geisler
766d8df9be Add The Little Book of Rust Macros (#2911)
I found this recently when reading about hygiene in Rust macros and
really liked it.
2025-09-18 12:04:35 -07:00
Martin Geisler
f7cbb63305 Remove unnecessary and duplicate paragraph (#2913)
This doesn't belong in a slide, and we already say the same thing at the
top of the slide.
2025-09-18 12:04:07 -07:00
Martin Geisler
81ad6772d1 Fix the use of minutes frontmatter (#2903)
This file was inconsistent with the other files in our course.

I don’t actually know if both work, but if not, we should consider
erroring out to ensure consistency going forward.
2025-09-18 12:03:40 -07:00
Martin Geisler
2955c03231 Consistently use **Note:** instead of **Note**: (#2902)
I think the former is slightly nicer: I see `:` as belonging to the
poor-mans heading we create with the bold text.
2025-09-18 18:14:25 +02:00
Glen De Cauwsemaecker
63e50a8058 add typestate pattern chapter for idiomatic rust (#2821) 2025-09-17 09:09:37 +02:00
Martin Geisler
a9497bdc61 Update mdbook to version 0.4.52 (#2870)
The most significant change for users is that the search index is
downloaded on demand.

For us as a project, it’s good to see the server used by `mdbook serve`
change from `warp` to `asum`: the former hadn’t been updated in a while,
leading us to have old dependencies in our `Cargo.lock`.

I also ran `cargo update` to further unify the versions of our
dependencies. This shrunk `cargo tree --duplicates` a little more.

---------

Co-authored-by: Michael Kerscher <kerscher@google.com>
2025-09-15 14:25:15 +02:00
Martin Geisler
1a5d9949ad Fix blocks-and-scopes.md after code review (#2901)
Thanks to @fw-immunant and @qwandor for the comments in #2887.
2025-09-11 10:36:45 +01:00
Luciefer
4731acf53f ci: use pinned nightly rustfmt to make unstable features take effect (#2896)
## What does this PR do?

This PR extends the existing `format` job in
`.github/workflows/build.yml` to
**check Rust formatting with nightly `rustfmt`**:

**Closes #2794**
2025-09-10 13:36:47 +02:00
Martin Geisler
30710e4a78 Fix spelling of UTF-8 and UTF-16 (#2900)
This should always be written with a hyphen in running text.
2025-09-09 17:42:23 -04:00
Enes Aydın
508979a451 tr: day 2 afternoon translation with GEMINI :) (#2816)
I had Google Gemini do this Turkish translation again.

I gave Gemini my previous translations and the part I wanted it to
translate as two separate PO files. As a prompt, I told it to stick to
my terminology and methodology. Then, I went through the output that
Gemini produced one by one. I estimated that I corrected a small
percentage of the entire translation, around 5-10% (for this pr).

NOTE: I opened this branch in this PR via
"Enes1313:tr-translation-of-day-2-morning" . This PR can be reviewed
when the PR for #2809 is finished.

Part of #500
2025-09-09 21:35:18 +00:00
David E Worth
93c5f28b92 fix(docs): remove stray/trailing s> (#2897)
It looks like changes from the last commit (`085b534`) to the
`<details>...</details>` block had a stray `s>` included.
2025-09-07 19:35:08 +00:00
Martin Geisler
ad9440d20c Add a GEMINI.md file with instructions for the CLI (#2895)
I’ve been playing with the `gemini` CLI tool
recently (https://google-gemini.github.io/gemini-cli/) and learned that
it will read instructions from it’s own kind of README.

So I asked it to generate one and use it as a basis for this file. I
took the liberty to expand the style guide a little at the same time to
incorporate that instructions I gave Gemini while generating the [many
language fixing PRs][1].

[1]:
https://github.com/google/comprehensive-rust/pulls?q=author%3Amgeisler+%22improve+language%22

---------

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2025-09-06 18:57:53 +00:00
Martin Geisler
085b534735 docs: improve language in tuples-and-arrays section (#2875)
I asked Gemini to review the English for inconsistencies and grammar
mistakes. This is the result and I hope it's useful!

As a non-native speaker, it is hard for me to evaluate the finer
details, so let me know if you would like to see changes (or even
better: make them directly in the PR with the suggestion function).

---------

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2025-09-06 18:53:55 +00:00
Martin Geisler
a37ef402a9 docs: improve language in chromium section (#2889)
I asked Gemini to review the English for inconsistencies and grammar
mistakes. This is the result and I hope it's useful!

As a non-native speaker, it is hard for me to evaluate the finer
details, so let me know if you would like to see changes (or even
better: make them directly in the PR with the suggestion function).

---------

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2025-09-06 18:53:23 +00:00
Martin Geisler
d7dc934891 docs: improve language in bare-metal section (#2891)
I asked Gemini to review the English for inconsistencies and grammar
mistakes. This is the result and I hope it's useful!

As a non-native speaker, it is hard for me to evaluate the finer
details, so let me know if you would like to see changes (or even
better: make them directly in the PR with the suggestion function).

---------

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2025-09-06 20:43:01 +02:00
Martin Geisler
16c960d690 docs: improve language in borrowing section (#2893)
I asked Gemini to review the English for inconsistencies and grammar
mistakes. This is the result and I hope it's useful!

As a non-native speaker, it is hard for me to evaluate the finer
details, so let me know if you would like to see changes (or even
better: make them directly in the PR with the suggestion function).

---------

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2025-09-06 20:41:17 +02:00