Rust: a .method() call binds to an associated fn with no self (tier3 import-key edge) — 32 of PoolAdmit::prepare's 35 callers are rusqlite conn.prepare(sql) #378
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#378
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?
Found dogfooding v0.38.0 (
4ab97367) on this repo.Observed
find_callers(PoolAdmit::prepare)(crates/indexer/src/capabilities.rs:748) reportstotal_resolved: 35.method_calls such astx.prepare(&format!(…))(index/constant_lookup.rs:858) andconn.prepare("SELECT …")(tests/generation_promotion.rs:1116,mcp-server/src/server.rs:8505). Every one is rusqlite'sConnection::prepare.resolved_by: tier3_import_boost. The filesuse crate::capabilities::PoolAdmit, so the import-key edge makesPoolAdmit's members candidates for anyx.prepare().PoolAdmit::prepare(…)path calls (tier1q_pass1) are correct.change_impactonPoolAdmit::prepareis inflated by these phantom edges.Why it is wrong by construction
pub fn prepare(conn: &Connection, target: PoolGeneration) -> Result<Self, …>has noselfreceiver. In Rust, method syntaxx.f()can only call a function whose first parameter isself,&self,&mut selforself: …. So nomethod_callcan be a call to it, whatever the receiver is.Not covered elsewhere
recv_proof::CAPTURED). rust-ripgrep'sdir.create(..)×334 throughuse crate::util::Dirare correct binds and must stay.Direction
method_callwhose receiver is notselforSelfbinds only to a receiver-taking candidate, in the languages whose dot syntax requires an instance. That is Rust for certain.Type.staticMethod()with the type itself as the receiver, so for them the gate is not sound without knowing the receiver. Measure before extending.resolved_by). Report every lost bind and read it at source.Tool gap
No MCP tool can answer "how many binds of rule X land on a candidate of shape Y", so this class could not be sized through our own tools.
Released in v0.39.0 (PR #386,
25a45918).de.h-dv.rust0.1.4.find_callers/find_references, and out ofsame_name_unresolvedincheck_rename/safe_delete. Those two shipsame_name_shape_excludedonly where a proof applies.PoolAdmit::prepare: 35 resolved callers → the 3 real ones.Follow-ups (macros recorded as calls, bare calls vs impl members) are tracked in #385.