lloydmeta / frunk

Funktional generic type-level programming in Rust: HList, Coproduct, Generic, LabelledGeneric, Validated, Monoid and friends.
https://beachape.com/frunk/
MIT License
1.29k stars 58 forks source link

Macros should be local_inner_macros #145

Closed CAD97 closed 5 years ago

CAD97 commented 5 years ago

https://rust-lang-nursery.github.io/edition-guide/rust-2018/macros/macro-changes.html#local-helper-macros

So for example, Coprod! should do $crate::Coprod! when calling itself or be exported with #[macro_export(local_inner_macros)] so that it can be used without being in scope.

(I'm trying to write an ad-hoc enum conversion derive that uses Coproduct as a middle stepping ground, thus running into this.)

lloydmeta commented 5 years ago

Ah nice one; looking through https://github.com/lloydmeta/frunk/blob/master/core/src/macros.rs#L228 it seems like we do this in at least Hlist and poly_fn as well.

Would you like to submit a PR to address this?