Files
codegraph/__tests__
Colby MchenryandClaude Opus 5.5 7324faf69f fix(rust): a call on a field of self reaches the method of the field's declared type (#2719)
A Rust `self.field.m()` call was resolved by the last segment of the
field's type name alone. `inner: multer::Field` linked to axum's own
`Field::name`, `std: std::time::Instant` to tokio's `Instant` (the calling
method itself), `inner: std::sync::Mutex<…>` to tokio's loom mock or async
`Mutex::lock`, and a field generic over the impl's `S: Store` to nothing.

The field's type is now read the way field values already are: from the
struct's declaration, through the wrappers, by the `use`s of the
struct's file. A struct's own parameter is known by the bounds that the
impl around the call gives the parameter it is instantiated with
(`struct Worker<S>` under `impl<S: Store> Worker<S>`). The method is the
one the typed receiver path picks. The plain-name reading stays only
where the field's type can't be read.

A call on a std or dependency value reaches a project trait's impl for
its type only when the impl is for that type. tokio's `impl Kill for
Child` in process/windows.rs is for its own `struct Child`, not
`std::process::Child`. The impl's type is read as the impl writes it:
gleam's `impl LowestVersion for pubgrub::Range<Version>` is for pubgrub's
`Range`.

A/B with fresh indexes against main on axum, serde, ripgrep, clap, dioxus,
tokio and gleam, every changed edge triaged: 361 calls linked that were
not (fields bounded by the impl's traits, dioxus's signal fields, trait
objects), 104 removed (calls on std and dependency fields, and 5 on tokio
values whose methods sit inside `cfg_*!` macros), 59 moved to the right
type of a shared name, 2,844 kept at a higher confidence; 62
fewer self-loops and none added. gin, serilog, flask and express are
byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 23:04:17 +00:00
..