beancount-language-server icon indicating copy to clipboard operation
beancount-language-server copied to clipboard

Compile error E0308: mismatched types

Open varac opened this issue 1 year ago • 2 comments

I am using the language server since a while, and I always could install it. Today it was failing with E0308: mismatched types, maybe it's due to an updated rust/cargo version ?

$ cargo install --root . --version 1.3.5 beancount-language-server 
   ...
   Compiling beancount-language-server v1.3.5
error[E0308]: mismatched types
   --> /home/varac/.cargo/registry/src/index.crates.io-6f17d22bba15001f/beancount-language-server-1.3.5/src/server.rs:288:74
    |
288 | ...q_queue.incoming.complete(response.id.clone()) {
    |                     -------- ^^^^^^^^^^^^^^^^^^^ expected `&RequestId`, found `RequestId`
    |                     |
    |                     arguments to this method are incorrect
    |
note: method defined here
   --> /home/varac/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsp-server-0.7.7/src/req_queue.rs:49:12
    |
49  |     pub fn complete(&mut self, id: &RequestId) -> Option<I> {
    |            ^^^^^^^^
help: consider borrowing here
    |
288 |         if let Some((_method, start)) = self.req_queue.incoming.complete(&response.id.clone()) {
    |                                                                          +

For more information about this error, try `rustc --explain E0308`.
error: could not compile `beancount-language-server` (lib) due to 1 previous error
error: failed to compile `beancount-language-server v1.3.5`, intermediate artifacts can be found at `/tmp/cargo-installyxIgZc`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Versions


$ rustc --version
rustc 1.81.0 (eeb90cda1 2024-09-04) (Arch Linux rust 1:1.81.0-1)

/tmp $ cargo --version
cargo 1.81.0 (2dbb1af80 2024-08-20)

varac avatar Nov 04 '24 15:11 varac

It looks like this issue has been resolved in v1.3.6. See this closed issue

ERElli avatar Nov 13 '24 03:11 ERElli

How do you install v1.3.6?

cargo install --version 1.3.6 beancount-language-server
    Updating crates.io index
error: could not find `beancount-language-server` in registry `crates-io` with version `=1.3.6`

dustinfarris avatar Dec 21 '24 20:12 dustinfarris