Repository navigation
fix(rust): name the trait-dispatch ambiguity for a helper called from implicit-dispatch trait impls (#11719) - #11804
Conversation
… implicit-dispatch trait impls (#11719) A no_static_path finding whose owner is called from an `impl Trait for X` method with an implicit-dispatch name (fmt, eq, ...) that the crate implements more than once now names a rust_transitive_reach_unresolved limitation with the calling impls as bounded candidates. Class, reach, related tests and actionability are unchanged; no runtime claim. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzVWk9FoK366FfhytUg
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 36 minutes. View limit details
|
…-claim (#11719) A #[cfg(test)] impl block no longer counts as an impl or a caller (read through the shared cfg_predicates authority). Pin inherent fmt and the Self::pad call form. The evidence now says ripr cannot tell whether any test reaches one of these impls. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzVWk9FoK366FfhytUg
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- The ambiguity pointer says the owner is called from multiple impls even though the implementation may select one calling impl.
Verification questions
- Confirm the ambiguity candidate list includes only calling impls, while the unresolved-edge line says the test may reach any of all same-named trait impls.
- Confirm direct calls from production trait impls are matched by owner name, while cfg(test) trait impls and inherent methods are excluded.
- Confirm the implementation requires at least two impls of the implicit-dispatch method and at least one direct caller, which differs from the issue's literal two-caller wording.
- Confirm the implementation admits a single calling impl when the crate has multiple same-named trait impls, whereas the specification says the owner is called from “several impls” and the comment describes a “several impls” case.
- Confirm the new rule intentionally differs from the issue’s literal '2+ calling trait-impl methods' wording by requiring 2+ implementations of the implicit-dispatch name and at least one caller.
Refuted
- The implementation and docs intentionally differ from the issue's literal two-or-more-calling-impl rule by allowing one caller among multiple same-named trait impls.
Parked follow-ups
- Only direct non-macro calls from same-named trait impls are recognized, so indirect helper chains do not produce this limitation.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The packet has no completed cargo-test receipt, despite Rust behavior and tests being changed.
|
Review of record, head Angles: correctness, tests, spec/contract, perf/security.
Finding (non-blocking, hosted CI decides): the PR body says the full precommit was not rerun after the follow-up commit, so Merge is gated on a green Generated by Claude Code |
Requested by Steven · project thread
Governing issue or accepted claim: #11719
Acceptance delta (one sentence): a helper called from implicit-dispatch trait impls (dtolnay/semver
display::pad) reads a named trait-dispatch ambiguity limitation instead of a bare "no related test was found".Summary
no_static_pathfinding whose owner is called from animpl Trait for Xmethod with an implicit-dispatch name (fmt,eq, ...) that the crate implements more than once now carries arust_transitive_reach_unresolvedlimitation naming the trait-dispatch ambiguity, with the calling impls as bounded candidates.no_static_path), reach (no), related tests and actionability are unchanged; no runtime claim. It is the last arm of the witness chain, after the proof-harness arm, so no traced or structural witness is displaced.#[cfg(test)]impl block is neither an impl nor a caller (read viacfg_predicates::attribute_requires_test); inherentfmtmethods do not count;Self::pad(..)reads the same as a plain call (pinned); the non-claim now reads "cannot tell whether any test reaches one of these impls".Governing issue acceptance was amended in an issue comment on #11719.
End-to-end: dtolnay/semver
pad(len >= min_width->len > min_width),ripr check --format human-fullMeasured on the first commit (2c48952); the follow-up commit only rewords one sentence and excludes cfg(test) impls, which semver does not have.
Before (main 8f0e1b0):
no_static_path (warning, confidence 0.48),reach no,infection unknown: No tests were found, ..., no Static limitation block, agap idline.After: still
no_static_path (warning, confidence 0.48),reach no. AddedStatic limitation: rust_transitive_reach_unresolved,last established edge: trait-impl method fmt (Version) -> owner pad,first unresolved edge: test -> one of 13 fmt impls ...,non-claim: named limitation only, and the evidence line "ownerpadis called from 1 impl offmt(Version), one of 13fmtimpls in this crate".Rule as shipped: fires with >= 2 production same-named trait impls in the crate and >= 1 calling impl (semver
padhas exactly one caller), only onno_static_pathfindings with no other witness and at least one crate test. This differs from the issue's literal "2+ calling impls" text, amended in the issue comment. Thegap id (for scripts)line is absent after the change (limited findings drop it, as with the other static-limit kinds).Proof at head ea0b5c8 (exit codes; flock on every cargo command, CARGO_INCREMENTAL=0)
All exit 0:
cargo test -p ripr --lib proximity_reach(40 passed),--lib transitive_reach(96 passed)cargo fmt --checkcargo xtask goldens check(aftergoldens prepare),cargo xtask fixturescargo clippy -p ripr --all-targets -- -D warningscheck-doc-artifacts,check-traceability,check-output-contracts,check-no-panic-family,check-rust-source-role-authority(main's red state fixed by fix(repair): unbreak main after #11596 (role-authority sniff, stale refusal assertions) #11734, merged into this branch)New negatives: cfg(test)-only impl, inherent
fmt(both and mixed),Self::padcall form equal to the plain call.Independent read-only review of head 2c48952 found no blockers; its follow-ups are in ea0b5c8.
Not run
cargo xtask precommitafter the follow-up,check-pr, dogfood, workspace-wide tests.🤖 Generated with Claude Code
https://claude.ai/code/session_01YVdGzVWk9FoK366FfhytUg