Location
https://doc.rust-lang.org/std/marker/struct.PhantomData.html#ownership-and-the-drop-check, via
|
/// `T` in very rare circumstances. This in turn has effects on the Rust compiler's [drop check] |
Summary
#103413 updated the documentation for PhantomData to say
Currently, adding a field of type PhantomData<T> indicates that your type owns data of type T in very rare circumstances.
I don't understand. How rare must these circumstances be for me to use PhantomData? What should I do if my type always owns data of type T?
I guess this is not what was meant, but I am finding it hard to figure out what the intention was and propose an improvement.
Possibly just remove the phrase "in very rare circumstances"?
Location
https://doc.rust-lang.org/std/marker/struct.PhantomData.html#ownership-and-the-drop-check, via
rust/library/core/src/marker.rs
Line 728 in 21e6de7
Summary
#103413 updated the documentation for
PhantomDatato sayI don't understand. How rare must these circumstances be for me to use
PhantomData? What should I do if my type always owns data of typeT?I guess this is not what was meant, but I am finding it hard to figure out what the intention was and propose an improvement.
Possibly just remove the phrase "in very rare circumstances"?