Skip to content

docs(llvm-export): a rustdoc error the docs gate cannot see - #1070

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/two-more-private-doc-links
Aug 20, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/two-more-private-doc-links

Conversation

@vyncint

@vyncint vyncint commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

The docs gate runs cargo doc without --document-private-items, so it never renders a private item and never checks the intra-doc links in one. #1014 and #1042 cleaned cuda-macros, mir-importer/statement.rs and the codegen backend's collector; this is one of the four that were left:

error: unresolved link to `classify_op`
  --> crates/llvm-export/src/export/ops.rs:55

classify_op is a macro_rules! defined further down the same file, at :138. A macro_rules! macro is in scope only textually after its definition unless it is exported, so no path resolves from a doc comment above it — rustdoc says as much: "macro_rules named classify_op exists in this crate, but it is not in scope at this link's location". It becomes a plain code span, and since the sentence is one step of a four-step contract about this file, it gains "below" so the reference still points somewhere.

Scope

Three of the four remain, and all three are in files under open pull requests, so they are left rather than raced:

error file open PRs
make_disjoint_slice_struct mir-lower/src/convert/ops/aggregate.rs #1062, #1064
MirFieldAddrOp mir-importer/src/translator/rvalue.rs #1059, #1062
MirArrayElementAddrOp same same

The first needs only a crate::convert::types:: prefix; I had it ready and dropped it when #1062 and #1064 appeared on that file mid-change. --document-private-items can join the docs gate once they land.

Verified: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items -p llvm-export reports one unresolved link on main and none with this change. The gate's own invocation passes before and after. fmt clean.

Comment-only change.

The docs gate runs `cargo doc` without `--document-private-items`, so it never
renders a private item and never checks the intra-doc links in one. NVIDIA#1014 and
NVIDIA#1042 cleaned `cuda-macros`, `mir-importer/statement.rs` and the codegen
backend's collector; this is one of the four that were left:

    error: unresolved link to `classify_op`
      --> crates/llvm-export/src/export/ops.rs:55

`classify_op` is a `macro_rules!` defined further down the same file, at :138.
A `macro_rules!` macro is in scope only textually after its definition unless
it is exported, so no path resolves from a doc comment above it -- rustdoc says
as much: "`macro_rules` named `classify_op` exists in this crate, but it is not
in scope at this link's location". It becomes a plain code span, and since the
sentence is one step of a four-step contract about this file, it gains "below"
so the reference still points somewhere.

Three of the four remain. One is `make_disjoint_slice_struct` in
`mir-lower/src/convert/ops/aggregate.rs`, which needs only a
`crate::convert::types::` prefix; the other two are `MirFieldAddrOp` and
`MirArrayElementAddrOp` in `mir-importer/src/translator/rvalue.rs`. Both files
are under open pull requests (NVIDIA#1062 and NVIDIA#1064 for the first, NVIDIA#1059 and NVIDIA#1062
for the second), so they are left rather than raced.
`--document-private-items` can join the docs gate once they land.

Verified: `RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
--document-private-items -p llvm-export` reports one unresolved link on `main`
and none with this change. The gate's own invocation passes before and after.
fmt clean.

Comment-only change.

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added documentation Improvements or additions to documentation llvm-export Textual LLVM/NVVM IR exporter (llvm-export crate) labels Aug 20, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

@nihalpasham
nihalpasham merged commit 8fdb16b into NVIDIA:main Aug 20, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation llvm-export Textual LLVM/NVVM IR exporter (llvm-export crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants