@@ -1800,10 +1800,6 @@ pub fn run_cargo(
18001800 is_check : bool ,
18011801 rlib_only_metadata : bool ,
18021802) -> Vec < PathBuf > {
1803- if builder. config . dry_run ( ) {
1804- return Vec :: new ( ) ;
1805- }
1806-
18071803 // `target_root_dir` looks like $dir/$target/release
18081804 let target_root_dir = stamp. parent ( ) . unwrap ( ) ;
18091805 // `target_deps_dir` looks like $dir/$target/release/deps
@@ -1910,6 +1906,10 @@ pub fn run_cargo(
19101906 crate :: exit!( 1 ) ;
19111907 }
19121908
1909+ if builder. config . dry_run ( ) {
1910+ return Vec :: new ( ) ;
1911+ }
1912+
19131913 // Ok now we need to actually find all the files listed in `toplevel`. We've
19141914 // got a list of prefix/extensions and we basically just need to find the
19151915 // most recent file in the `deps` folder corresponding to each one.
@@ -1965,9 +1965,6 @@ pub fn stream_cargo(
19651965 cb : & mut dyn FnMut ( CargoMessage < ' _ > ) ,
19661966) -> bool {
19671967 let mut cargo = Command :: from ( cargo) ;
1968- if builder. config . dry_run ( ) {
1969- return true ;
1970- }
19711968 // Instruct Cargo to give us json messages on stdout, critically leaving
19721969 // stderr as piped so we can get those pretty colors.
19731970 let mut message_format = if builder. config . json_output {
@@ -1986,6 +1983,11 @@ pub fn stream_cargo(
19861983 }
19871984
19881985 builder. verbose ( & format ! ( "running: {cargo:?}" ) ) ;
1986+
1987+ if builder. config . dry_run ( ) {
1988+ return true ;
1989+ }
1990+
19891991 let mut child = match cargo. spawn ( ) {
19901992 Ok ( child) => child,
19911993 Err ( e) => panic ! ( "failed to execute command: {cargo:?}\n ERROR: {e}" ) ,
0 commit comments