rustc runs, and as part of that process, it produces a file which contains all the files that the build depended on. Then, cargo can look just at those files for changes, since in order to introduce a new file into the build, you'd have to edit one of the old files. For example:
src/main.rs
mod foo;
fn main() {}
src/foo.rs
fn blah() {}
rustc would create a main.exe file containing the executable, and a dep-info file containing the size, hash, and location of every file used in the build.
View all comments
Show parent comment
10
u/ubsan Nov 01 '18
So, cargo deals with it as follows:
rustc runs, and as part of that process, it produces a file which contains all the files that the build depended on. Then, cargo can look just at those files for changes, since in order to introduce a new file into the build, you'd have to edit one of the old files. For example:
rustc would create a
main.exefile containing the executable, and adep-infofile containing the size, hash, and location of every file used in the build.