Skip to content

Document the contextual keyword raw #134447

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
CrazyboyQCD opened this issue Dec 18, 2024 · 5 comments
Open

Document the contextual keyword raw #134447

CrazyboyQCD opened this issue Dec 18, 2024 · 5 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-raw-pointers Area: raw pointers, MaybeUninit, NonNull C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@CrazyboyQCD
Copy link

Related with #34601, #127679.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 18, 2024
@fmease fmease changed the title Document the raw keyword Document the contextual keyword raw Dec 18, 2024
@fmease fmease added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 18, 2024
@fmease
Copy link
Member

fmease commented Dec 18, 2024

While it would be straightforward to add a "keyword page" for raw by adding the following to library/std/src/keyword_docs.rs:

#[doc(keyword = "raw")]
/// ...
mod raw_keyword {}

I think ideally we want to mark it as a contextual keyword in some way and e.g., reflect that characteristic in the section header prefix.

@fmease
Copy link
Member

fmease commented Dec 18, 2024

However, we don't mark union specially either despite it being a contextual keyword, too. So I guess, take it away!

@fmease fmease added T-libs Relevant to the library team, which will review and decide on the PR/issue. A-raw-pointers Area: raw pointers, MaybeUninit, NonNull and removed T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 18, 2024
@fmease
Copy link
Member

fmease commented Dec 21, 2024

Only tangentially related: We should probably also document the Rust ≥2024 contextual keyword safe I just noticed.

@hkBst
Copy link
Member

hkBst commented Jan 20, 2025

Maybe raw could be integrated into https://doc.rust-lang.org/std/primitive.reference.html mostly by contrasting it with non-raw references?

@lolbinarycat lolbinarycat added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 11, 2025
@lolbinarycat
Copy link
Contributor

adding T-rustdoc as that's where a "this is a contextual keyword" would need to be supported.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-raw-pointers Area: raw pointers, MaybeUninit, NonNull C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants