Rollup merge of #30115 - nilcons-contrib:fix-book-stack, r=steveklabnik

The `f` argument will reference the actual value in the `d` box, not the box in the `bar`'s stack frame.

I am just learning Rust, so I don't know how to explain this well, but just from `f`'s type it is clear that it will be a pointer to an `i32`, not a pointer to a pointer. Some `println!("{:p}", ...)`'s can easily confirm this.

I would actually suggest to remove/simplify this part of the example. This is a subtle issue that can easily confuse people at the early stages of familiarizing with the language. (As I got confused by it. :))
This commit is contained in:
Steve Klabnik 2015-11-30 18:02:21 -05:00
commit 30221eaedf

View File

@ -464,7 +464,7 @@ At the end of `bar()`, it calls `baz()`:
| (2<sup>30</sup>) - 2 | | 5 |
| ... | ... | ... |
| 12 | g | 100 |
| 11 | f | → 9 |
| 11 | f | → (2<sup>30</sup>) - 2 |
| 10 | e | → 9 |
| 9 | d | → (2<sup>30</sup>) - 2 |
| 8 | c | 5 |