Expand module-scoped use trees into exact import paths and bindings. Resolve renamed public symbols and module aliases without global-name fallback; keep unknown and block-local bindings conservative. Add positive and negative integration tests and an exact three-repeat import benchmark to the quality gate.
40 lines
2.3 KiB
Markdown
40 lines
2.3 KiB
Markdown
# Resolution follow-up
|
|
|
|
The language-correctness changes were committed and pushed as `3fec92f`.
|
|
The next implementation stage starts with module-scoped Rust grouped imports:
|
|
nested braces, renamed symbols, and `self as alias` module bindings. Explicit
|
|
imports must resolve through their paths, never a global name fallback. Private,
|
|
missing, wildcard, underscore, and block-local bindings must not authorize
|
|
unrelated calls. Relationships remain heuristic and preserve import provenance.
|
|
|
|
Experiment: add `tests/rust_imports.rs` and an exact three-repeat Rust import
|
|
corpus. Expect new file-import and call edges for labeled positives, no resolved
|
|
calls for clean negatives, and stable unrelated symbol IDs. No metric weights or
|
|
reader schema changes are intended.
|
|
|
|
Following stages: TS configuration aliases and package exports; Dart package
|
|
configuration; compiler evidence adapters for C++ translation units/types,
|
|
overloads, and receiver-aware dispatch. Each stage needs its own labeled
|
|
positive/negative corpus and preserved evidence lane. These stages are not yet
|
|
implemented by the Rust import work.
|
|
|
|
Rust grouping and `self` binding semantics follow the
|
|
[Rust Reference](https://doc.rust-lang.org/reference/items/use-declarations.html).
|
|
|
|
The first stage implements module-scoped nested groups, renamed symbols, and
|
|
module aliases. Each import leaf retains source-line provenance; leaves resolving
|
|
to the same file merge their edge evidence. Block-local imports retain dependency
|
|
evidence and a diagnostic but do not participate in call-target resolution.
|
|
Wildcard and underscore imports never authorize a named call. An absent or
|
|
non-exported symbol remains external. Module aliases take precedence over
|
|
same-named file guesses.
|
|
|
|
The `rust_imports` benchmark enumerates 8 symbols and 7 dependencies, including
|
|
an absent-import negative and a same-named module that must not capture an alias.
|
|
It runs three times in the quality gate and retains raw JSON/HTML and a manifest
|
|
under `build/benchmarks/rust_imports`. Unit/integration tests additionally cover
|
|
private names, wildcard and underscore imports, and block-binding leakage.
|
|
|
|
This closes the module-scoped grouped-import slice; it does not implement a Rust
|
|
compiler's full visibility, Cargo workspace, glob, re-export, or block-scope
|
|
resolution. All inferred relationships remain Heuristic.
|