code_generation_example/
lib.rs

1include!(concat!(env!("OUT_DIR"), "/hello.rs"));
2include!(concat!(env!("GENERATED_ENV"), "/hello2.rs"));
3
4#[cfg(not(has_generated_feature))]
5mod disabled;
6#[cfg(has_generated_feature)]
7mod enabled;
8
9#[cfg(not(has_generated_feature))]
10pub use disabled::function_under_cfg;
11#[cfg(has_generated_feature)]
12pub use enabled::function_under_cfg;