Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhantomData confusing documentation #125540

Open
dimbleby opened this issue May 25, 2024 · 0 comments
Open

PhantomData confusing documentation #125540

dimbleby opened this issue May 25, 2024 · 0 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools

Comments

@dimbleby
Copy link

dimbleby commented May 25, 2024

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"?

@dimbleby dimbleby added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label May 25, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 25, 2024
@Nilstrieb Nilstrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants