Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis change fixes Rust qualified-call resolution inside inline modules so Focused execution confirmed that redirected-module calls resolve to the declared logical target rather than a same-named function beside the physical source file. Inline Confidence Score: 5/5Safe to merge based on focused execution of the changed Rust resolution behavior and a matching compiled Rust fixture. The exercised paths covered the central correctness concern: logical module ancestry must win over physical-file ancestry for Files Needing Attention: No follow-up changes are needed. The resolver implementation in
What T-Rex did
Reviews (1): Last reviewed commit: "fix: count Rust super:: and self:: from ..." | Re-trigger Greptile |
b94f6fc to
3858dd9
Compare
c64b253
into
fix/rust-super-self-prefix-resolution
Closes #1086.
Change
_resolve_rust_prefixed_pathdeclined every caller nested below the file module, so the call fell to the enclosing-scope walk, which matches the tail by NAME against each ancestor of the FILE's own qn — right whenever the file sits where its module sits, wrong the moment a#[path]moved it.An inline
modblock's qn is the effective module the written path counts from, which is exactly the "effective module" the use-declaration half already passes to_rewrite_rust_local_use_path(its docstring has said so all along). So instead of bailing, pass that qn down. Everything else — the#[path]climb via_rust_super_base/_rust_logical_parent— already works.The impl-block filtering from #1093 does the rest: impl targets add no module level and are filtered out, so
mod_scopes[0]is the innermost genuinemod.Tests
codebase_rag/tests/test_rust_inline_mod_super_path.py:super::super::sib::run()from an inline mod in a#[path]target, wheresrc/fixtures/sib.rsis declared by nobody and only sits in a physical ancestorsuper::from an inline mod reaches the FILE module, not its parentself::stays in the inline mod rather than picking the same-named file-module item#[cfg(test)] mod tests { ... super::helper() }, the shape this hits most often in practicesuper::→outer,super::super::→ the file module)Three of the five fail without the change — including the nested case, which was resolving
super::helper()frominnertoengine.helperinstead ofouter.helper.Rust suite: 880 passed.