Repository navigation
Conversation
Scan each trait default body as one source body with defaultMethod context, reuse receiver typing, and leave Self-dependent dispatch unresolved. This retrieves bytes@c08f876 src/buf/buf_impl.rs:2374 and raises the fixed sample from 2/3 to 3/3 without duplicating calls per implementing type.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Record a source-first case from rust-base64 d021c39 where the modified Engine::decode default body has eight calls. Score v5 with its source-range flow and v6 with defaultMethod context; the candidate recovers all eight calls, verifies two trait targets, and retains six unknowns without a wrong target.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A maintainer investigating the
BytesMut::putchange atbytes@c08f876needssrc/buf/buf_impl.rs:2374back from the normal CLI, with the enclosing trait default method and the target implementation visible.Rust
rust-source-direct-v6/ adapter revision 6 inventories each trait default method body once per source declaration. Calls in that body carrydefaultMethodcontext (file,name,qualname,line,column,trait) and reuse the existing receiver typing:2374resolves tosrc/bytes_mut.rs:1300:5.Selfremain unresolved.Baseline reproduction at
7d228fb5c(rust-source-direct-v5) is 2/3. Candidate v6 is 3/3.Results
ret.put(&mut self.a)src/buf/chain.rs:184:13-184:33src/bytes_mut.rs:1300:5BufMutBytesMutret.put((&mut self.b).take(...))src/buf/chain.rs:185:13-185:53src/bytes_mut.rs:1300:5BufMutBytesMutret.put(self.take(len))src/buf/buf_impl.rs:2374:9-2374:32src/bytes_mut.rs:1300:5BufMutBuf::copy_to_bytes(src/buf/buf_impl.rs:2363:8)BytesMutkvs.into_kvs()src/__private_api.rs:101:9-101:23src/__private_api.rs:17:12KVsBytes fixed-sample improvement: 2/3 -> 3/3. The log candidate remains 1/1 and does not claim an implementation. Per-call target ends remain unverified because the CLI does not expose them.
Boundaries and retained sample
Buf::copy_to_slice(src/buf/buf_impl.rs:299), was frozen insource-first.jsonbefore the candidate run.self.try_copy_to_slice(dst)at300:9-300:36is captured once withdefaultMethodcontext and staysunresolved(rust-trait-or-method-dispatch) becauseSelfis concrete-only.panic_advance(&error)at301:37-301:58is captured once with the same context and resolves tosrc/lib.rs:206.impl Buftypes do not duplicate either call.Verification
npm --prefix archify run test:code-analysis: 418 pass, 0 fail.run.pyexits 0; bytes 3/3, log candidate 1/1, retained default body correct.archify.zip(43e22e75…, 405 files) produces the identical normalized result.Reproduction
evidence/baseline-summary.jsonis the v5 2/3 run;evidence/summary.jsonis the v6 3/3 source run;evidence/zip.jsonis the unpacked-ZIP run.New-repository default-body evaluation
A separate, previously unused Rust case evaluates a real change to a trait default body:
marshallpierce/rust-base64; base1e8246a, headd021c39(Optimize generic functions); modified methodEngine::decode(src/engine/mod.rs:246).Engine::internal_decoded_len_estimate:66,Engine::internal_decode:91), 6 unknowns retained, 0 wrong targets, 0 missed.innertarget remains an explicit target-identity gap, not a wrong implementation.--baseline-clipath nor its zero-reference assumption. v5 is scored by source-range containment; v6 bydefaultMethodcontext. Seebenchmarks/code-analysis-rust-default-body-eval/run.py.Final commit and CI
Final head:
ba24b046d7e36ed25337fa0ea114daf83de49c9d(test(code-analysis): evaluate Rust default-body calls on base64), branched from7d228fb5c849c370b09ae2d1a2d315b1c9e01ee4.a4c0e6721(feat(rust): inventory trait default method bodies once): run 42475803613, attempt 1 success, 19 successful jobs;deploy-pagesanddeploy-cloudflareskipped by policy.77cecd0ca: run 42476406957, attempt 1 success, 19 successful jobs; the same two deploy jobs skipped by policy.ba24b046d: run 42477760230, attempt 1 success, 19 successful jobs; the same two deploy jobs skipped by policy.Limits
Local captured traits and impls only; external, blanket, supertrait and macro-generated impls remain unknown. Calls in default bodies that require the concrete
Self, fields or chained receivers remain unresolved. No compiler, runtime or complete-impact proof is claimed.Draft only. Base is the #1286 source branch
codex/rust-trait-change-investigation. No merge, nolabs/code-analysisupdate, no installation.