rust

rust compiler "error: no matching package named `*` found" though it should be present


A while back I setup a project with the following in my Cargo.tml:

[dependencies]
reqwest = { version = "0.11", features = ["blocking", "json"] }

That all worked great. Now I tried to add an additional dependency by adding the line

teloxide = { version = "0.4", features = ["auto-send", "macros"] }

to Cargo.tml and get an error of:

error: no matching package named 'teloxide' found

I'm not sure what is the cause of this error, or what to investigate further - perhaps there is some way I can see which packages the compiler can list/recognize? I've found these two threads but they don't seem to provide any conclusive answer (I did try removed ~/.cargo which resulted in no change in behavior):

https://github.com/rust-lang/cargo/issues/6686 https://github.com/balena-os/balena-raspberrypi/issues/261

Potentially the issue is related to nix or naersk which I'm using.


Solution

  • Solved with a simple cargo update.