You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;fnmain(){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)
The text was updated successfully, but these errors were encountered:
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):
will produce the following error
The text was updated successfully, but these errors were encountered: