-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
equivalent of $crate
in custom derive paths
#507
Comments
I don't know of a 2018 workaround for this. Your {
use mylib as _mylib;
_mylib::MyType
} This is what Diesel does. |
@alexcrichton any ideas for how to make this work when |
Hm I may be missing something, but why doesn't the |
You can't refer to items from |
Ah right yes, It's possible to have the same procedural macro do something like All in all, sounds like we don't have a solution right now and these crates need to stay on the 2015 edition. |
The global variable thing isn't even guaranteed to work - expansion order is unspecified. |
Closing in favor of rust-lang/rust#54647 to keep the discussion in one place. |
With declarative macros I can use
$crate
to specify fully-qualified paths in a way that works both in the parent crate and when exported to other crates. Is there an equivalent for procedural macros?::mylib::MyType
doesn't work withinmylib
. Before "edition 2018", a workaround like this would probably have been possible, but I don't believe it is any longer:Considering that these macros must currently be defined in another crate it is of course more complicated; a simple
$crate
would expand to the wrong thing.The text was updated successfully, but these errors were encountered: