Skip to content

[Bug] rustc 1.96 下 lithe-git-host、lithe-core-rules 出现 3 条新 clippy 告警 #1789

Closed
Lithe-IDEA/Lithe-core-rust
#28

Description

@xiaoyumuxi

Platform / 平台

Other / 其他

Area / 模块

Other / 其他

Lithe version / Lithe 版本

preview 分支 0d38aca(源码构建)

Priority / 优先级

P2 / 后续考虑:目前不着急,可安排到后续版本

OS and architecture / 操作系统与架构

macOS 27.3 arm64

Environment / 环境信息

rustc 1.96.0 (ac68faa20 2026-05-25),cargo clippy 随同版本工具链;CI 使用 dtolnay/rust-toolchain@stable,升到 1.96 后会出现同样告警。

Steps to reproduce / 复现步骤

cd rust
cargo clippy -p lithe-git-host -p lithe-core-rules --all-targets

Expected behavior / 预期行为

与 preview 其他 crate 一致,clippy 无告警。

Actual behavior / 实际行为

三条新 lint 告警,均在与 Java 拆分无关的 crate:

warning: manual `Range::contains` implementation
   --> lithe-core-rules/src/keymap/modifier_gesture.rs:117:16
warning: function `forward_slash_path` is never used
  --> lithe-git-host/src/configuration.rs:52:4
warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> lithe-git-host/src/configuration.rs:118:9

若工作流以 -D warnings 运行 clippy,stable 工具链升级后这些会变成 CI 失败。

Logs or diagnostic output / 日志或诊断输出

见上。

Screenshots or recordings / 截图或录屏

无。

Checklist / 提交前检查

  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。

Activity

  1. added
    bug
    P2
    on Nov 7, 2026
  2. added
    review: high
    on Nov 7, 2026
  3. xiaoyumuxi commented on Nov 7, 2026

    @xiaoyumuxi
    CollaboratorAuthor

    补充:同一工具链下 cargo fmt --all --check 在 rust/lithe-agent-host/src/claude_desktop.rs 也报出多处格式差异(该文件自 #1480 后未再改动),应与 clippy 告警一并处理。

  4. xiaoyumuxi commented on Nov 7, 2026

    @xiaoyumuxi
    CollaboratorAuthor

    补充:同一个 1.96 工具链里的 rustfmt 1.9.0 也会报格式漂移。在 preview 5a54c41aa 上,cd rust && cargo fmt --all -- --check -l 列出 10 个文件,全部在 lithe-agent-host:

    lithe-agent-host/src/claude_desktop.rs
    lithe-agent-host/src/claude_earlier_history.rs
    lithe-agent-host/src/edit_review.rs
    lithe-agent-host/src/edit_review/tests.rs
    lithe-agent-host/src/lib.rs
    lithe-agent-host/src/model_call_statistics.rs
    lithe-agent-host/src/next_turn_config.rs
    lithe-agent-host/src/skills.rs
    lithe-agent-host/src/skills/tests.rs
    lithe-agent-host/src/tests.rs
    

    Lithe-core-rust 9af1c9c 里的同一批文件也有这个问题。两个仓库都没有 rust-toolchain.toml,所以 CI 的 stable 升到 1.96 后,cargo fmt --check 也会跟着失败。修 clippy 时可以一起处理:要么用 1.96 重新格式化这些文件,要么固定工具链版本。

  5. xiaoyumuxi commented on Nov 13, 2026

    @xiaoyumuxi
    CollaboratorAuthor

    同一原因(rustc 1.96 的 clippy,Core crate 没有 -D warnings 门禁)在 lithe-core 也存在,范围比本单列出的三条大,补充在这里,不另开单。

    在 Lithe-IDEA/Lithe-core-rust 分支 refactor/core-remove-java-special-cases 上(基于 origin/main 65cf823),执行 cd rust && cargo clippy --workspace --all-targets --message-format short,环境为 macOS arm64、rustc 1.96.0:

    • 1 条 error,会让 --all-targets 直接失败
      • lithe-core/src/project/search_index.rs:760:66:fs::Permissions::from_mode(0) 触发 clippy::non_octal_unix_permissions,这条 lint 默认是 deny。
      • 修法是改成 0o000,行为不变。
      • 这行在 origin/main 上就有(d797244),不是该分支引入的。
    • 88 条 warning,全部在 lithe-core
      • 最多的几类:
        • needless_borrow:19 条;
        • unnecessary_map_or 及类似的“可简化”:11 条;
        • nonminimal_bool:6 条;
        • type_complexity:5 条。
      • 按文件,集中在:
        • git/mod.rs:18 条;
        • lsp/interface/plugin_function.rs:7 条;
        • lsp/interface/engine_logging.rs:6 条;
        • lsp/interface/client.rs:6 条;
        • debug/adapters.rs:5 条。
      • 该分支自己引入的 1 条已经在分支里修掉,剩下的在 origin/main 上同样存在。

    由于 error 让 lithe-core 的测试目标停止编译,本单列出的 lithe-git-host、lithe-core-rules 告警这次没有出现在输出里;修掉 error 后会重新出现。

    建议在本单修复时一并处理:先修掉这条 error,再清理 lithe-core 的告警。#1796 计划的警告门禁要等这些都清零后才能打开。

  6. xiaoyumuxi commented on Nov 13, 2026

    @xiaoyumuxi
    CollaboratorAuthor

    forward_slash_path 未使用的告警已在 Lithe-IDEA/Lithe-core-rust#26 中修复。剩下两条:modifier_gesture.rs 的 manual_range_contains,以及 configuration.rs 的 needless_borrow(移动后在 rust/crates/git-host/src/configuration.rs:119)。lithe-core 的 84 条告警另记在 #1864。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:otherbugplatform:otherreview: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions