Macro-importing `extern crate` placed inside a module instead of the crate root.
mod inner {
#[macro_use] extern crate serde; // E0468: must be at crate root
}
#[macro_use] extern crate declares macros for the whole crate; placing it in a module makes the scope confusing and is rejected. In edition 2018+ this whole pattern is deprecated — use use instead.
- Move the import to the crate root (lib.rs or main.rs).
- Better: drop extern crate entirely and use serde::Serialize (or whichever macros) where needed.
- For macro re-exports, use pub use crate_name::macro_name; from the crate root.