dtolnay / reflect

Compile-time reflection API for developing robust procedural macros (proof of concept)

Home Page:https://docs.rs/reflect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Referencing types and traits from other modules in library macro

8BitMate opened this issue · comments

Currently the library macro does not support cross referencing types and traits.

It would be nice to be able to do something like this:

library! {
    extern crate Crate {
        mod Mod1 {
            type Type1;
            fn fun(super::Mod2);
        }

        mod Mod2 {
            type Type2;
            fn fun(::Crate::Mod1);
            fn dynamic(&dyn crate::Trait);
        }
        trait Trait {}
    }
}