From df546430785f3aa74deeaf5c1bb4ddd155f6a84c Mon Sep 17 00:00:00 2001 From: qubit Date: Sat, 29 Nov 2025 16:36:32 +0800 Subject: [PATCH] data-types: fix explanation for struct cannot contain itself The Box, not the Option, is what makes this able to work since the Box is the pointer indirection needed to make the memory layout of the struct well-defined --- data-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-types.md b/data-types.md index 5b851da..5f06111 100644 --- a/data-types.md +++ b/data-types.md @@ -66,7 +66,7 @@ struct R { } ``` -If we didn't have the `Option` in the above struct, there would be no way to +If we didn't have the `Box` in the above struct, there would be no way to instantiate the struct and Rust would signal an error. Structs with no fields do not use braces in either their definition or literal