From e9fce0417e78053f15c370ab1bb5d3f19e936829 Mon Sep 17 00:00:00 2001 From: Frances Wingerter <91758128+fw-immunant@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:29:11 +0000 Subject: [PATCH] box.md: clarify that box provides needed indirection (#2283) The last to-do for #64. --- src/smart-pointers/box.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smart-pointers/box.md b/src/smart-pointers/box.md index dbf91cd0..bed5b404 100644 --- a/src/smart-pointers/box.md +++ b/src/smart-pointers/box.md @@ -31,7 +31,8 @@ fn main() { [call methods from `T` directly on a `Box`](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)]