1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-12-22 22:51:12 +02:00
Commit Graph

60 Commits

Author SHA1 Message Date
Nicole L
a76b50a0df Remove unnecessary dependencies on libbinder_rs (#2782)
These dependencies turned out not to be necessary, since depending on
the generated `com.example.birthdayservice-rust` also exports the common
binder functionality.
2025-07-25 11:11:56 +02:00
Nicole L
f37402066d Remove unnecessary type cast in C ffi example (#2783)
A `&T` can automatically coerce to a `*const T`, so the manual cast
isn't necessary here.
2025-07-25 11:10:31 +02:00
dependabot[bot]
6194ac4abb cargo: bump the patch group with 4 updates (#2795)
Bumps the patch group with 4 updates:
[clap](https://github.com/clap-rs/clap),
[googletest](https://github.com/google/googletest-rust),
[zerocopy](https://github.com/google/zerocopy) 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>
2025-07-01 11:01:37 +01:00
dependabot[bot]
1a2081765e cargo: bump the patch group with 4 updates (#2758)
Bumps the patch group with 4 updates:
[clap](https://github.com/clap-rs/clap),
[mdbook](https://github.com/rust-lang/mdBook),
[googletest](https://github.com/google/googletest-rust) and
[reqwest](https://github.com/seanmonstar/reqwest).
2025-06-01 15:30:29 -04:00
Andrew Walbran
fc6e5c7526 Update to Rust 2024 edition. (#2658) 2025-05-23 19:03:03 +01:00
dependabot[bot]
23d1d64aeb cargo: bump the minor group with 4 updates (#2704)
Bumps the minor group with 4 updates:
[googletest](https://github.com/google/googletest-rust),
[http](https://github.com/hyperium/http),
[tokio](https://github.com/tokio-rs/tokio) and
[tempfile](https://github.com/Stebalien/tempfile).

Updates `googletest` from 0.13.0 to 0.14.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/google/googletest-rust/releases">googletest's
releases</a>.</em></p>
<blockquote>
<h2>v0.14.0</h2>
<p>Many thanks to <a
href="https://github.com/carlwhamilton"><code>@​carlwhamilton</code></a>,
<a href="https://github.com/kezhuw"><code>@​kezhuw</code></a>, <a
href="https://github.com/calder"><code>@​calder</code></a>, <a
href="https://github.com/eopb"><code>@​eopb</code></a> for contributing
to this release!</p>
<h1>API Changes</h1>
<ul>
<li>Rename <code>into_test_result</code> to <code>or_fail</code> (<a
href="2720c7655a</a>).</li>
</ul>
<h1>New Features</h1>
<ul>
<li>Make <code>matches_pattern</code> support <code>_</code> at the top
level in tuple and braced structs (<a
href="a1e9bac623</a>,
<a
href="3d65dea660</a>).</li>
<li>Make <code>matches_pattern</code> enforce exhaustive field checks
for tuple and braced structs by default (<a
href="2ba098e023</a>,
<a
href="99bcfaa4de</a>,
<a
href="a17b655b47</a>).</li>
<li>Add a <code>container_eq(...).ignore_order()</code> matcher (<a
href="48ffd20f9a</a>).</li>
<li>Add <code>StrMatcher::ignoring_unicode_case</code> (<a
href="25322c86a9</a>).</li>
<li>Add support for the Bazel test sharing protocol (<a
href="b8d251aa4a</a>,
<a
href="ef06f3fc8e</a>,
<a
href="cb8eaf9126</a>).</li>
<li>Add <code>is_finite</code> and <code>is_infinite</code> matchers (<a
href="9a6712c9b7</a>,
<a
href="4e35e2ce3c</a>).</li>
<li>Make googletest-rust usable from <code>#![no_std]</code> crates (<a
href="7ca2fb5a8b</a>).</li>
<li>Append generated test macro so that other test macros are aware of
it (<a
href="ee4996ddb7</a>).</li>
<li>Improve the macro hygiene of <code>expect_that!</code> (<a
href="1a6ef3d9fb</a>).</li>
<li>Implement the Bazel <code>TESTBRIDGE_TEST_ONLY</code> protocol for
test filtering with globs (<a
href="a834f86fb9</a>,
<a
href="43d5976e85</a>,
<a
href="8fa7024885</a>).</li>
<li>Allow passing of failure messages and formatting arguments to
<code>expect_true!</code>, <code>expect_false!</code>,
<code>assert_pred!</code>, and <code>expect_pred!</code> (<a
href="298629403a</a>,
<a
href="bbae567c67</a>).</li>
</ul>
<h1>Bug Fixes</h1>
<ul>
<li>Fix issue where macros do not compile without <code>use
googletest::prelude::*;</code> by making calls between macros fully
qualified (<a
href="7a54871950</a>).</li>
<li>Improve test hermeticity by calling
<code>Command::env_clear()</code> in integration tests (<a
href="b90142ad8b</a>).</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/google/googletest-rust/compare/v0.13.0...v0.14.0">https://github.com/google/googletest-rust/compare/v0.13.0...v0.14.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bbae567c67"><code>bbae567</code></a>
Add ability to pass failure message and formatting args to
<code>assert_pred</code>, `ex...</li>
<li><a
href="298629403a"><code>2986294</code></a>
Add ability to pass failure message and formatting args to expect_true
and ex...</li>
<li><a
href="f5a975e574"><code>f5a975e</code></a>
Merge pull request <a
href="https://redirect.github.com/google/googletest-rust/issues/604">#604</a>
from google:dependabot/cargo/tempfile-3.18.0</li>
<li><a
href="e61f5a1da1"><code>e61f5a1</code></a>
Merge pull request <a
href="https://redirect.github.com/google/googletest-rust/issues/605">#605</a>
from google:dependabot/cargo/rustversion-1.0.20</li>
<li><a
href="cf4c00d5b3"><code>cf4c00d</code></a>
Bump tempfile from 3.17.1 to 3.18.0</li>
<li><a
href="b707104e96"><code>b707104</code></a>
Merge pull request <a
href="https://redirect.github.com/google/googletest-rust/issues/606">#606</a>
from google:dependabot/cargo/syn-2.0.100</li>
<li><a
href="372838ee93"><code>372838e</code></a>
Merge pull request <a
href="https://redirect.github.com/google/googletest-rust/issues/607">#607</a>
from google:dependabot/cargo/indoc-2.0.6</li>
<li><a
href="eb9ad3becf"><code>eb9ad3b</code></a>
Merge pull request <a
href="https://redirect.github.com/google/googletest-rust/issues/608">#608</a>
from google:dependabot/cargo/tokio-1.44.0</li>
<li><a
href="cd02cd15fe"><code>cd02cd1</code></a>
Merge pull request <a
href="https://redirect.github.com/google/googletest-rust/issues/609">#609</a>
from google:dependabot/github_actions/github/codeql-a...</li>
<li><a
href="b1dbc67e1f"><code>b1dbc67</code></a>
🌱 Bump github/codeql-action from 3.28.10 to 3.28.11</li>
<li>Additional commits viewable in <a
href="https://github.com/google/googletest-rust/compare/v0.13.0...v0.14.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `http` from 1.2.0 to 1.3.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/http/releases">http's
releases</a>.</em></p>
<blockquote>
<h2>v1.3.1</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: validate path bytes are at least utf8 by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/http/pull/756">hyperium/http#756</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/hyperium/http/compare/v1.3.0...v1.3.1">https://github.com/hyperium/http/compare/v1.3.0...v1.3.1</a></p>
<h2>v1.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Allow most UTF-8 characters in URI path and query. (<a
href="https://redirect.github.com/hyperium/http/pull/715">hyperium/http#715</a>)
<ul>
<li>This means paring <code>Uri</code>s with previously illegal
characters according the original RFC will now be accepted. They used to
be rejected in the name of spec purity, but many operators were using a
fork of <code>http</code> because reality is that most characters are
seen in the real world.</li>
</ul>
</li>
<li>Fix <code>HeaderMap::reserve()</code> to allocate sufficient
capacity.</li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/joelwurtz"><code>@​joelwurtz</code></a>
made their first contribution in <a
href="https://redirect.github.com/hyperium/http/pull/715">hyperium/http#715</a></li>
<li><a href="https://github.com/ADD-SP"><code>@​ADD-SP</code></a> made
their first contribution in <a
href="https://redirect.github.com/hyperium/http/pull/738">hyperium/http#738</a></li>
<li><a href="https://github.com/kawaemon"><code>@​kawaemon</code></a>
made their first contribution in <a
href="https://redirect.github.com/hyperium/http/pull/741">hyperium/http#741</a></li>
<li><a href="https://github.com/DaniPopes"><code>@​DaniPopes</code></a>
made their first contribution in <a
href="https://redirect.github.com/hyperium/http/pull/748">hyperium/http#748</a></li>
<li><a href="https://github.com/jpds"><code>@​jpds</code></a> made their
first contribution in <a
href="https://redirect.github.com/hyperium/http/pull/695">hyperium/http#695</a></li>
</ul>
<h2>Thanks!</h2>
<ul>
<li><a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a></li>
<li><a href="https://github.com/tottoto"><code>@​tottoto</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/hyperium/http/compare/v1.2.0...v1.3.0">https://github.com/hyperium/http/compare/v1.2.0...v1.3.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/http/blob/master/CHANGELOG.md">http's
changelog</a>.</em></p>
<blockquote>
<h1>1.3.1 (March 11, 2025)</h1>
<ul>
<li>Fix validation that all characters are UTF-8 in URI path and
query.</li>
</ul>
<h1>1.3.0 (March 11, 2025)</h1>
<ul>
<li>Allow most UTF-8 characters in URI path and query.</li>
<li>Fix <code>HeaderMap::reserve()</code> to allocate sufficient
capacity.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8c1fb204b8"><code>8c1fb20</code></a>
v1.3.1</li>
<li><a
href="6637a72864"><code>6637a72</code></a>
fix: validate path bytes are at least utf8 (<a
href="https://redirect.github.com/hyperium/http/issues/756">#756</a>)</li>
<li><a
href="d0dd91e9b5"><code>d0dd91e</code></a>
v1.3.0</li>
<li><a
href="64bd92b9cc"><code>64bd92b</code></a>
docs: Fixed encryption/compression typo for 'accept-encoding: identity'.
(<a
href="https://redirect.github.com/hyperium/http/issues/695">#695</a>)</li>
<li><a
href="b03ed6a7e5"><code>b03ed6a</code></a>
chore: use range.contains in StatusCode methods (<a
href="https://redirect.github.com/hyperium/http/issues/748">#748</a>)</li>
<li><a
href="a463fb5995"><code>a463fb5</code></a>
chore(ci): use yq to get rust-version in manifest (<a
href="https://redirect.github.com/hyperium/http/issues/746">#746</a>)</li>
<li><a
href="68845bd24d"><code>68845bd</code></a>
fix: HeaderMap::reserve allocates insufficient capacity (<a
href="https://redirect.github.com/hyperium/http/issues/741">#741</a>)</li>
<li><a
href="4e020461ca"><code>4e02046</code></a>
refactor(header): remove BytesMut inline optimization when creating (<a
href="https://redirect.github.com/hyperium/http/issues/738">#738</a>)</li>
<li><a
href="091ee9a6d7"><code>091ee9a</code></a>
feat(uri): allow utf8 char, not rfc 3986 compliant, in path and query
(<a
href="https://redirect.github.com/hyperium/http/issues/715">#715</a>)</li>
<li>See full diff in <a
href="https://github.com/hyperium/http/compare/v1.2.0...v1.3.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `tokio` from 1.43.0 to 1.44.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.44.1</h2>
<h1>1.44.1 (March 13th, 2025)</h1>
<h3>Fixed</h3>
<ul>
<li>rt: skip defer queue in <code>block_in_place</code> context (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7216">#7216</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/7216">#7216</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7216">tokio-rs/tokio#7216</a></p>
<h2>Tokio v1.44.0</h2>
<h1>1.44.0 (March 7th, 2025)</h1>
<p>This release changes the <code>from_std</code> method on sockets to
panic if a blocking socket is provided. We determined this change is not
a breaking change as Tokio is not intended to operate using blocking
sockets. Doing so results in runtime hangs and should be considered a
bug. Accidentally passing a blocking socket to Tokio is one of the most
common user mistakes. If this change causes an issue for you, please
comment on <a
href="https://redirect.github.com/tokio-rs/tokio/issues/7172">#7172</a>.</p>
<h3>Added</h3>
<ul>
<li>coop: add <code>task::coop</code> module (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7116">#7116</a>)</li>
<li>process: add <code>Command::get_kill_on_drop()</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7086">#7086</a>)</li>
<li>sync: add <code>broadcast::Sender::closed</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6685">#6685</a>,
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7090">#7090</a>)</li>
<li>sync: add <code>broadcast::WeakSender</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7100">#7100</a>)</li>
<li>sync: add <code>oneshot::Receiver::is_empty()</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7153">#7153</a>)</li>
<li>sync: add <code>oneshot::Receiver::is_terminated()</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7152">#7152</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>fs: empty reads on <code>File</code> should not start a background
read (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7139">#7139</a>)</li>
<li>process: calling <code>start_kill</code> on exited child should not
fail (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7160">#7160</a>)</li>
<li>signal: fix <code>CTRL_CLOSE</code>, <code>CTRL_LOGOFF</code>,
<code>CTRL_SHUTDOWN</code> on windows (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7122">#7122</a>)</li>
<li>sync: properly handle panic during mpsc drop (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7094">#7094</a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li>runtime: clean up magic number in registration set (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7112">#7112</a>)</li>
<li>coop: make coop yield using waker defer strategy (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7185">#7185</a>)</li>
<li>macros: make <code>select!</code> budget-aware (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7164">#7164</a>)</li>
<li>net: panic when passing a blocking socket to <code>from_std</code>
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7166">#7166</a>)</li>
<li>io: clean up buffer casts (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7142">#7142</a>)</li>
</ul>
<h3>Changes to unstable APIs</h3>
<ul>
<li>rt: add before and after task poll callbacks (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7120">#7120</a>)</li>
<li>tracing: make the task tracing API unstable public (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6972">#6972</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>docs: fix nesting of sections in top-level docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7159">#7159</a>)</li>
<li>fs: rename symlink and hardlink parameter names (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7143">#7143</a>)</li>
<li>io: swap reader/writer in simplex doc test (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7176">#7176</a>)</li>
<li>macros: docs about <code>select!</code> alternatives (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7110">#7110</a>)</li>
<li>net: rename the argument for <code>send_to</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7146">#7146</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d413c9c02a"><code>d413c9c</code></a>
chore: prepare Tokio v1.44.1 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7217">#7217</a>)</li>
<li><a
href="addbfb9204"><code>addbfb9</code></a>
rt: skip defer queue in <code>block_in_place</code> context (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7216">#7216</a>)</li>
<li><a
href="8182ecf262"><code>8182ecf</code></a>
chore: prepare Tokio v1.44.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7202">#7202</a>)</li>
<li><a
href="a258bff701"><code>a258bff</code></a>
ci: enable printing in multi thread loom tests (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7200">#7200</a>)</li>
<li><a
href="e076d21f67"><code>e076d21</code></a>
process: clarify <code>Child::kill</code> behavior (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7162">#7162</a>)</li>
<li><a
href="042433cdcc"><code>042433c</code></a>
net: debug_assert on creating a tokio socket from a blocking one (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7166">#7166</a>)</li>
<li><a
href="0284d1b5c8"><code>0284d1b</code></a>
macros: make <code>select!</code> budget-aware (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7164">#7164</a>)</li>
<li><a
href="710bc8071e"><code>710bc80</code></a>
rt: coop should yield using waker defer strategy (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7185">#7185</a>)</li>
<li><a
href="a2b12bd579"><code>a2b12bd</code></a>
readme: adjust release schedule to once per month (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7191">#7191</a>)</li>
<li><a
href="e7b593cbee"><code>e7b593c</code></a>
process: fix grammar of the <code>ChildStdin</code> struct doc comment
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7192">#7192</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.43.0...tokio-1.44.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `tempfile` from 3.17.1 to 3.19.1
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md">tempfile's
changelog</a>.</em></p>
<blockquote>
<h2>3.19.1</h2>
<ul>
<li>Don't unlink temporary files immediately on Windows (fixes <a
href="https://redirect.github.com/Stebalien/tempfile/issues/339">#339</a>).
Unfortunately, this seemed to corrupt the file object (possibly a
Windows kernel bug) in rare cases and isn't strictly speaking
necessary.</li>
</ul>
<h2>3.19.0</h2>
<ul>
<li>Remove direct dependency on <code>cfg-if</code>. It's still in the
tree, but we didn't really need to use it in this crate.</li>
<li>Add an unstable feature
(<code>unstable-windows-keep-open-tempfile</code>) to test a potential
fix to <a
href="https://redirect.github.com/Stebalien/tempfile/issues/339">#339</a>.</li>
</ul>
<h2>3.18.0</h2>
<ul>
<li>Update <code>rustix</code> to 1.0.0.</li>
<li>Make <code>NamedTempFile::persist_noclobber</code> atomic on Apple
operating systems. It's now atomic on MacOS, Windows, and Linux
(depending on the OS version and filesystem used).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="95540ed3fc"><code>95540ed</code></a>
chore: release v3.19.1</li>
<li><a
href="b60aae49c1"><code>b60aae4</code></a>
fix(windows): don't automatically delete files on open (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/344">#344</a>)</li>
<li><a
href="167f544abe"><code>167f544</code></a>
ci(cargo-deny): remove windows-sys exception (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/343">#343</a>)</li>
<li><a
href="42fff6813d"><code>42fff68</code></a>
chore: release v3.19.0</li>
<li><a
href="61b4283c20"><code>61b4283</code></a>
feat(windows): add a feature to immediate tempfile deletion (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/340">#340</a>)</li>
<li><a
href="c2d16b3bc3"><code>c2d16b3</code></a>
ci: downgrade once-cell on old rustc versions (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/342">#342</a>)</li>
<li><a
href="35c204d7c2"><code>35c204d</code></a>
chore: remove cfg-if dependency (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/338">#338</a>)</li>
<li><a
href="b8bddaf0cf"><code>b8bddaf</code></a>
release 3.18.0</li>
<li><a
href="0e17869470"><code>0e17869</code></a>
update rustix (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/336">#336</a>)</li>
<li><a
href="6cf65365a4"><code>6cf6536</code></a>
doc: fix markdown</li>
<li>Additional commits viewable in <a
href="https://github.com/Stebalien/tempfile/compare/v3.17.1...v3.19.1">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>
2025-04-01 10:09:45 +02:00
Nicole L
d7a88211ff Update AIDL intermediates path (#2639)
---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
2025-02-26 17:28:11 +00:00
Nicole L
e52f5ea9e3 Fix vendored crates path (#2638) 2025-02-26 09:17:49 -08:00
Nicole L
32a16c95dc Add note about AIDL methods taking &self (#2641) 2025-02-26 09:17:22 -08:00
Nicole L
5f6b9333fa Add Android.bp entries for googletest and mockall example tests (#2643) 2025-02-26 09:11:48 -08:00
Nicole L
4ee2337c63 Add missing static_libs dep for libbirthday example (#2640) 2025-02-26 09:07:36 -08:00
Nicole L
7f8596e9bc Use jni_libs for JNI dependency (#2637) 2025-02-26 09:06:09 -08:00
Eric Githinji
49e4efcd9e Split C interop slides into smaller slides. (#2645) 2025-02-22 19:48:10 +00:00
Martin Geisler
644f849bf8 Add speaker notes to bindgen slides (#2491)
Part of #1083.
2024-12-16 16:54:13 -05:00
Martin Geisler
dad8cadc6b Add speaker notes to Android build rules (#2492)
Part of #1083.
2024-12-16 16:54:04 -05:00
Martin Geisler
64bd331314 Add speaker notes to interop with C slides (#2496)
Part of #1083.
2024-12-16 16:53:54 -05:00
Martin Geisler
5d6e26ac10 Add missing docstring to birthday server implementation (#2464)
Without this, compilation fails. The comment *is* in the included Rust
file — but we only include a fraction of the file to keep the example
short. This makes it cumbersome to both show something that works in the
slides while also making it possible for the instructor to show more
complex examples.

@randomPoison, we need to make our examples simpler here: the complexity
here makes it hard to modify the files and I feel it's hard to show
during class. I would suggest splitting this up into a very basic
example (what the birthday service was) and then add 1-2 slides with
more complex samples (if necessary). Last I taught the class, I had a
hard time a) making every example compile and b) finding time to cover
everything.

I would err on the side of makings things simple and clear.
2024-12-06 12:10:42 -08:00
Martin Geisler
e4e6b0ce1d Add speaker notes to AIDL slide (#2494)
Part of #1083.
2024-12-05 15:59:21 -08:00
Martin Geisler
54e0eab236 Add speaker notes to JNI slide (#2495)
Part of #1083.
2024-12-05 12:30:03 -05:00
Martin Geisler
69d4fc13a4 Delete empty and unused slide (#2493)
The page is not mentioned in the `SUMMARY.md` file and has apparently
been forgotten.

We could consider adding a check for this situation, but since I don't
think it occurs very often, I don't consider it high priority.
2024-12-05 10:25:21 -05:00
Martin Geisler
d868584623 Show path to auto-generate AIDL code on slide (#2417)
This updates the surrounding text to bring it in line with the other
slides.
2024-12-03 17:01:55 +01:00
dependabot[bot]
c85816a01f cargo: bump the patch group across 1 directory with 12 updates (#2489)
Bumps the patch group with 12 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.91` | `1.0.93` |
| [clap](https://github.com/clap-rs/clap) | `4.5.20` | `4.5.21` |
| [mdbook](https://github.com/rust-lang/mdBook) | `0.4.40` | `0.4.43` |
| [serde](https://github.com/serde-rs/serde) | `1.0.214` | `1.0.215` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.132` | `1.0.133`
|
| [csv](https://github.com/BurntSushi/rust-csv) | `1.3.0` | `1.3.1` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.41.0` | `1.41.1` |
| [url](https://github.com/servo/rust-url) | `2.5.2` | `2.5.4` |
| [mockall](https://github.com/asomers/mockall) | `0.13.0` | `0.13.1` |
| [zerocopy](https://github.com/google/zerocopy) | `0.8.8` | `0.8.11` |
| [cxx](https://github.com/dtolnay/cxx) | `1.0.129` | `1.0.133` |
| [cxx-build](https://github.com/dtolnay/cxx) | `1.0.129` | `1.0.133` |

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 21:05:18 +00:00
dependabot[bot]
3eb2eb8b36 cargo: bump the minor group with 2 updates (#2486)
Bumps the minor group with 2 updates:
[googletest](https://github.com/google/googletest-rust) and
[tempfile](https://github.com/Stebalien/tempfile).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 20:41:54 +00:00
Martin Geisler
2256525a90 Be explicit that Android examples need a Git checkout (#2465)
Without this, students will see subtle differences between what is on
the slides and what we have in the code (see #2464 for an example).
2024-11-19 13:25:44 -05:00
Andrew Walbran
f8882190f3 Updates for Rust 1.82 (#2449)
Rust 1.82 adds `&raw` expressions, and marks some attributes as unsafe.
2024-11-01 08:39:56 +01:00
Martin Geisler
7a462efb57 Ensure examples compile on latest version of AOSP (#2414)
This is part of #2398.
2024-10-28 19:35:54 +01:00
Martin Geisler
ec6cb024e8 Apply clippy::semicolon_if_nothing_returned (#2410)
This is for consistency: if a block returns `()`, and the last
expression of the block also returns `()`, then the final `;` can be
left out.

However, this is a little confusing (I was asked about this in a class
today) and it is inconsistent.

See

https://rust-lang.github.io/rust-clippy/master/index.html#/semicolon_if_nothing_returned
for details.
2024-10-21 19:57:01 +02:00
Martin Geisler
e5d73d915b Format filenames consistently (#2415)
The style used in the rest of the course is _italic_ filenames, so we
should be careful to not suddenly use **bold** names.

The style is of course up for debate, but we need to ensure
consistency first.
2024-10-18 12:29:31 +02:00
Martin Geisler
fb17791c26 Remove misplaced extern "C" (#2429)
I think something changed: I now get a compilation error with these
lines (and it works fine without).
2024-10-18 09:03:54 +02:00
Nicole L
d2bc223a06 Misc. Android Improvements (#2325)
- Add missing package declaration on the AIDL interface slide.
- Make the parcelable example more self-contained. The existing code was
referencing variables that weren't declared in the example code.
- Add a speaker note to the logging slide about explaining that the
logger implementation is only needed in binaries, and that just the log
facade is needed in libraries.
2024-09-17 09:09:07 -07:00
Martin Geisler
1f1a7708af Update build-rules.md (#2355)
Fixes #1837.
2024-09-11 10:37:24 -07:00
dependabot[bot]
3ecf12123b cargo: bump the minor group with 2 updates (#2290)
Bumps the minor group with 2 updates:
[pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) and
[googletest](https://github.com/google/googletest-rust).
2024-08-20 16:46:56 +01:00
Luca Palmieri
697df5599e Update "Rust advanced testing" links to point at the hosted book version (#2265)
Following up on @mgeisler's comment in
https://github.com/google/comprehensive-rust/pull/2029
2024-08-05 14:11:24 +00:00
Jonathan Daniel
1c964f6fe3 Fix a broken link and check internal links (#2195)
In #2153 I aimed to fix a link but broke it.
In this PR, I fix it and add
[`mdbook-linkcheck`](https://github.com/Michael-F-Bryan/mdbook-linkcheck)
to avoid future cases.

Some past fixes that could have been prevented, in addition to mine in
this PR:
* #811
* #2064
* #2146

Note:  
`mdbook-linkcheck` may also check external links with a configuration
change.
It can be beneficial to check also external links from time to time. I
ran it here and found 3 broken links.

Maintainers - sorry for the lack of a preceding issue. We can discuss it
here.
Some remaining work is to fix the outdated internal links in the
translations, not done here.
Let me know what you think about the proposed contribution.

This PR completes #1502.
2024-07-22 11:37:19 +00:00
dependabot[bot]
a4ea10f8a1 cargo: bump mockall from 0.12.1 to 0.13.0 in the minor group (#2240)
Bumps the minor group with 1 update:
[mockall](https://github.com/asomers/mockall).

Updates `mockall` from 0.12.1 to 0.13.0
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/asomers/mockall/blob/master/CHANGELOG.md">mockall's
changelog</a>.</em></p>
<blockquote>
<h1>Change Log</h1>
<p>All notable changes to this project will be documented in this file.
This project adheres to <a href="http://semver.org/">Semantic
Versioning</a>.</p>
<h2>[ Unreleased ] - ReleaseDate</h2>
<h3>Added</h3>
<ul>
<li>
<p>Add the ability to use <code>#[concretize]</code> with methods that
have an <code>FnMut</code>
argument.
(<a
href="https://redirect.github.com/asomers/mockall/pull/595">#595</a>)</p>
</li>
<li>
<p>Add the ability to mock methods that use <code>#[auto_enum]</code>,
from the
<code>auto_enums</code> crate. But only for methods that use RPIT;
Mockall can't yet
handle syntax like <code>-&gt; Result&lt;(), impl T&gt;</code>
(<a
href="https://redirect.github.com/asomers/mockall/pull/590">#590</a>)</p>
</li>
<li>
<p>Add the ability to mock methods that use <code>#[inline]</code> or
<code>#[cold]</code>, and
methods or traits that use <code>#[must_use]</code>.
(<a
href="https://redirect.github.com/asomers/mockall/pull/555">#555</a>)</p>
</li>
</ul>
<h3>Changed</h3>
<ul>
<li>
<p>Raised MSRV to 1.71.0 due to the <code>C-unwind</code> ABI.
(<a
href="https://redirect.github.com/asomers/mockall/pull/585">#585</a>)</p>
</li>
<li>
<p>No longer poison a Context object's internal <code>Mutex</code> when
panicing. This
requires the &quot;nightly&quot; feature.
(<a
href="https://redirect.github.com/asomers/mockall/pull/527">#527</a>)</p>
</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fixed panicing within mocked <code>extern &quot;C&quot;</code>
functions, for example due to
unsatisfied expectations, with Rust 1.81.0 or newer.
(<a
href="https://redirect.github.com/asomers/mockall/pull/585">#585</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/asomers/mockall/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mockall&package-manager=cargo&previous-version=0.12.1&new-version=0.13.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-07-22 11:14:04 +01:00
Luca Palmieri
f2de222d66 Add links to the Rust advanced testing workshop (#2029)
Following up on https://github.com/google/googletest-rust/issues/376

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-05-03 08:20:02 +00:00
Andrew Walbran
b808887006 Add safety comments and use consistent format for existing ones. (#1981)
We should have safety comments on all `unsafe` blocks, to set a good
example.
2024-04-12 13:19:19 -04:00
Martin Geisler
1b3984df20 Move Mockall and GoogleTest slides to Android section (#1533)
After #1528 and #1532, we now have actual slides which showcase the
crates in action. So we can reclaim a few minutes by removing the slide
which mentions Mockall and GoogleTest slide.

The slide mentioned [proptest](https://docs.rs/proptest) and
[rstest](https://docs.rs/rstest) as well. While I'm sure the libraries
are useful, we don't have them imported into AOSP and I've never
personally used them. We should therefore not advertise them yet at this
point since they won't be useful to Android engineers.

Of course we can mention things that are not in AOSP (or in Chromium),
but I think we should do it in the speaker notes at most.
2024-03-04 16:25:35 +01:00
Nicole L
f5f2c6b925 Binder/AIDL content updates (#1618) 2024-02-09 15:11:10 -08:00
Martin Geisler
1f6c0ea8a6 Remove double "finally" in java.md (#1732) 2024-01-22 11:15:06 -08:00
Martin Geisler
c9f66fd425 Format all Markdown files with dprint (#1157)
This is the result of running `dprint fmt` after removing `src/` from
the list of excluded directories.

This also reformats the Rust code: we might want to tweak this a bit in
the future since some of the changes removes the hand-formatting. Of
course, this formatting can be seen as a mis-feature, so maybe this is
good overall.

Thanks to mdbook-i18n-helpers 0.2, the POT file is nearly unchanged
after this, meaning that all existing translations remain valid! A few
messages were changed because of stray whitespace characters:

     msgid ""
     "Slices always borrow from another object. In this example, `a` has to remain "
    -"'alive' (in scope) for at least as long as our slice. "
    +"'alive' (in scope) for at least as long as our slice."
     msgstr ""

The formatting is enforced in CI and we will have to see how annoying
this is in practice for the many contributors. If it becomes annoying,
we should look into fixing dprint/check#11 so that `dprint` can annotate
the lines that need fixing directly, then I think we can consider more
strict formatting checks.

I added more customization to `rustfmt.toml`. This is to better emulate
the dense style used in the course:

- `max_width = 85` allows lines to take up the full width available in
our code blocks (when taking margins and the line numbers into account).
- `wrap_comments = true` ensures that we don't show very long comments
in the code examples. I edited some comments to shorten them and avoid
unnecessary line breaks — please trim other unnecessarily long comments
when you see them! Remember we're writing code for slides 😄
- `use_small_heuristics = "Max"` allows for things like struct literals
and if-statements to take up the full line width configured above.

The formatting settings apply to all our Rust code right now — I think
we could improve this with https://github.com/dprint/dprint/issues/711
which lets us add per-directory `dprint` configuration files. However,
the `inherit: true` setting is not yet implemented (as far as I can
tell), so a nested configuration file will have to copy most or all of
the top-level file.
2023-12-31 00:15:07 +01:00
Ning Chen
2fc3ddc34d Add adb root for service deployment (#1550)
Otherwise
```
$ adb shell /data/local/tmp/birthday_server
thread 'main' panicked at birthday_service/src/server.rs:16:10:
Failed to register service: PERMISSION_DENIED
```
2023-12-21 14:29:18 +01:00
Ning Chen
01b4b28ff8 Link statically to avoid dynamic link error (#1544)
```
$ adb shell /data/local/tmp/hello_rust_with_dep
CANNOT LINK EXECUTABLE "/data/local/tmp/hello_rust_with_dep": library "libtextwrap.dylib.so" not found: needed by main executable
```
2023-12-21 14:27:14 +01:00
Ning Chen
a9eaa129cf Add safety comment (#1553)
```
error: unsafe block missing a safety comment
  --> interoperability/bindgen/main.rs:11:5
   |
11 |     unsafe {
   |     ^^^^^^^^
   |
   = help: consider adding a safety comment on the preceding line
   = help: for further information visit https://rust-lang.github.io/rust-clippy
/master/index.html#undocumented_unsafe_blocks
   = note: requested on the command line with `-D clippy::undocumented-unsafe-bl
ocks`
```
2023-12-21 14:26:25 +01:00
Lukasz Anforowicz
584c957d69 Fix spelling of CXX and Cargo (mostly in the Chromium part). (#1549) 2023-12-01 10:21:47 -08:00
Ning Chen
3f7b6d4ad7 Fix adb push command (#1542)
```
$ adb push "$ANDROID_PRODUCT_OUT/system/bin/hello_rust /data/local/tmp"
adb: push requires <source> and <destination> arguments
```

---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-12-01 10:05:46 +00:00
Ning Chen
ca0bfedac6 Update setup.md (#1519)
```
$ lunch aosp_cf_x86_64_phone-userdebug

Invalid lunch combo: aosp_cf_x86_64_phone-userdebug
Valid combos must be of the form <product>-<release>-<variant>
```
2023-11-30 13:36:42 +00:00
gurchetansingh
d2aab63d15 More speaker notes about Android (#1501)
Helps with https://github.com/google/comprehensive-rust/issues/1083
2023-11-28 19:19:04 +00:00
spoloxs
67d53d29a6 Update Android.bp files (#895)
Remove the `prefer_rlib` flags from all `Android.bp` files.

Solves issue #371
2023-11-08 16:56:29 -08:00
Nicole L
ca61ca4f57 Add CXX tutorial (#1392)
Add a number of slides that cover most of CXX's functionality and
demonstrate how it can be used.

Fixes #823.

---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-11-06 16:34:29 -08:00