Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pksunkara opened this issue Feb 22, 2021 · 0 comments
Labels
C: derive Context: Derive library D1: trivial Difficulty: Trivial to implement for beginners T: quality Type: Code quality improvment U2: need to have Urgency: Need to have

Comments

@pksunkara
Copy link
Owner

pksunkara commented Feb 22, 2021

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

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

Blocked by rust-lang/rust-analyzer#7550

Similarly for Model and other derives.

@pksunkara pksunkara added U2: need to have Urgency: Need to have C: derive Context: Derive library D1: trivial Difficulty: Trivial to implement for beginners T: quality Type: Code quality improvment W: external Waiting: External E: rust-analyzer External: Rust Analyzer labels Feb 22, 2021
@pksunkara pksunkara removed E: rust-analyzer External: Rust Analyzer W: external Waiting: External labels Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: derive Context: Derive library D1: trivial Difficulty: Trivial to implement for beginners T: quality Type: Code quality improvment U2: need to have Urgency: Need to have
Projects
None yet
Development

No branches or pull requests

1 participant