@@ -367,20 +367,20 @@ impl Build {
367367 cc_detect:: find ( & mut build) ;
368368 build. verbose ( "running sanity check" ) ;
369369 sanity:: check ( & mut build) ;
370- if !cfg ! ( test) {
371- // If local-rust is the same major.minor as the current version, then force a
372- // local-rebuild
373- let local_version_verbose = output (
374- Command :: new ( & build. initial_rustc ) . arg ( "--version" ) . arg ( "--verbose" ) ) ;
375- let local_release = local_version_verbose
376- . lines ( ) . filter ( |x| x. starts_with ( "release:" ) )
377- . next ( ) . unwrap ( ) . trim_left_matches ( "release:" ) . trim ( ) ;
378- let my_version = channel:: CFG_RELEASE_NUM ;
379- if local_release. split ( '.' ) . take ( 2 ) . eq ( my_version. split ( '.' ) . take ( 2 ) ) {
380- build. verbose ( & format ! ( "auto-detected local-rebuild {}" , local_release) ) ;
381- build. local_rebuild = true ;
382- }
370+
371+ // If local-rust is the same major.minor as the current version, then force a
372+ // local-rebuild
373+ let local_version_verbose = output (
374+ Command :: new ( & build. initial_rustc ) . arg ( "--version" ) . arg ( "--verbose" ) ) ;
375+ let local_release = local_version_verbose
376+ . lines ( ) . filter ( |x| x. starts_with ( "release:" ) )
377+ . next ( ) . unwrap ( ) . trim_left_matches ( "release:" ) . trim ( ) ;
378+ let my_version = channel:: CFG_RELEASE_NUM ;
379+ if local_release. split ( '.' ) . take ( 2 ) . eq ( my_version. split ( '.' ) . take ( 2 ) ) {
380+ build. verbose ( & format ! ( "auto-detected local-rebuild {}" , local_release) ) ;
381+ build. local_rebuild = true ;
383382 }
383+
384384 build. verbose ( "learning about cargo" ) ;
385385 metadata:: build ( & mut build) ;
386386
@@ -426,7 +426,6 @@ impl Build {
426426 ///
427427 /// After this executes, it will also ensure that `dir` exists.
428428 fn clear_if_dirty ( & self , dir : & Path , input : & Path ) -> bool {
429- if cfg ! ( test) { return true ; }
430429 let stamp = dir. join ( ".stamp" ) ;
431430 let mut cleared = false ;
432431 if mtime ( & stamp) < mtime ( input) {
@@ -697,7 +696,6 @@ impl Build {
697696
698697 /// Returns the path to the linker for the given target if it needs to be overridden.
699698 fn linker ( & self , target : Interned < String > ) -> Option < & Path > {
700- if cfg ! ( test) { return None ; }
701699 if let Some ( linker) = self . config . target_config . get ( & target)
702700 . and_then ( |c| c. linker . as_ref ( ) ) {
703701 Some ( linker)
0 commit comments