rust-analyzer: serde_derive mod try; is seen as a syntax error by rust-analyzer 0.2.320 (2020-09-21).
Thank for the excellent tool for the rust development!
After updating to rust-analyzer version 0.2.320 today, I’m seeing rust-analyzer complaining about unresolved import:
use serde_derive::{Deserialize, Serialize};
With error in serde_derive being at line:
mod try;
try part is highlighted. Please see the screenshot attached.
Updating to 0.2.320 (2020-09-21) was the only change. Cargo build runs with no errors.

About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (6 by maintainers)
@ecton the “unresolved import” error is expected (and can be disabled by setting
rust-analyzer.diagnostics.disabledto["unresolved-import"]). But I don’t think you should be getting parse errors for thetrymodule inserde’s source code.I’m sorry @inicola for conflating the two issues. @staninprague I got here from a notification on #6054 and misunderstood the last few updates on this, leading me to demonstrate reproducing the issue from #6054, not the actual error mentioned in this thread. I’m not sure that my misunderstanding should be interpreted as more people running into this error.
Apologies again for the confusion everyone.