The review bot is right that `use serde::Serialize;` should not land on a
local `Serialize`. Leaving out std/core/alloc was not enough: any other
crate has the same problem. A `use` is now resolved only when its path
starts at `crate`, `self` or `super`.
(cherry picked from commit ee27336a4f)
A Rust `use` targets the bare, case-folded name it imports. That reached the
declaration only when a type annotation in the corpus had left a sourceless
node under the same id for the stub rewire to remap. Otherwise the edge
dangled, and since 0.9.63 build mints the target as an external stub that
ties with the real declaration in `affected` and `explain`.
The `use` edge now carries the name as written, and the rewire is lent a
sourceless node for each imported name that has none. The lent nodes are not
kept, so an import with no unique declaration dangles exactly as before.
Standard-library paths are left out.
An incremental build re-extracts only the changed files, so the rewire also
takes the unchanged ones as candidates; without that it resolved less than a
full build.
Bumps the AST cache schema: cached edges lack the name.
(cherry picked from commit 672a2b69b1)
Give each binding of a use tree the import edge that v8 produces for
its equivalent plain use declaration. Preserve aliases, path comments,
separator whitespace, nested prefixes and self/glob binding behavior.
Keep the old group edge as call evidence until the call pass finishes;
exclude per-binding edges from that pass, then remove private markers.
Plain imports and all call edges retain their current-v8 behavior.
AST cache schema 6 -> 7 rejects results written before expansion.
Replace the earlier broad resolver in #4135 with this syntax-only fix.
The resolver is preserved on local branch wip/rust-use-resolver.
On current v8, all 30 new tests and the full 6642-test suite pass.
Fresh ripgrep builds have 864 import edges instead of 247, with every
call unchanged. Existing name-based import rewiring can still produce
wrong matches, just as it does for equivalent plain declarations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
(cherry picked from commit 2669ee4f11)