rust-lang / rust-lang/rust

Subpar documentation for ptr-to-ref conversion methods

Open
#124,669 8 comments 0 reactions 1 assignee View on GitHub

@lolbinarycat is already working on this.

Since Jun 9, 2024.

A-docs A-doctests C-discussion C-enhancement E-help-wanted T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

While trying to merge #122492, some issues with the existing documentation became apparent.

The methods in question

  • <*const T>::as_ref
  • <*mut T>::as_ref
  • <*mut T>::as_mut
  • <*const T>::as_ref_unchecked [^unchecked]
  • <*mut T>::as_ref_unchecked [^unchecked]
  • <*mut T>::as_mut_unchecked [^unchecked]
  • <*const T>::as_uninit_ref [^uninit]
  • <*mut T>::as_uninit_ref [^uninit]
  • <*mut T>::as_uninit_mut [^uninit]

[^unchecked]: Not yet stabilized (#122034)
[^uninit]: Not yet stabilized (#75402)

The problems

  • The overarching pain-point is that big parts of documentation are repeated for all (or at least the most) of the methods, which makes it difficult to keep the wording in sync.
Documentation
Doctests

Moving forward

Feel free to voice your opinions/wishes/suggestions/questions regarding this issue or to submit PRs addressing any of the problems above (not necessarily all at once). Also, doctests can probably be worked on independently from the documentation itself.

Beep-Boop

@rustbot label +A-docs +A-doctests +C-discussion +C-enhancement +E-help-wanted

And now footnotes:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.