【发布时间】:2018-10-29 22:22:12
【问题描述】:
我正在试验Rust Edition 2018。在 Rust 2015 中,您使用
#[macro_use]
extern crate log;
用于导入宏。在 Rust 2018 中,extern crate 可能是单调的。有没有办法在没有extern crate 的情况下从包中导入所有宏?对于简单的宏,importing it in the modules 可以,但复杂的宏依赖于其他几个宏,不方便。
【问题讨论】:
-
复杂的宏依赖于其他几个宏 — 从 Rust 1.30 开始,宏可以import the helper macros they need,防止这个根本问题。