-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Improve documentation of std::ptr::NonNull #48929
Comments
worth mentioning that the nomicon has a section on covriance: https://doc.rust-lang.org/beta/nomicon/subtyping.html |
One question I have that I'd love to be explicitly answered: Does The Nomicon says "If |
Other issues: #52978 |
The documentation of the
Did I miss anything? |
That sounds reasonable, I cannot think of anything else of the top of my head. I would combine the last two points though:
|
Add safety section to `NonNull::as_*` method docs This basically adds the safety section of `*mut T::as_{ref,mut}` to the same methods on `NonNull` with minor modifications to fit the differences. Part of rust-lang#48929.
There have been several changes to this since this issue was created, and this should satisfy this issue. There is scope for more but a newer issue would be better than this one being buried deep in the issue tracker. |
This type used to be experimental and internal (when it was called
Shared
), now that it is finally being stablized (see #27730, #47631), people are complaining that the current document texts are not easy to understand.Current text
*mut T but non-zero and covariant.
talks about the covariance, which is not mentioned elsewhere in thelibstd
docs and the Rust books. (I know it's mentioned in Nomicon but beginners seldom have read it.)I suggest the docs be either supplemented with concrete explanations or reworked upon.
The text was updated successfully, but these errors were encountered: