1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-22 21:53:06 +02:00

box.md: clarify that box provides needed indirection (#2283)

The last to-do for #64.
This commit is contained in:
Frances Wingerter 2024-08-13 14:29:11 +00:00 committed by GitHub
parent 3b349d830c
commit e9fce0417e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,7 +31,8 @@ fn main() {
[call methods
from `T` directly on a `Box<T>`](https://doc.rust-lang.org/std/ops/trait.Deref.html#more-on-deref-coercion).
Recursive data types or data types with dynamic sizes need to use a `Box`:
Recursive data types or data types with dynamic sizes cannot be stored inline
without a pointer indirection, which can be worked around using `Box`:
```rust,editable
#[derive(Debug)]