Make it easier to include generated files as module?


#1

Currently, when you have a generated Rust source and you want to include it as a module, you have to do something like

mod generated_mod {
    include!(concat!(env!("OUT_DIR"), "/generated_mod.rs"));
}

It would probably be better if it can be simplified to, for example

#[path = "$outdir/generated_mod.rs"]
mod generated_mod;

or something like this.

What do you think?


#2

See also [Pre-RFC] Macros in Attributes