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

impl_web only allowed once (per module?) #31

Open
shepmaster opened this issue Jul 29, 2018 · 1 comment
Open

impl_web only allowed once (per module?) #31

shepmaster opened this issue Jul 29, 2018 · 1 comment

Comments

@shepmaster
Copy link
Collaborator

error[E0428]: the name `ProcMacroHack` is defined multiple times
   --> src/tower_web_server.rs:29:1
    |
29  | / impl_web! {
30  | |     impl Assets {
31  | |         /// @get("/")
32  | |         /// @content_type("text/plain")
...   |
129 | |     }
130 | | }
    | |_^ `ProcMacroHack` redefined here
...
133 | / impl_web! {
134 | |     impl Sandbox {
135 | |         /// @get("/compile")
136 | |         /// @content_type("text/plain")
...   |
140 | |     }
141 | | }
    | |_- previous definition of the type `ProcMacroHack` here
    |
    = note: `ProcMacroHack` must be defined only once in the type namespace of this module
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@carllerche
Copy link
Owner

carllerche commented Jul 29, 2018

Yes, this is a limitation and will go away once attr macros hit stable.

You can work around by putting multiple impl blocks in a single `impl_web! macro.

@carllerche carllerche mentioned this issue Jul 29, 2018
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants