Closed crlf0710 closed 4 years ago
What it would be useful for?
I think any implementation of this would destroy all the spans, so I am skeptical that a macro would be worthwhile.
A workaround would be to write:
mod foo {
//! inner docstring comment 1
//! inner docstring comment 2
mod a;
mod b;
pub use a::*;
pub use b::*;
}
that's a little different, with the current visibility rules, some arrangement needs to be done in a.rs and b.rs to make them work together. (Additional use
s, for example.) But it will mostly work.
Too bad Span
referring to external files cannot be created. I left a ticket in https://github.com/rust-lang/rfcs/issues/2869 .
Define a proc macro that collects and combines multiple sources into a single module.
got expanded into (with proper
Span
s if possible):