Skip to content

feat(symbols): normalize associated Rust functions - #596

Merged
HardMax71 merged 1 commit into
mainfrom
feat/rust-associated-function-records
Aug 29, 2026
Merged

feat(symbols): normalize associated Rust functions#596
HardMax71 merged 1 commit into
mainfrom
feat/rust-associated-function-records

Conversation

@HardMax71

@HardMax71 HardMax71 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Outcome

Extends the isolated Rustdoc producer from public free functions to one explicitly scoped set of root-crate public function declarations:

  • free functions use fn/ identities
  • public inherent functions use inherent-fn/ owner-path identities
  • public trait declarations use trait-fn/ owner-path identities
  • local public aliases remain the adapter-owned paths

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

  • cargo nextest run --workspace --locked: 1,627 passed, 5 skipped
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • fuzz release tests and strict fuzz clippy
  • staged amiss enforce scan
  • similarity gate: 108 base, 108 candidate
  • full pre-push hook suite

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

  • Free functions keep fn/ keys; inherent and trait functions use inherent-fn/ and trait-fn/ owner-path keys, with local public aliases keeping the adapter-owned path.
  • The context set name changes from local-free-functions to local-function-declarations.
  • Duplicate owner/method identities fail closed instead of borrowing Rustdoc numeric IDs or rendered syntax.
  • Trait implementation bodies and dependency-defined functions remain out of scope.
  • The same pinned Rustdoc adapter owns public visibility, paths, and signatures; no new normalizer, parser, process, network path, or controller/provider dependency is added.

Validation

  • cargo nextest run --workspace --locked passes 1,627 tests; clippy and fuzz checks pass.
  • On format-61 Rustdoc for 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.

Review in cubic

Copilot AI lite review requested due to automatic review settings August 29, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b825a531-86c7-4ef1-93f0-eb906d6dabeb


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@HardMax71
HardMax71 enabled auto-merge (rebase) August 29, 2026 19:26
@HardMax71
HardMax71 merged commit f16db53 into main Aug 29, 2026
21 checks passed
@HardMax71
HardMax71 deleted the feat/rust-associated-function-records branch August 29, 2026 19:26

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to local-function-declarations; no stale local-free-functions reference remains anywhere in the tree.
  • A private-module function, struct, and trait re-exported with pub use record 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, and extern "C"/extern "C-unwind" signatures all normalize and parse through record(); two specialized impls exposing the same owner+method refuse with Error::Ambiguous.
  • Gates: cargo nextest run --workspace --locked 1627 passed / 5 skipped; cargo clippy --workspace --all-targets --locked -- -D warnings clean; check --profile enforce on the head exits 0.
Session details

runcargo 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

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.

2 participants