Recently, I've been working with verus-analyzer — a tool similar to rust-analyzer
, but designed for parsing Verus code. As part of this work, I imported the ide-assists
package from the project.
However, I immediately encountered a compilation error when running:
cargo build
Updating git repository `https://github.com/verus-lang/verusfmt.git`
error: failed to get `verusfmt` as a dependency of package `ide-assists v0.0.0 (/Users/marsmac/dev/ruzykaller/PromeX-Verus/verus-analyzer/crates/ide-assists)`
... which satisfies path dependency `ide-assists` (locked to 0.0.0) of package `ide v0.0.0 (/Users/marsmac/dev/ruzykaller/PromeX-Verus/verus-analyzer/crates/ide)`
... which satisfies path dependency `ide` (locked to 0.0.0) of package `PromeX-Verus v0.1.0 (/Users/marsmac/dev/ruzykaller/PromeX-Verus)`
Caused by:
failed to load source for dependency `verusfmt`
Caused by:
Unable to update https://github.com/verus-lang/verusfmt.git?branch=optional-updater
Caused by:
failed to find branch `optional-updater`
Caused by:
cannot locate remote-tracking branch 'origin/optional-updater'; class=Reference (4); code=NotFound (-3)
The problem stems from a dependency in Cargo.toml
, which references a non-existent branch:
verusfmt = { git = "https://github.com/verus-lang/verusfmt.git", branch = "optional-updater", default-features = false }
However, when I build the package directly, it compiles successfully. According to the build log, it pulls the latest commit from the main
branch of verusfmt
:
Compiling verusfmt v0.5.0 (https://github.com/verus-lang/verusfmt.git?branch=optional-updater#9ea9c5a5)
I'm wondering why this difference happens.