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?

1 Like

#2

See also [Pre-RFC] Macros in Attributes

0 Likes

closed #3

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

0 Likes