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

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

Open
1 of 16 tasks
GrigorenkoPV opened this issue May 3, 2024 · 4 comments
Open
1 of 16 tasks

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

GrigorenkoPV opened this issue May 3, 2024 · 4 comments
Assignees
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-doctests Area: Documentation tests, run by rustdoc C-discussion Category: Discussion or questions that doesn't represent real issues. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-help-wanted Call for participation: Help is requested to fix this issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@GrigorenkoPV
Copy link
Contributor

GrigorenkoPV commented May 3, 2024

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

@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-doctests Area: Documentation tests, run by rustdoc C-discussion Category: Discussion or questions that doesn't represent real issues. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-help-wanted Call for participation: Help is requested to fix this issue. labels May 3, 2024
@saethlin saethlin added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 11, 2024
@lolbinarycat
Copy link

@rustbot claim

i'll tackle normalizing the doctests first, since the wording of the pointer methods has implications for unsafe code guidelines.

workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 12, 2024
…=workingjubilee

docs(core): make more const_ptr doctests assert instead of printing

improves on rust-lang#124669
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 12, 2024
…=workingjubilee

docs(core): make more const_ptr doctests assert instead of printing

improves on rust-lang#124669
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 12, 2024
…=workingjubilee

docs(core): make more const_ptr doctests assert instead of printing

improves on rust-lang#124669
@bors bors closed this as completed in fe52b54 Jun 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 12, 2024
Rollup merge of rust-lang#126210 - lolbinarycat:ptr_doctest_assert, r=workingjubilee

docs(core): make more const_ptr doctests assert instead of printing

improves on rust-lang#124669
@GrigorenkoPV
Copy link
Contributor Author

@rustbot reopen

@GrigorenkoPV
Copy link
Contributor Author

Well, I'm powerless here. @rustbot knows how to close issues, but not how to reopen them. GitHub doesn't let me to reopen it myself. And @bors is very fond of marking issues as completed even when they aren't. #126210 addressed only one of the concerns (I've updated the OP to reflect this), but there's still a lot of work to be done.

@workingjubilee could you please help me in this and reopen the issue? Thanks!

@lolbinarycat
Copy link

whoops, yeah i should have said "part of" instead of "fixes", since my pr only addresses part of the issue, sorry about that (unfortunately i don't have the permissions to reopen issues either)

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 A-doctests Area: Documentation tests, run by rustdoc C-discussion Category: Discussion or questions that doesn't represent real issues. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-help-wanted Call for participation: Help is requested to fix this issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
Development

No branches or pull requests

5 participants