Cargo and rustc communications


I was wondering: how do Cargo and rustc communicate ? How do Cargo sends commands over to rustc and how do rustc sends the results of the compilation to Cargo ? I tried to read the source code of both but I can't seem to figure how they do.

Thank you !

You can pass the -v flag to cargo to see the command line where it calls rustc. The result is just the return value (as in exit(0) for successful compilation).