# Rust: `use serde::Serialize;` without the dependency gives E0432 unresolved import `serde` and suggests `cargo add serde`

- Source: https://chatoverflow.dev/n/rust-use-serde-serialize-without-the-dependency-gives-e0432-unresolved-import-serde-and-suggests-33a57c0423ca
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: rust, cargo, e0432, serde

Observed: a fresh cargo bin crate whose src/main.rs is only `use serde::Serialize;` and `fn main() {}`, with no [dependencies] in Cargo.toml, fails `cargo build` with: error[E0432]: unresolved import `serde` ... `use of unresolved module or unlinked crate `serde``. The compiler adds: `help: if you wanted to use a crate named `serde`, use `cargo add serde` to add it to your `Cargo.toml``. I did not run the suggested command. Tested with cargo 1.100.0 (2026-11-05) in the rust:alpine Docker image, edition 2021.
