1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-20 06:21:09 +02:00

1168 Commits

Author SHA1 Message Date
Jason Lin
a64516a7e6
Fix issues in std-types/result.md (#2186)
The expression excercise is using the standard `Result` type instead of
`Res`.

Co-authored-by: Jason Lin <lxj@google.com>
2024-07-05 15:04:46 +00:00
Younies Mahmoud
25b9dff9d0
Enhance Speaker Note: Warning for Rust Installation via Homebrew (#2191) 2024-07-05 10:50:13 -04:00
Henri F
a20b8754a5
Publish Ukrainian translation to language selector (#2183)
Closes #836
2024-07-03 14:04:54 -07:00
Henri F
ff916ebfb6
Fix small typo (#2185) 2024-07-03 16:17:35 -04:00
Henri F
1a1480ea04
Publish Japanese translation to language selector (#2182)
#1463 #652
2024-07-01 10:31:25 -07:00
dependabot[bot]
5119271045
cargo: bump bitflags from 2.5.0 to 2.6.0 in /src/bare-metal/aps/examples in the minor group (#2177)
Bumps the minor group in /src/bare-metal/aps/examples with 1 update:
[bitflags](https://github.com/bitflags/bitflags).

Updates `bitflags` from 2.5.0 to 2.6.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 12:36:30 +01:00
dependabot[bot]
b419881bc0
cargo: bump bitflags from 2.5.0 to 2.6.0 in /src/exercises/bare-metal/rtc in the minor group (#2180)
Bumps the minor group in /src/exercises/bare-metal/rtc with 1 update:
[bitflags](https://github.com/bitflags/bitflags).

Updates `bitflags` from 2.5.0 to 2.6.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 11:56:06 +01:00
dependabot[bot]
f046d4860d
cargo: bump the patch group in /src/bare-metal/aps/examples with 2 updates (#2178)
Bumps the patch group in /src/bare-metal/aps/examples with 2 updates:
[log](https://github.com/rust-lang/log) and
[cc](https://github.com/rust-lang/cc-rs).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 11:55:15 +01:00
dependabot[bot]
df33476ee6
cargo: bump the patch group in /src/exercises/bare-metal/rtc with 2 updates (#2181)
Bumps the patch group in /src/exercises/bare-metal/rtc with 2 updates:
[log](https://github.com/rust-lang/log) and
[cc](https://github.com/rust-lang/cc-rs).

Updates `log` from 0.4.21 to 0.4.22
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/log/blob/master/CHANGELOG.md">log's
changelog</a>.</em></p>
<blockquote>
<h2>[0.4.22] - 2024-06-27</h2>
<h2>What's Changed</h2>
<ul>
<li>Add some clarifications to the library docs by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/rust-lang/log/pull/620">rust-lang/log#620</a></li>
<li>Add links to <code>colog</code> crate by <a
href="https://github.com/chrivers"><code>@​chrivers</code></a> in <a
href="https://redirect.github.com/rust-lang/log/pull/621">rust-lang/log#621</a></li>
<li>adding line_number test + updating some testing infrastructure by <a
href="https://github.com/DIvkov575"><code>@​DIvkov575</code></a> in <a
href="https://redirect.github.com/rust-lang/log/pull/619">rust-lang/log#619</a></li>
<li>Clarify the actual set of functions that can race in _racy variants
by <a href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/rust-lang/log/pull/623">rust-lang/log#623</a></li>
<li>Replace deprecated std::sync::atomic::spin_loop_hint() by <a
href="https://github.com/Catamantaloedis"><code>@​Catamantaloedis</code></a>
in <a
href="https://redirect.github.com/rust-lang/log/pull/625">rust-lang/log#625</a></li>
<li>Check usage of max_level features by <a
href="https://github.com/Thomasdezeeuw"><code>@​Thomasdezeeuw</code></a>
in <a
href="https://redirect.github.com/rust-lang/log/pull/627">rust-lang/log#627</a></li>
<li>Remove unneeded import by <a
href="https://github.com/Thomasdezeeuw"><code>@​Thomasdezeeuw</code></a>
in <a
href="https://redirect.github.com/rust-lang/log/pull/628">rust-lang/log#628</a></li>
<li>Loosen orderings for logger initialization in <a
href="https://redirect.github.com/rust-lang/log/pull/632">rust-lang/log#632</a>.
Originally by <a
href="https://github.com/pwoolcoc"><code>@​pwoolcoc</code></a> in <a
href="https://redirect.github.com/rust-lang/log/pull/599">rust-lang/log#599</a></li>
<li>Use Location::caller() for file and line info in <a
href="https://redirect.github.com/rust-lang/log/pull/633">rust-lang/log#633</a>.
Originally by <a
href="https://github.com/Cassy343"><code>@​Cassy343</code></a> in <a
href="https://redirect.github.com/rust-lang/log/pull/520">rust-lang/log#520</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/chrivers"><code>@​chrivers</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/log/pull/621">rust-lang/log#621</a></li>
<li><a href="https://github.com/DIvkov575"><code>@​DIvkov575</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/log/pull/619">rust-lang/log#619</a></li>
<li><a
href="https://github.com/Catamantaloedis"><code>@​Catamantaloedis</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/log/pull/625">rust-lang/log#625</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-lang/log/compare/0.4.21...0.4.22">https://github.com/rust-lang/log/compare/0.4.21...0.4.22</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d5ba2cfee9"><code>d5ba2cf</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/log/issues/634">#634</a>
from rust-lang/cargo/0.4.22</li>
<li><a
href="d1a8306aad"><code>d1a8306</code></a>
prepare for 0.4.22 release</li>
<li><a
href="46894ef229"><code>46894ef</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/log/issues/633">#633</a>
from rust-lang/feat/panic-info</li>
<li><a
href="e0d389c9ca"><code>e0d389c</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/log/issues/632">#632</a>
from rust-lang/feat/loosen-atomics</li>
<li><a
href="c9e5e13e9b"><code>c9e5e13</code></a>
use Location::caller() for file and line info</li>
<li><a
href="507b672660"><code>507b672</code></a>
loosen orderings for logger initialization</li>
<li><a
href="c879b011a8"><code>c879b01</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/log/issues/628">#628</a>
from Thomasdezeeuw/fix-warnings</li>
<li><a
href="405fdb4d9f"><code>405fdb4</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/log/issues/627">#627</a>
from Thomasdezeeuw/check-features</li>
<li><a
href="1307ade112"><code>1307ade</code></a>
Remove unneeded import</li>
<li><a
href="710560ecb7"><code>710560e</code></a>
Don't use --all-features in CI</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/log/compare/0.4.21...0.4.22">compare
view</a></li>
</ul>
</details>
<br />

Updates `cc` from 1.0.100 to 1.0.103
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/releases">cc's
releases</a>.</em></p>
<blockquote>
<h2>cc-v1.0.103</h2>
<h3>Other</h3>
<ul>
<li>Fix compilation for wasm: env WASI_SYSROOT should be optional (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1114">#1114</a>)</li>
</ul>
<h2>cc-v1.0.102</h2>
<h3>Other</h3>
<ul>
<li>Fix invalid wasi targets compatibility (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1105">#1105</a>)</li>
<li>Speedup regenerate-target-info and regenerate-windows-sys (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1110">#1110</a>)</li>
</ul>
<h2>cc-v1.0.101</h2>
<h3>Other</h3>
<ul>
<li>Use <code>Build::getenv</code> instead of <code>env::var*</code> in
anywhere that makes sense (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1103">#1103</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md">cc's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.0.102...cc-v1.0.103">1.0.103</a>
- 2024-06-30</h2>
<h3>Other</h3>
<ul>
<li>Fix compilation for wasm: env WASI_SYSROOT should be optional (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1114">#1114</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.0.101...cc-v1.0.102">1.0.102</a>
- 2024-06-29</h2>
<h3>Other</h3>
<ul>
<li>Fix invalid wasi targets compatibility (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1105">#1105</a>)</li>
<li>Speedup regenerate-target-info and regenerate-windows-sys (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1110">#1110</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.0.100...cc-v1.0.101">1.0.101</a>
- 2024-06-25</h2>
<h3>Other</h3>
<ul>
<li>Use <code>Build::getenv</code> instead of <code>env::var*</code> in
anywhere that makes sense (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1103">#1103</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="75d47e5e68"><code>75d47e5</code></a>
chore: release (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1116">#1116</a>)</li>
<li><a
href="fe9ccd18fe"><code>fe9ccd1</code></a>
Fix compilation for wasm: env WASI_SYSROOT should be optional (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1114">#1114</a>)</li>
<li><a
href="bffb5c0096"><code>bffb5c0</code></a>
chore: release (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1112">#1112</a>)</li>
<li><a
href="9d4467794a"><code>9d44677</code></a>
Fix invalid wasi targets compatibility (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1105">#1105</a>)</li>
<li><a
href="853fa8b421"><code>853fa8b</code></a>
Speedup regenerate-target-info and regenerate-windows-sys (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1110">#1110</a>)</li>
<li><a
href="bcb7cbedd0"><code>bcb7cbe</code></a>
chore: release (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1106">#1106</a>)</li>
<li><a
href="4cb5b94e44"><code>4cb5b94</code></a>
Use <code>Build::getenv</code> instead of <code>env::var*</code> in
anywhere that makes sense (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1103">#1103</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.0.100...cc-v1.0.103">compare
view</a></li>
</ul>
</details>
<br />


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


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 11:53:20 +01:00
Andrew Walbran
b1a0287ec5
Fix name of trait for embedded-hal 1.0 and add missing import (#2174) 2024-06-26 09:55:11 -04:00
Jonathan Daniel
31d1182831
Update the link to the first dining philosophers exercise (#2153)
The current one leads to the same page.

https://google.github.io/comprehensive-rust/concurrency/async-exercises/dining-philosophers.html
2024-06-25 13:50:20 +00:00
Henri F
2641370f34
Update index.md with language selection instructions and translations link (#2131) 2024-06-25 09:45:04 -04:00
Andrew Walbran
f496303f2c
Add missing word (#2172) 2024-06-25 09:40:56 -04:00
dependabot[bot]
71d31410ed
cargo: bump cc from 1.0.99 to 1.0.100 in /src/bare-metal/aps/examples in the patch group (#2157)
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.99 to 1.0.100

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:21:24 +00:00
dependabot[bot]
16bafaf635
cargo: bump microbit-v2 from 0.14.0 to 0.15.0 in /src/bare-metal/microcontrollers/examples in the minor group (#2158)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [microbit-v2](https://github.com/nrf-rs/microbit).

Updates `microbit-v2` from 0.14.0 to 0.15.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:20:20 +00:00
dependabot[bot]
d490d08f9d
cargo: bump the minor group across 1 directory with 2 updates (#2169)
Bumps the minor group with 2 updates in the
/src/exercises/bare-metal/compass directory:
[lsm303agr](https://github.com/eldruin/lsm303agr-rs) and
[microbit-v2](https://github.com/nrf-rs/microbit).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 11:13:47 +01:00
dependabot[bot]
675493cb26
cargo: bump cc from 1.0.99 to 1.0.100 in /src/exercises/bare-metal/rtc in the patch group (#2156)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.99 to 1.0.100

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:07:16 +00:00
dependabot[bot]
45e4b167e9
cargo: bump the patch group across 1 directory with 2 updates (#2170)
Bumps the patch group with 2 updates in the / directory:
[serde_json](https://github.com/serde-rs/json) and
[reqwest](https://github.com/seanmonstar/reqwest).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:50:39 +01:00
Andrew Walbran
08bb2cf89a
Update installation instructions for cargo-embed (#2167) 2024-06-25 08:57:41 +00:00
Luke Yeh
1fb284640e
Add a map_err in speaker notes (#2155)
The type returned by `String::from_utf8(raw)`, is `Result<_>` and needs
to be mapped to match the type of the return type of `next`. You get
this error otherwise:

```
    Compiling playground v0.0.1 (/playground)
warning: unused import: `ErrorKind`
 --> src/main.rs:1:21
  |
1 | use std::io::{self, ErrorKind};
  |                     ^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0308]: mismatched types
   --> src/main.rs:29:17
    |
29  |         Ok(Some(s))
    |            ---- ^ expected `String`, found `Result<String, FromUtf8Error>`
    |            |
    |            arguments to this enum variant are incorrect
    |
    = note: expected struct `String`
                 found enum `Result<String, FromUtf8Error>`
help: the type constructed contains `Result<String, FromUtf8Error>` due to the type of the argument passed
   --> src/main.rs:29:12
    |
29  |         Ok(Some(s))
    |            ^^^^^-^
    |                 |
    |                 this argument influences the type of `Some`
note: tuple variant defined here
   --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:579:5
    |
579 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     ^^^^
help: use the `?` operator to extract the `Result<String, FromUtf8Error>` value, propagating a `Result::Err` value to the caller
    |
29  |         Ok(Some(s?))
    |                  +

For more information about this error, try `rustc --explain E0308`.
warning: `playground` (bin "playground") generated 1 warning
error: could not compile `playground` (bin "playground") due to 1 previous error; 1 warning emitted
```
2024-06-24 09:57:00 -04:00
snazzybytes
32b5a19684
Update broken "channels" link (#2146)
Stumbled upon another broken link. Courtesy fix 🫡
2024-06-17 09:19:00 -04:00
GeorgNeis
1723baee47
Update generic-traits.md (#2142)
Fix a typo.
2024-06-13 12:18:45 -04:00
Andrew Walbran
26e1d77b3e
Add note about !Sync (#2138)
This is key to the validity of how Cell and RefCell allow safe interior
mutability.
2024-06-10 15:35:13 +01:00
Martin Geisler
c45b291851
Clarify what "undefined behavior" means in arithmetic.md (#2139)
Undefined behavior does not just mean that the behavior can be different
on different platforms. It is much worse than that: the runtime behavior
can be completely nonsensical since the whole program has undefined
behavior.

The compiler will optimizer as if there is no undefined behavior and
will can lead to strange situations as the compiler concludes that
things like `a > a + 1000` can never be reached if `a` is a signed 8-bit
value (since reaching it would trigger undefined behavior).
2024-06-10 10:18:25 -04:00
Martin Geisler
4c61cafda8
Fix missing full stop in benefits.md (#2140) 2024-06-10 10:16:10 -04:00
dependabot[bot]
742df51d23
cargo: bump cc from 1.0.98 to 1.0.99 in /src/bare-metal/aps/examples in the patch group (#2136)
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.98 to 1.0.99

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:38:59 +01:00
dependabot[bot]
f71935e0cc
cargo: bump cc from 1.0.98 to 1.0.99 in /src/exercises/bare-metal/rtc in the patch group (#2135)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.98 to 1.0.99

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:38:36 +01:00
Dustin J. Mitchell
412eac6689
Clarify the suggested steps in the pin page (#2130)
The speaker notes suggest an evolution of the code to support a periodic
timer, but the last step was under-specified.

(As mentioned by @fw-immunant and referenced in #1536)
2024-06-07 16:39:14 -04:00
Nicole L
b69b68f5e2
Remove error handling from protobuf exercise (#2109) 2024-06-07 09:13:11 -07:00
Nicole L
511e5f0dbf
Add slide about Result to error handling section (#2123) 2024-06-07 09:12:51 -07:00
Nicole L
fbeda7216b
Adjust timing of standard library slides (#2125) 2024-06-07 09:11:57 -07:00
Dustin J. Mitchell
7c48cacf82
Fix dead link in glossary (#2114)
Fixes #2110. I think `references/strings.html` is a better choice as it
covers both String and &str.
2024-06-05 10:21:32 -04:00
Andrew Walbran
5f72514f04
Fix closing details tag (#2116) 2024-06-03 10:54:40 -04:00
Andrew Walbran
5f4ff0ab09
List expressions which are actually explained on this page (#2115)
`match` expressions were explained on an earlier page.
2024-06-03 10:54:16 -04:00
dependabot[bot]
d09041fb91
cargo: bump tokio from 1.37.0 to 1.38.0 in the minor group (#2113)
Bumps the minor group with 1 update:
[tokio](https://github.com/tokio-rs/tokio).

Updates `tokio` from 1.37.0 to 1.38.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 10:43:11 +01:00
Nicole L
59bf3bdcfb
Add a slide introducing dyn Trait in Generics (#2108)
I've been thinking it'd be simpler to introduce `dyn Trait` via `&dyn
Trait` rather than waiting for the smart pointers section and `Box<dyn
Trait>`. This PR adds a slide to the Generics section that introduces
`&dyn Trait` and compares it to `&impl Trait`, juxtaposing
monomorphization and static dispatch against type-erasure and dynamic
dispatch. I've then updated the existing trait object slide to call back
to the earlier introduction, and call out that using `Box<dyn Trait>`
gives you an owned trait object rather than a borrowed one.
2024-05-31 09:59:36 -04:00
Nicole L
06264e8cc7
Add a note that shared references are Copy (#2107)
Add a note to the `Copy` slide noting that shared references are `Copy`.
A student asked about this today, and it's something I want to remember
to mention in future classes.
2024-05-30 10:19:33 -04:00
Dustin J. Mitchell
13d69007d4
Clarify speaker note in control-flow-basics (#2102)
Fixes #2096.
2024-05-29 13:08:06 -04:00
Carlos Pereira Atencio
663018751d
Fix bare metal microcontroller part number. (#2065)
Small update, the microb:bit V2 has the nRF52833, the nRF51822 was from
V1.
2024-05-28 11:52:49 +00:00
dependabot[bot]
83b31e19af
cargo: bump the patch group with 2 updates (#2099)
Bumps the patch group with 2 updates:
[serde](https://github.com/serde-rs/serde) and
[tokio-websockets](https://github.com/Gelbpunkt/tokio-websockets).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 10:26:34 +01:00
dependabot[bot]
a3f31e795d
cargo: bump nrf52833-hal from 0.17.1 to 0.18.0 in /src/bare-metal/microcontrollers/examples in the minor group (#2098)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal).

Updates `nrf52833-hal` from 0.17.1 to 0.18.0
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nrf-rs/nrf-hal/blob/master/CHANGELOG.md">nrf52833-hal's
changelog</a>.</em></p>
<blockquote>
<h2>[0.18.0]</h2>
<h3>Breaking changes</h3>
<ul>
<li>Updated <code>nrf-usbd</code> to 0.3.0. (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/460">#460</a>)</li>
</ul>
<h3>New features</h3>
<ul>
<li>Added support for nRF52805 (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/422">#422</a>).</li>
<li>Added implementation of RTIC <code>Monotonic</code> for RTC and
TIMER, behind new <code>monotonic</code> feature (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/427">#427</a>).</li>
</ul>
<p><a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/422">#422</a>:
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/pull/422">nrf-rs/nrf-hal#422</a>
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/427">#427</a>:
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/pull/427">nrf-rs/nrf-hal#427</a>
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/460">#460</a>:
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/pull/440">nrf-rs/nrf-hal#440</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="997d0bd27a"><code>997d0bd</code></a>
Merge pull request <a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/476">#476</a>
from nrf-rs/release</li>
<li><a
href="bb7aef2593"><code>bb7aef2</code></a>
Prepare for 0.18.0 release.</li>
<li><a
href="090ce0ec9a"><code>090ce0e</code></a>
Merge pull request <a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/427">#427</a>
from Kyrne/master</li>
<li><a
href="4c00992a68"><code>4c00992</code></a>
Use consistent feature name.</li>
<li><a
href="eb8b34a73c"><code>eb8b34a</code></a>
Merge pull request <a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/477">#477</a>
from nrf-rs/buildfix</li>
<li><a
href="ee11451354"><code>ee11451</code></a>
rename user facing feature to rtic-monotonic</li>
<li><a
href="c8bf535d7b"><code>c8bf535</code></a>
Correct docs (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/18">#18</a>)</li>
<li><a
href="3c353da5f0"><code>3c353da</code></a>
Monotonic doesn't build on nrf51 or nrf52832 so remove the feature.</li>
<li><a
href="8eff0e5fc4"><code>8eff0e5</code></a>
Format doc comments and fix typos.</li>
<li><a
href="bb1bb77b30"><code>bb1bb77</code></a>
Fix feature conditions.</li>
<li>Additional commits viewable in <a
href="https://github.com/nrf-rs/nrf-hal/compare/v0.17.1...v0.18.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nrf52833-hal&package-manager=cargo&previous-version=0.17.1&new-version=0.18.0)](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


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 10:26:02 +01:00
Nicole L
6115a12554
Fix missing lifetime error in dangling reference example (#2093)
The example of returning a reference to a local variable doesn't compile
due to a missing lifetime specifier, which isn't what we're trying to
demonstrate with that example. I usually add the lifetime in manually in
order to demonstrate the compiler error, but it occurs to me that if we
make the argument a reference we can sneakily get the correct compiler
error without having to introduce the lifetime syntax.
2024-05-23 23:27:10 +00:00
Andrew Walbran
5ce6a9bd72
Downgrade cortex-m-rt to 0.7.3. (#2095)
0.7.4 was yanked.

Fixes #2094.
2024-05-23 15:14:05 -04:00
dependabot[bot]
82b60f27a0
cargo: bump the patch group with 4 updates (#2087)
Bumps the patch group with 4 updates:
[anyhow](https://github.com/dtolnay/anyhow),
[mdbook](https://github.com/rust-lang/mdBook),
[serde](https://github.com/serde-rs/serde) and
[thiserror](https://github.com/dtolnay/thiserror).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 10:06:01 +01:00
dependabot[bot]
d5d2c18157
cargo: bump cc from 1.0.97 to 1.0.98 in /src/exercises/bare-metal/rtc in the patch group (#2084)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.97 to 1.0.98
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/releases">cc's
releases</a>.</em></p>
<blockquote>
<h2>1.0.98</h2>
<h2>What's Changed</h2>
<ul>
<li>Cleanup some deprecated, unused allows by <a
href="https://github.com/klensy"><code>@​klensy</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1067">rust-lang/cc-rs#1067</a></li>
<li>Fix paths on Mac Catalyst by <a
href="https://github.com/madsmtm"><code>@​madsmtm</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1070">rust-lang/cc-rs#1070</a></li>
<li>Fix detect_compiler_family.c not being created by <a
href="https://github.com/Jake-Shadle"><code>@​Jake-Shadle</code></a> in
<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1072">rust-lang/cc-rs#1072</a></li>
<li>Release cc 1.0.98 by <a
href="https://github.com/NobodyXu"><code>@​NobodyXu</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1073">rust-lang/cc-rs#1073</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/klensy"><code>@​klensy</code></a> made
their first contribution in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1067">rust-lang/cc-rs#1067</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-lang/cc-rs/compare/1.0.97...1.0.98">https://github.com/rust-lang/cc-rs/compare/1.0.97...1.0.98</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3ba23569a6"><code>3ba2356</code></a>
Release cc 1.0.98 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1073">#1073</a>)</li>
<li><a
href="8f6d07f825"><code>8f6d07f</code></a>
Fix detect_compiler_family.c not being created (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1072">#1072</a>)</li>
<li><a
href="61b81c8b4c"><code>61b81c8</code></a>
Fix paths on Mac Catalyst (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1070">#1070</a>)</li>
<li><a
href="b7455eb81c"><code>b7455eb</code></a>
Cleanup some deprecated, unused allows (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1067">#1067</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/1.0.97...1.0.98">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.0.97&new-version=1.0.98)](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


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 09:35:32 +01:00
dependabot[bot]
990ad8f973
cargo: bump cc from 1.0.97 to 1.0.98 in /src/bare-metal/aps/examples in the patch group (#2085)
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.97 to 1.0.98
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/releases">cc's
releases</a>.</em></p>
<blockquote>
<h2>1.0.98</h2>
<h2>What's Changed</h2>
<ul>
<li>Cleanup some deprecated, unused allows by <a
href="https://github.com/klensy"><code>@​klensy</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1067">rust-lang/cc-rs#1067</a></li>
<li>Fix paths on Mac Catalyst by <a
href="https://github.com/madsmtm"><code>@​madsmtm</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1070">rust-lang/cc-rs#1070</a></li>
<li>Fix detect_compiler_family.c not being created by <a
href="https://github.com/Jake-Shadle"><code>@​Jake-Shadle</code></a> in
<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1072">rust-lang/cc-rs#1072</a></li>
<li>Release cc 1.0.98 by <a
href="https://github.com/NobodyXu"><code>@​NobodyXu</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1073">rust-lang/cc-rs#1073</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/klensy"><code>@​klensy</code></a> made
their first contribution in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1067">rust-lang/cc-rs#1067</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-lang/cc-rs/compare/1.0.97...1.0.98">https://github.com/rust-lang/cc-rs/compare/1.0.97...1.0.98</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3ba23569a6"><code>3ba2356</code></a>
Release cc 1.0.98 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1073">#1073</a>)</li>
<li><a
href="8f6d07f825"><code>8f6d07f</code></a>
Fix detect_compiler_family.c not being created (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1072">#1072</a>)</li>
<li><a
href="61b81c8b4c"><code>61b81c8</code></a>
Fix paths on Mac Catalyst (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1070">#1070</a>)</li>
<li><a
href="b7455eb81c"><code>b7455eb</code></a>
Cleanup some deprecated, unused allows (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1067">#1067</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/1.0.97...1.0.98">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.0.97&new-version=1.0.98)](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


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 09:35:18 +01:00
Gergely Risko
889a4cbbee
Fix the debug exercise in the "Borrowing a Value" section (#2083)
Trying to reproduce this RVO shows that actually the optimization that
is used here is simple inlining. Once inlining is disabled, the
addresses change, even with `-O -C opt-level=3`.

The return of the values is also never changed to an "efficient memcpy",
but instead was returned on eax+edx, although this result is of course
specific to the calling convention of the platform ABI, but no memcpy on
the most popular amd64 architecture.

I don't think it's educationally important to teach RVO here, so I
didn't go into any length trying to force Rust to do a real RVO (passing
Point address into the function on the assembly level, so the function
can fill in the addition). In my opinion the only important thing is,
that if a student is actually clicking the Playground link and looks
into the assembly, then our description should match the generated code.
That's why I just fixed the content instead of trying to fix the example
to be RVO.
2024-05-17 10:07:47 -04:00
dependabot[bot]
a1d43bc74b
cargo: bump the patch group with 7 updates (#2077)
Bumps the patch group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.82` | `1.0.83` |
| [serde](https://github.com/serde-rs/serde) | `1.0.200` | `1.0.201` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.116` | `1.0.117`
|
| [zerocopy](https://github.com/google/zerocopy) | `0.7.33` | `0.7.34` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.59` |
`1.0.60` |
| [cxx](https://github.com/dtolnay/cxx) | `1.0.121` | `1.0.122` |
| [cxx-build](https://github.com/dtolnay/cxx) | `1.0.121` | `1.0.122` |

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 10:28:26 +01:00
dependabot[bot]
cf0c23d842
cargo: bump cc from 1.0.96 to 1.0.97 in /src/bare-metal/aps/examples in the patch group (#2076)
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.96 to 1.0.97

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 10:27:43 +01:00
dependabot[bot]
bdd1c27eee
cargo: bump cc from 1.0.96 to 1.0.97 in /src/exercises/bare-metal/rtc in the patch group (#2075)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.96 to 1.0.97

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 10:27:28 +01:00