Skip to content

Subpar documentation for ptr-to-ref conversion methods #124669

Open
@GrigorenkoPV

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 1
  • <*mut T>::as_ref_unchecked 1
  • <*mut T>::as_mut_unchecked 1
  • <*const T>::as_uninit_ref 2
  • <*mut T>::as_uninit_ref 2
  • <*mut T>::as_uninit_mut 2

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:

Footnotes

  1. Not yet stabilized (Tracking Issue for raw-pointer-to-reference conversion methods #122034) 2 3

  2. Not yet stabilized (Tracking Issue for pointer methods returning MaybeUninit<T> #75402) 2 3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsA-doctestsArea: Documentation tests, run by rustdocC-discussionCategory: Discussion or questions that doesn't represent real issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions