Closed
Description
Importing a macro from a crate in 2018 edition that invokes other macros does not bring those macros in scope. It's easy enough to make work by importing the other macros of course, but surprising behavior anyway, especially when it involves importing macros that won't actually be referenced anywhere in the file itself, only through invocations.
Example (using clap 2.32):
use clap::app_from_crate;
fn main() {
let _args = app_from_crate!().get_matches();
}
will produce the following error
error: cannot find macro `crate_name!` in this scope
--> src\main.rs:5:17
|
5 | let _args = app_from_crate!().get_matches();
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
Metadata
Metadata
Assignees
Labels
No labels