Repository navigation
fix: preserve final Rust field receivers during resolution - #20
Conversation
实现与验证说明 / Implementation notes这份说明记录本 PR 的实际实现与验证过程。代码和检查由 OpenAI Codex 辅助完成;提交基于上游 1. 范围:补上两个独立缺口最初沿 #14 调查 Rust 智能指针字段调用。发布前检查发现 #19 已提出基础的
本 PR 没有包含 #19 的 JS、Python、trait 方法优先级改动,也不以单独关闭 #14 的全部基础场景为目标。 2. 根指针的方法过滤发生得太早相关调用链在
旧逻辑在根绑定处直接调用 问题出在 修复只调整根 receiver 的选择:
没有删除 wrapper 信息,也没有把未知容器统一当作透明指针。通用的智能指针字段遍历仍交由 #19 处理。 回归测试
3. 字段类型也必须参与增量失效相关路径在
之前的 resolver fact 签名没有纳入 Rust 本次把 Rust 字段的名字、声明类型和所属类型 qname 纳入现有签名,再复用已有的 importer 失效传播。其它语言的字段不在这次扩大范围之内。 为什么不能只加字段名和类型? 签名是集合。如果同一文件中: 交换为: 只保存 回归测试
4. 回归必须证明修复前失败、修复后通过使用干净的上游 main archive,只拷入这两条新测试,并使用独立的
另将 5. Docker 验证和实际边界Rust 工具链、Cargo 下载和构建缓存均放在 Docker 内;宿主只挂载源码,没有安装 Rust/Cargo。容器内默认工具链为 Rust 1.89.0,stable 为 1.99.1。 实际运行并通过: 以及 CI 使用的 rustfmt package 列表检查。workspace 合计 389 passed、0 failed、1 个既有 ignored。 此外使用真实 cgr CLI 和可由 rustc 编译运行的 fixture:5 个源码状态全部运行时断言通过,4 次修改都走 delta;总共 7 组 仓库 以上是 Linux Docker 的本地结果。Windows/macOS 原生运行、musl/zig 构建及其它 hosted CI job 以 PR checks 的实际结果为准;这里不把本地通过等同于远端 CI 已通过或 PR 已合并。 |
Summary
Fix two Rust field-resolution gaps on current main (11cbfd9):
w.plain.clone()against the final field whenwis anArc<Child>,Rc<Child>orBox<Child>. The pointer-method guard currently checkscloneagainst the root pointer too early. Preserve the guard for directw.clone()calls.Related to #14; complements #19. This PR deliberately omits the general smart-pointer-field traversal fix already proposed in #19. Both added regressions fail on the unmodified upstream base independently of that work. If #19 lands first, the engine bump needs rebasing to 11 → 12.
Validation
Rust toolchains, Cargo dependencies and build artifacts stayed inside Docker.
cargo test --locked --workspacewithCGR_SYNC_SEQUENCES=6 CGR_SYNC_STEPS=100: 389 passed, 0 failed, 1 existing ignored (Rust 1.89.0).cargo +stable clippy --locked --workspace --exclude cg-kernel --all-targets -- -D warnings: passed (stable 1.99.1).cargo build --locked -p cgr: passed.Local validation covers Linux in Docker; hosted Windows/macOS and other CI jobs remain to be verified. Implemented and validated with OpenAI Codex assistance.