在 Rust 中,有时我会看到在
extern crate
语句之前出现 #[macro_use]
:#[macro_use]
extern crate gotham_derive;
相较于没有#[macro_use]
,这个有什么作用呢?
extern crate gotham_derive;
#[macro_use]
来告诉编译器你正在使用创建在crate内部定义的宏。 - Jarak