Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Delegate input to #[proc_macro] at Rust 1.45+ #64

Closed
wants to merge 3 commits into from

Conversation

taiki-e
Copy link
Contributor

@taiki-e taiki-e commented Oct 25, 2020

Closes #62

Comment on lines +150 to +154
#[cfg_attr(not(fn_like_proc_macro), path = "fallback/mod.rs")]
#[cfg_attr(fn_like_proc_macro, path = "compiler.rs")]
mod imp;
use crate::imp::*;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to use cfg for more than half of lib.rs and perse.rs's items, so I separated the files that have code that needs cfg.

@taiki-e
Copy link
Contributor Author

taiki-e commented Oct 25, 2020

This also fixes #20, #43, and #63 at Rust 1.45+.

proc-macro-hack does nothing in these versions, so proc-macro-nested
doesn't need to do anything either.
Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I think it would be problematic to automatically use a native proc_macro everywhere possible, since the hygiene can be subtly different. I opened a different implementation in #66 with an opt in attribute arg.

@dtolnay dtolnay closed this in #66 Oct 28, 2020
@taiki-e taiki-e deleted the fn_like_proc_macro branch October 28, 2020 00:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider compiling to pass-through implementation on new compilers
2 participants