From b372cea91f131d1c4b6e838a2b1f9e6decb45cae Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Mon, 7 Aug 2023 20:23:04 +0200 Subject: [PATCH] Clarify the "achieves nothing" statement by properly scoping it to dropck shenanigans --- src/phantom-data.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/phantom-data.md b/src/phantom-data.md index 1cfd38f..c82859e 100644 --- a/src/phantom-data.md +++ b/src/phantom-data.md @@ -106,7 +106,9 @@ that that `Vec` _owns_ values of type `T` (more precisely: may use values of in its `Drop` implementation), and Rust will thus not allow them to _dangle_ should a `Vec` be dropped. -**Adding an extra `_owns_T: PhantomData` field is thus _superfluous_ and accomplishes nothing**. +When a type already has a `Drop impl`, **adding an extra `_owns_T: PhantomData` field +is thus _superfluous_ and accomplishes nothing**, dropck-wise (it still affects variance +and auto-traits). ___