1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-17 06:37:34 +02:00

Fix spelling of CXX and Cargo (mostly in the Chromium part). (#1549)

This commit is contained in:
Lukasz Anforowicz
2023-12-01 18:21:47 +00:00
committed by GitHub
parent 53baee82e3
commit 584c957d69
12 changed files with 31 additions and 31 deletions

View File

@ -39,12 +39,12 @@ Students will likely need some hints here. Hints include:
on the C++ side using `base::UTF16ToUTF8` and back again.
* If students decide to do the conversion on the Rust side, they'll need to
consider [`String::from_utf16`][1], consider error handling, and
consider which [cxx supported types can transfer a lot of u16s][2].
consider which [CXX supported types can transfer a lot of u16s][2].
* Students may design the C++/Rust boundary in several different ways,
e.g. taking and returning strings by value, or taking a mutable reference
to a string. If a mutable reference is used, cxx will likely
to a string. If a mutable reference is used, CXX will likely
tell the student that they need to use [`Pin`][3]. You may need to explain
what `Pin` does, and then explain why `cxx` needs it for mutable references
what `Pin` does, and then explain why CXX needs it for mutable references
to C++ data: the answer is that C++ data can't be moved around like Rust
data, because it may contain self-referential pointers.
* The C++ target containing `ResourceBundle::MaybeMangleLocalizedString`

View File

@ -14,7 +14,7 @@
## Part two
It's a good idea to play with cxx a little. It helps you think about how flexible
It's a good idea to play with CXX a little. It helps you think about how flexible
Rust in Chromium actually is.
Some things to try:
@ -40,18 +40,18 @@ Some things to try:
## Part three
Now you understand the strengths and limitations of cxx interop, think of
Now you understand the strengths and limitations of CXX interop, think of
a couple of use-cases for Rust in Chromium where the interface would be
sufficiently simple. Sketch how you might define that interface.
## Where to find help
* The [cxx binding reference][1]
* The [`cxx` binding reference][1]
* The [`rust_static_library` gn template][2]
<details>
As students explore Part Two, they're bound to have lots of questions about how
to achieve these things, and also how cxx works behind the scenes.
to achieve these things, and also how CXX works behind the scenes.
Some of the questions you may encounter:
* I'm seeing a problem initializing a variable of type X with type Y, where
@ -60,8 +60,8 @@ Some of the questions you may encounter:
`cxx::bridge`.
* I seem to be able to freely convert C++ references into Rust references.
Doesn't that risk UB?
For cxx's _opaque_ types, no, because they are zero-sized. For cxx trivial types
yes, it's _possible_ to cause UB, although cxx's design makes it quite
For CXX's _opaque_ types, no, because they are zero-sized. For CXX trivial types
yes, it's _possible_ to cause UB, although CXX's design makes it quite
difficult to craft such an example.
</details>