mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-05 00:57:29 +02:00
parent
ba28dd2d4c
commit
ff66258c50
@ -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]. In the "DEBUG" optimization level, the addresses should change, while the stay the same when changing 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 they stay the same when changing to the "RELEASE" setting:
|
||||||
|
|
||||||
```rust,editable
|
```rust,editable
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user