Make it easier to include generated files as module?

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 Likes

See also [Pre-RFC] Macros in Attributes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.