Skip to content

Rust self calls are missing across files for simple generic impls #3652

Description

@oleksii-tumanov

Problem

Rust self.method() calls still disappear across files when inherent impl blocks belong to the same generic type but use different parameter names.

// lib.rs
mod state;
mod read;
mod run;

// state.rs
pub struct Bucket<T> { value: T }

// read.rs
use crate::state::Bucket;

impl<T> Bucket<T> {
    pub fn fetch_value(&self) {}
}

// run.rs
use crate::state::Bucket;

impl<U> Bucket<U> {
    pub fn run(&self) {
        self.fetch_value();
    }
}

On v8 at 26b02b5e3430e4ab85dd7e72c7b98836d8e65c48, Graphify extracts both methods and the unresolved self.fetch_value() call, but emits no calls edge from run to fetch_value. The non-generic split-impl case from #2234, fixed by #3602, does resolve.

This leaves dependency and blast-radius queries incomplete for generic Rust types whose methods are split across impl blocks.

Expected behavior

The call should resolve when the impls are simple, unbounded, inherent, alpha-equivalent generics. Ambiguous or more complex shapes, such as trait impls, bounded generics, where clauses, lifetimes, const generics, and concrete or nested arguments, should remain unresolved rather than guess.

Reproduction

Create the four files above in a small Rust crate and run:

graphify update . --no-cluster

The graph contains both method nodes but no calls edge between them. The same result occurs on a cold full extraction, before incremental cache replay is involved.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions