Closed
Description
For build systems other than cargo, it is generally considered best practice to build out of tree (ie, generated files go into a directory that is not tracked by version control). With rustc this works great, except when you need to generate rust sources. In that case a build system (meson in this case, but cmake and gnu autotools would be affected too) will place the generated .rs file in the build tree, while the hard written sources are in the source tree. As far as I can find there is no way to tell rustc about this and get it to compile successfully, without resorting to ugly hacks like "copy all of the files from the source tree to the build tree." While this can work, it's rather ugly and error prone.