-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macro Error on Serde Serialize/Deserialize: Err
value: ParseFloatError { kind: Invalid } rust-analyzer macro-error
#8928
Comments
Hm, I cant' reproduce this using the latest version of rust-analyzer: Cound you check the version of rust-analyzer you are using? https://rust-analyzer.github.io/manual.html#troubleshooting |
The RA version is: v0.2.599. The VSCode version is: 1.56.2. |
And which |
Latest nightly. |
Dupe of #8925, I suppose. |
NOTE: The error doesn't prevent the proper derivation of Serialize/Deserialize. It just shows the error (in the output tab if you don't have it configured to display errors inline). The error appears on the structure & enum. If I remove the Serialize/Deserialize from both, the error goes away, but then (obviously), Serialize/Deserialize is not implemented. |
This does appear to be a nightly related issue. The problem goes away when I switch to stable. |
Unfortunately, we currently don't support multiple proc macro ABIs, so we can't fix this until 1.54 comes out. |
@gbutler69 You can use this patch which applies the upstream abi changes on top of rust-analyzer. Note, that this doesn't implement the functionality of rust-lang/rust#84717. But serde_derive should work without that. |
Same issue :( |
@quantumsheep Switch to stable for you project (if possible) using: rustup default stable. |
If you need to use nightly but not necessarily the latest nightly, you can also use |
I just got this issue while using Rust stable on mac (rustc 1.48.0). Read through this issue and thought "I'm not using nightly, but I'll try it anyway". Rust updated to 1.54.0 and the issue is gone, so it's also worthwhile to make sure stable Rust is up to date as well. Hope this helps someone else! |
I am experiencing this issue with |
@flodiebold the version from VSCode before I overwrote it was I tried uninstalling and reinstalling the VSCode (from "stable" channel) first, then again but switching to the "nightly" channel. |
With the latest Rust Analyzer release in VS Code (latest) I'm receiving the following error when deriving Serialize/Deserialize (Serde) on a simple struct:
I am getting the error with the following simple code:
This code compile as runs fine from the command line using
cargo run
.Also, somewhat counter-intuitively, the "Move" structure is recognized at the usage site as correctly implementing Serialize/Deserialize.
Is this a bug in rust-analyzer (it seems like it) or am I doing something wrong.
Here is my Cargo.toml:
The text was updated successfully, but these errors were encountered: