Need to put more words to this, but: I think http://build.rs 's include!() macro behavior is alright, but not great. Either you use it to import real basic files only. Or you need to declare every dependency in Cargo.toml *twice*. One regular dep, and one build-dep.
It seems the include!() macro works similar-ish to C-style headers. Basically copy-paste a file into where the macro would otherwise be. And that works well for basic things, but it's what I believe is called "unhygienic" -- imports leak, and the compiler doesn't like it.
-
-
To recap: 1. Regular dependencies aren't available in http://build.rs , leading to duplicated declarations 2. `include!()` is unhygienic A solution? Not sure. Ideally `extern crate` would work, but I'm *sure* there's reasons why it was chosen not to.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
You can also do #[path="http://somefile.rs "] mod foo; it behaves similarly though
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.