What does #[macro_use] before an extern crate statement mean?

It means to import (“use”) the macros from the crate.

As of Rust 1.30, this syntax is no longer generally needed and you can use the standard use keyword instead.

Review the macros chapter from the first edition of The Rust Programming Language for more detail.

Leave a Comment