1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-26 18:51:00 +02:00

Merge pull request #159 from fbornhofen/speaker-notes

Speaker notes: cosmetic fixes for compund-types.md, borrowing.md
This commit is contained in:
Martin Geisler
2023-01-12 11:38:43 +01:00
committed by GitHub
2 changed files with 10 additions and 8 deletions

View File

@ -45,6 +45,6 @@ Tuples:
* Tuples group together values of different types into a compound type. * Tuples group together values of different types into a compound type.
*Fields that can be accessed by the period and the index of the value, e.g. t.0, t.1. * Fields that can be accessed by the period and the index of the value, e.g. `t.0`, `t.1`.
</details> </details>

View File

@ -25,7 +25,7 @@ fn main() {
<details> <details>
Notes on stack returns: Notes on stack returns:
* Demonstrate that the return from `add` is cheap because the compiler can eliminate the copy operation. Change the above code to print stack addresses and run it on the [Playground](https://play.rust-lang.org/). In the "DEBUG" optimization level, the addresses should change, while the stay the same when changning to the "RELEASE" setting: * Demonstrate that the return from `add` is cheap because the compiler can eliminate the copy operation. Change the above code to print stack addresses and run it on the [Playground]. In the "DEBUG" optimization level, the addresses should change, while the stay the same when changing to the "RELEASE" setting:
```rust,editable ```rust,editable
#[derive(Debug)] #[derive(Debug)]
@ -49,3 +49,5 @@ Notes on stack returns:
* In C++, copy elision has to be defined in the language specification because constructors can have side effects. In Rust, this is not an issue at all. * In C++, copy elision has to be defined in the language specification because constructors can have side effects. In Rust, this is not an issue at all.
</details> </details>
[Playground]: https://play.rust-lang.org/