Compile-time "if dev dependencies are included"?

How to spell that in Rust?

I tried

pub use x;

But seems it does not work as I expect.


At least, that's when I'm usually interested in dev dependencies. If there are other config attributes that would be appropriate I don't know them.


There's no way to do this exactly. You can use #[cfg(test)] for when unit tests are being compiled, or #[cfg(doc)] for when documentation is being compiled.


Thank you.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.