Expand description
CrossCrate InlineTrait Phase 2c — caller crate scanner.
Given a target trait SymbolId, walks the workspace’s typeflow
graph for containers (functions / impl blocks / etc.) that
reference the trait, filters down to cross-crate callers (i.e.
containers living in a different crate from the trait), and
classifies each caller via the classify_fn helper from
ryo-mutations (Phase 2a+2b).
Each cross-crate caller produces a CallerRewrite entry listing
the CallerPattern variants the executor must apply during the
caller-side AST migration in Phase 2d:
Dot— post-inline dispatch is unchanged; no AST edit.Ufcs— rewrite<S as Trait>::m(..)→S::m(..).GenericBound— stripT: Traitgeneric param and specialize.DynDispatch— rewrite&dyn Trait→&S.Other— block inline (conservatively).
Phase 2c stops at the scan + classify boundary. The executor
does not rewrite caller crates yet; that engine arrives in Phase
2d, consuming the CallerRewrite entries produced here.
Structs§
- Caller
Rewrite - Per-caller rewrite metadata returned by
scan_cross_crate_callers.
Enums§
- Cascade
Verdict - Result of
walk_transitive_callers— whether the cascade from a pub GenericBound caller can be safely rewritten given the in- workspace call graph.
Functions§
- scan_
cross_ crate_ callers - Convenience wrapper that reads the
ASTRegistryandSymbolRegistryoff anAnalysisContext. Used by the integration pin and by any caller that already holds a full analysis context. - scan_
cross_ crate_ callers_ raw - Scan every cross-crate caller of
trait_idand classify each by caller-side rewrite pattern. - scan_
same_ crate_ external_ callers - Convenience wrapper for
scan_same_crate_external_callers_rawthat takes anAnalysisContext. - scan_
same_ crate_ external_ callers_ raw - Phase 5-B: symmetric counterpart to
scan_cross_crate_callers_rawthat returns the callers living in the same crate as the trait (excluding the implementor’s own impl block and any of its method children). Used by the suggester to detect the mixed-handling case where same-crate external use coexists with cross-crate callers — in that situation the Phase 3 gate must fall through to the v3.1 EXTERNAL_USE filter chain rather than bypassing it. - walk_
transitive_ callers - BFS over
code_graph.callers_ofstarting atroot_caller_idto decide whether the transitive caller cascade ever surfaces a pub API leaf with no in-workspace caller.