Skip to content

deduplicate pointer docs with include! #139190

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

Open
lolbinarycat opened this issue Mar 31, 2025 · 0 comments
Open

deduplicate pointer docs with include! #139190

lolbinarycat opened this issue Mar 31, 2025 · 0 comments
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-technical-debt Area: Internal cleanup work T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@lolbinarycat
Copy link
Contributor

A lot of the functions in const_ptr and mut_ptr are functionally the same with nearly identical documentation.

Currently, the docs are simply duplicated across both functions, but this can cause issues, such docs getting out of sync, or even functions having identical documentation despite having different safety invariants.

I think we should use the #[doc = include!("file.md")] pattern here, similar to what is done with the c ffi types.

@lolbinarycat lolbinarycat added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Mar 31, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 31, 2025
@lolbinarycat lolbinarycat self-assigned this Apr 28, 2025
@jieyouxu jieyouxu added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 30, 2025
@lolbinarycat lolbinarycat added the A-technical-debt Area: Internal cleanup work label May 26, 2025
lolbinarycat added a commit to lolbinarycat/rust that referenced this issue May 26, 2025
this also cleans up two inconsistancies:
1. both doctests on the ::add methods were
   actually calling the const version.
2. on of the ::offset methods was missing
   a line of clarification.

part of rust-lang#139190
lolbinarycat added a commit to lolbinarycat/rust that referenced this issue May 26, 2025
this also cleans up two inconsistancies:
1. both doctests on the ::add methods were
   actually calling the const version.
2. on of the ::offset methods was missing
   a line of clarification.

part of rust-lang#139190
lolbinarycat added a commit to lolbinarycat/rust that referenced this issue May 26, 2025
this also cleans up two inconsistancies:
1. both doctests on the ::add methods were
   actually calling the const version.
2. on of the ::offset methods was missing
   a line of clarification.

part of rust-lang#139190
lolbinarycat added a commit to lolbinarycat/rust that referenced this issue May 26, 2025
this also cleans up two inconsistancies:
1. both doctests on the ::add methods were
   actually calling the const version.
2. on of the ::offset methods was missing
   a line of clarification.

part of rust-lang#139190
workingjubilee added a commit to workingjubilee/rustc that referenced this issue May 30, 2025
…39190, r=workingjubilee

core: begin deduplicating pointer docs

this also cleans up two inconsistancies:
1. both doctests on the ::add methods were actually calling the const version.
2. on of the ::offset methods was missing a line of clarification.

part of rust-lang#139190
workingjubilee added a commit to workingjubilee/rustc that referenced this issue May 30, 2025
…39190, r=workingjubilee

core: begin deduplicating pointer docs

this also cleans up two inconsistancies:
1. both doctests on the ::add methods were actually calling the const version.
2. on of the ::offset methods was missing a line of clarification.

part of rust-lang#139190
rust-timer added a commit that referenced this issue May 31, 2025
Rollup merge of #141609 - lolbinarycat:core-dedup-ptr-docs-139190, r=workingjubilee

core: begin deduplicating pointer docs

this also cleans up two inconsistancies:
1. both doctests on the ::add methods were actually calling the const version.
2. on of the ::offset methods was missing a line of clarification.

part of #139190
github-actions bot pushed a commit to rust-lang/miri that referenced this issue May 31, 2025
…workingjubilee

core: begin deduplicating pointer docs

this also cleans up two inconsistancies:
1. both doctests on the ::add methods were actually calling the const version.
2. on of the ::offset methods was missing a line of clarification.

part of rust-lang/rust#139190
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this issue Jun 3, 2025
this also cleans up two inconsistancies:
1. both doctests on the ::add methods were
   actually calling the const version.
2. on of the ::offset methods was missing
   a line of clarification.

part of rust-lang#139190
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this issue Jun 3, 2025
…39190, r=workingjubilee

core: begin deduplicating pointer docs

this also cleans up two inconsistancies:
1. both doctests on the ::add methods were actually calling the const version.
2. on of the ::offset methods was missing a line of clarification.

part of rust-lang#139190
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-technical-debt Area: Internal cleanup work T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants