Skip to content

Document every public item in the cgp crates - #289

Merged
soareschen merged 6 commits into
mainfrom
docs/construct-rustdoc-core-extra
Nov 7, 2026
Merged

soareschen merged 6 commits into
mainfrom
docs/construct-rustdoc-core-extra

Conversation

@soareschen

Copy link
Copy Markdown
Collaborator

Overview

[deepseek-v4.1-flash] Every public item in the cgp workspace now carries a doc comment, and every crate enables #![warn(missing_docs)], so a new item cannot land undocumented. Each construct's doc states what the construct is for in one sentence, taken from its reference page, and links that page for the details.

Motivation

The crates' API docs on docs.rs were sparse, and the cgp README said so. The reference pages already explain each construct, so a brief doc that links the page keeps the two copies from drifting, and the lint keeps the docs from falling behind again.

Impact

The long per-item docs that restated the reference pages are replaced by the summary and the link. The lint is enabled on all 29 published crates, and the export_construct! and define_keyword! macros now emit a doc line for the structs they generate, so those need no #[allow(missing_docs)].

The cgp README's docs.rs note no longer says the per-item docs are still being filled in. It now says every public item carries a short doc, and each construct's doc links its reference page.

cargo doc with RUSTDOCFLAGS="-D warnings" passes for the workspace, and the 702 tests pass.

Every public item in the twelve core and extra crates now carries a doc
comment, and each crate enables `#![warn(missing_docs)]` so a new item cannot
land undocumented. The construct items keep a one- or two-sentence doc that
links the website reference page that owns the semantics, and the remaining
items get a short line.

The long per-item docs that restated the reference pages are replaced by the
link, so the two copies cannot drift.
Every public item in the twelve core and extra crates now carries a doc
comment, and each crate enables `#![warn(missing_docs)]` so a new item cannot
land undocumented. Each construct's doc states what the construct is for in
one sentence, taken from its reference page, and links that page for the
details.

The long per-item docs that restated the reference pages are replaced by the
summary and the link, so the two copies cannot drift.
Every public item in the nine macro crates now carries a doc comment, and each
crate enables `#![warn(missing_docs)]`. The AST types, parsers, and
code-generation helpers describe what they represent, and the generated
marker structs get a doc from the macro that emits them.

The `export_construct!` and `define_keyword!` macros now emit a doc line, so
the structs they generate no longer need an `#[allow(missing_docs)]`.
The five main crates and the three error backends now document every public
item and enable `#![warn(missing_docs)]`, so the whole workspace builds with
the lint on. The `cgp` README no longer says the per-item docs are still being
filled in, because every public item now carries a short doc that links its
reference page.
The review found three problems. A few structs kept a second, shorter doc
line after their existing doc, so the two read as one paragraph. The doc
comments sat after the attributes on 68 items, which is valid but reads
backwards. And the README's docs.rs note claimed every item links a reference
page, which only the construct items do.

The duplicate lines are removed, the doc comments now precede their
attributes, and the README says each construct's doc links its page.
@soareschen
soareschen marked this pull request as ready for review November 7, 2026 23:35
`DebugError` and `DisplayError` sit behind `cgp-error-extra`'s `alloc`
feature, so the default-feature build never compiled them and the lint never
saw them. The all-features clippy job does, and it failed on the two
undocumented structs.
@soareschen
soareschen merged commit 5317896 into main Nov 7, 2026
3 checks passed
@soareschen
soareschen deleted the docs/construct-rustdoc-core-extra branch November 7, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant