tower-web
tower-web copied to clipboard
impl_web only allowed once (per module?)
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)
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.