feat(symbols): normalize associated Rust functions - #596
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Tip
Everything holds: the producer emits exactly the documented free, inherent, and trait function records, and every gate passes.
Verified against the tree and real runs on head ed34898:
- Real-data counts on amiss-wire rustdoc JSON (format-61 patched from the toolchain's 57): 62 free, 156 inherent, 1 trait record — matches the PR body.
- Key namespaces
fn/,inherent-fn/,trait-fn/; set renamed tolocal-function-declarations; no stalelocal-free-functionsreference remains anywhere in the tree. - A private-module function, struct, and trait re-exported with
pub userecord under the alias path only (fn/reexp::secret,inherent-fn/reexp::Widget::new), as documented. pub(crate)and#[doc(hidden)]methods are excluded; trait methods always share trait visibility (E0449), so the method-side visibility omission in the trait query is sound.- Generic,
const,async,unsafe, andextern "C"/extern "C-unwind"signatures all normalize and parse throughrecord(); two specialized impls exposing the same owner+method refuse withError::Ambiguous. - Gates:
cargo nextest run --workspace --locked1627 passed / 5 skipped;cargo clippy --workspace --all-targets --locked -- -D warningsclean;check --profile enforceon the head exits 0.
Session details
run — cargo nextest run --workspace --locked, cargo clippy --workspace --all-targets --locked -- -D warnings, cargo run -p amiss -- check --repo . --object-format sha1 --base HEAD --index --profile enforce, and the amiss-rust-public-api producer run against real amiss-wire rustdoc JSON plus four probe crates (re-export, visibility, ABI, generic/trait edge cases) through the pinned trustfall-rustdoc-adapter v61.0.1
Outcome
Extends the isolated Rustdoc producer from public free functions to one explicitly scoped set of root-crate public function declarations:
The same pinned trustfall Rustdoc adapter owns public visibility, paths, and signatures. No second normalizer, syntax parser, process, network path, or controller/provider dependency is added.
The set name moves from local-free-functions to local-function-declarations so completeness remains truthful. Trait implementation bodies and dependency-defined functions remain out of scope. Duplicate owner/method identities, including specialized inherent implementations without a stable adapter identity, fail closed instead of borrowing Rustdoc numeric IDs or rendered syntax.
Real-data checks
On format-61 Rustdoc for amiss-wire, the producer retained the existing 62 free-function records and added 156 inherent plus 1 trait declaration. A separate private-module fixture proved that re-exported owners use only their public aliases and that private inherent functions are omitted.
Five release runs completed in 68.11–72.06 ms with 22,712–23,040 KiB peak RSS. D01a measured 35.5 ms and 22.1 MiB, so the two added adapter queries roughly double CPU time while memory remains effectively flat and total latency stays below 0.1 seconds.
Validation
Summary by cubic
Extends the Rustdoc semantic-evidence producer from public free functions to also normalize public inherent functions and trait declarations, so root-crate function declarations form one complete record set.
Behavior
fn/keys; inherent and trait functions useinherent-fn/andtrait-fn/owner-path keys, with local public aliases keeping the adapter-owned path.local-free-functionstolocal-function-declarations.Validation
cargo nextest run --workspace --lockedpasses 1,627 tests; clippy and fuzz checks pass.amiss-wire, the producer kept 62 free-function records and added 156 inherent plus 1 trait declaration.Written for commit ed34898. Summary will update on new commits.