ebkalderon / tower-lsp

Language Server Protocol implementation written in Rust
Apache License 2.0
1k stars 55 forks source link

error[E0308]: mismatched types in lib.rs:108:1 #305

Closed bphunter1972 closed 2 years ago

bphunter1972 commented 2 years ago

I don't know anything about rust, or this project. I am using cargo to install another binary which has tower-lsp v0.14.1 as a dependency and I'm seeing this error:

error[E0308]: mismatched types
   --> /home/bphunter/.cargo/registry/src/github.com-1ecc6299db9ec823/tower-lsp-0.14.1/src/lib.rs:108:1
    |
108 | #[rpc]
    | ^^^^^^ expected enum `std::option::Option`, found enum `Id`
    |
    = note: expected enum `std::option::Option<Id>`
               found enum `Id`
    = note: this error originates in the attribute macro `rpc` (in Nightly builds, run with -Z macro-backtrace for more info)
help: try wrapping the expression in `jsonrpc::_::_serde::__private::Some`
    |
108 | jsonrpc::_::_serde::__private::Some(#[rpc])
    | ++++++++++++++++++++++++++++++++++++      +

For more information about this error, try `rustc --explain E0308`.
error: could not compile `tower-lsp` due to previous error

I am using: cargo 1.58.0 (f01b232bc 2022-01-19)

Any help or explanation would be appreciated.

ebkalderon commented 2 years ago

Thanks so much for the report! I think I understand what's happening. I released a new, incompatible version of tower-lsp-macros intended for use with tower-lsp 0.15.0 (the newest release) a few days ago. However, I had designated this new tower-lsp-macros release as 0.4.2, which seems to have broken 0.14.1 users who choose to update their Cargo.lock.

My deepest apologies for the breakage! I should be able to yank tower-lsp 0.15.0 and tower-lsp-macros 0.4.2 from crates.io and re-release the exact same code as tower-lsp 0.15.1 and tower-lsp-macros 0.5.0, which should resolve the issue for all users.

ebkalderon commented 2 years ago

Done! Please try to reinstall the binary via Cargo again, and this should hopefully fix the problem. Alternatively, if this is an option at all, please encourage the project you are installing to upgrade to version 0.15.1, which includes further updates and improvements beyond 0.14.X.

In either case, please let me know if this has fixed your issue! If you are still running into trouble, please reply here and we can always reopen this ticket.

bphunter1972 commented 2 years ago

I am adding you to the list of people who rock.

Thank you!

ebkalderon commented 2 years ago

Aw, thank you! I greatly appreciate that, @bphunter1972. It was my own fault for breaking the downstream crate, though, so... sorry again about that (and to whomever maintains the downstream project you were attempting to install). Really happy to hear this new release has fixed the issue for you nonetheless! :blush: