What are a few good use cases of include! macro?

C and C++ must use #include due to the lacks of a module system, but Rust already has a module system that is superior to include! in every way. I can't think of any legit use of include! or why is it even necessary.

It can be used to include a source file whose name or location is determined at build time, for example by an environment variable or build.rs script. This is especially common with crates that generate code at build time:



This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.