-
Notifications
You must be signed in to change notification settings - Fork 13.4k
proc_macro does not support type macros #38706
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This is a regression from #37614 because it works fine on nightly-2016-11-06 - cc @keeperofdakeys. |
@jseyfried This seems like a simple case of the attribute visitor walking the AST before expansion. I assume we just want to add a simple visit_mac implementation here like the Visitor trait suggests? For reference:
|
@keeperofdakeys Yeah, adding an empty |
…yfried Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation Fixes #38706 r? @jseyfried
@keeperofdakeys (cc @nrc)
Not expanding first can be strictly more powerful -- we can support something like #[proc_macro_derive(A)]
fn derive(input: TokenStream) -> TokenStream {
let input = input.expand_macros();
// --- OR ---
let input = match input.try_expand_macros() {
Ok(input) => input,
Err(err) => return MacroContext::pending(err);
};
} However, I'm not sure why a Note that we currently "expand" |
The text was updated successfully, but these errors were encountered: