Rust: V::Value with a generic parameter V binds to a function-local struct V in another crate #579
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#579
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observed
Release v0.41.50, this repository indexed as its own project.
A test file declared a method with a type parameter named
V:crates/mcp-server/src/server.rshas a struct local to one function body:find_referenceson thattype Value(server.rs:5440) returned bothV::Valuesites of the test file asresolution: "resolved",qualifier: "V",resolved_by: "tier1q_pass1". They are wrong binds twice over:Vat the use site is a type parameter of the enclosing method, not a type;crates/indexer/tests/manifest_layering.rs::no_resolved_edge_crosses_an_undeclared_crate_boundarycaught it in the v0.41.51 full gate (crates/indexer -> crates/mcp-server (2 edge(s))), only because the two files are in crates with no declared dependency. The same bind inside one crate would pass that gate unseen.Effect
find_references,change_impact,review_diffreport a caller that does not exist, marked as resolved.What was done in v0.41.51
The test's type parameter was renamed (
V→Vis) so the tree is graded clean. Renaming it back reproduces the bind. The resolver is unchanged.Suggested mechanism (not yet measured)
Two independent rules, both generic:
Rule 1 is host-side and needs no package change. Either rule only removes binds, but it moves corpus counts, so it needs a bind account (which binds disappear, split by
resolved_by) before any baseline is touched.Tool gap noticed while attributing
No tool lists the resolved references going OUT of a file or symbol for kinds other than calls.
find_calleescoverscall/method_callonly, so the twotypereferences could be found only by guessing candidate target names withsearch_symbolsand runningfind_referenceson each.Merged into #531.
The fixture parameter was renamed V → Vis in crates/indexer/tests/configuration_reference.rs; the resolver is unchanged.
Remaining: Namespace and lexical identity. Outgoing non-call navigation is also in #521, Reference navigation.