Repository navigation
Scratch/riel/cpp qualified uses - #153
Merged
rikvanriel merged 3 commits intoNov 26, 2026
Merged
rikvanriel merged 3 commits into
rikvanriel merged 3 commits into
Conversation
A qualified spelling at a use-site is never recorded:
`register_dev(ns::my_read)` records no row, so the handover never
links to `my_read`.
The stored target is the bare leaf. `ns::my_read` records `my_read`,
which meets the bare definition by equality; a lone `::my_read`
names no owner and records nothing. The name is shortened where the
use-site is read; the lookup that matches rows to definitions is
unchanged.
Held tables (`{ ns::a, ns::b }`) and templated leaves
(`ns::my_read<int>`) still record nothing.
The shared extractor version moves 8 to 9: no per-language version
exists, so every language re-indexes for this C++-only change.
New tests: 9 falsifiable cases fail on the base tree with "no row"
and pass with the fix; 4 guards pass on both trees, and a helper
test pins the lone `::` drop.
| case | base | fixed |
| handover, qualified | no row | (register_dev, my_read, false) |
| handover, shadowed local | no row | (register_dev, my_read, false) |
| handover, spaced spelling | no row | (register_dev, my_read, false) |
| designated init, qualified | no row | DesignatedInit my_read |
| assignment, qualified | no row | Assignment impl_fn on ops |
| assignment, &qualified | no row | Assignment impl_fn on ops |
| handover, &qualified | no row | (register_dev, my_read, true) |
| designated init, &qualified | no row | DesignatedInit my_read |
| reduced meets definition | no row | handover row, my_read defined |
A qualified spelling at a Rust handover use-site is never recorded: `register(m::handler)` records no row, so the handover never links to `handler`. The stored target is the bare leaf. `m::handler` records `handler`, which meets the bare definition by equality; a lone `::handler` names no owner and records nothing. A scoped leading `::` still has an owner path, so `::m::handler` records `handler` through the same shared cut as the C++ path. The name is shortened where the use-site is read; the lookup that matches rows to definitions is unchanged. Only the handover site reads scoped spellings; initcall, table, designated-init, and assignment sites stay silent on Rust as before. A reference (`&handler`, `&m::handler`) still records nothing. An alias records the name at the use-site: `register(h)` after `use m::handler as h` records `h`. The shared extractor version moves 9 to 10: no per-language version exists, so every language re-indexes for this Rust-only change. New tests: 2 falsifiable cases fail on the parent commit with "no row" and pass with the fix; 1 guard passes on both trees. | case | base | fixed | | handover, qualified | no row | (register, handler, false) | | handover, scoped leading `::` | no row | (register, handler, false) | | alias, use-site name | (register, h, false) | (register, h, false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Show bare function names for C++ and Rust, getting closer to fully functional call chain tracing in C++ and Rust code bases.