pksunkara / reign

Opinionated Isomorphic Web Framework in Rust
https://reign.rs
Apache License 2.0
5 stars 3 forks source link

Use dummy mod to make sure namespace is not polluted when expanding derive macros #18

Closed pksunkara closed 3 years ago

pksunkara commented 3 years ago

When expanding Config derive macro, we should wrap the generated code in a dummy mod:

const _: () = {
    impl ::reign::Config for #ident {
        // ...
    };
};

Blocked by https://github.com/rust-analyzer/rust-analyzer/issues/7550

Similarly for Model and other derives.