@@ -1193,7 +1193,7 @@ fn simple_deps_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
11931193}
11941194
11951195#[ test]
1196- fn simple_deps_cleaner_dose_not_rebuild ( ) {
1196+ fn simple_deps_cleaner_does_not_rebuild ( ) {
11971197 let p = project ( )
11981198 . file (
11991199 "Cargo.toml" ,
@@ -1211,8 +1211,11 @@ fn simple_deps_cleaner_dose_not_rebuild() {
12111211 . file ( "bar/src/lib.rs" , "" )
12121212 . build ( ) ;
12131213
1214- p. cargo ( "build" ) . run ( ) ;
1215- p. cargo ( "build" )
1214+ p. cargo ( "build -Z mtime-on-use" )
1215+ . masquerade_as_nightly_cargo ( )
1216+ . run ( ) ;
1217+ p. cargo ( "build -Z mtime-on-use" )
1218+ . masquerade_as_nightly_cargo ( )
12161219 . env ( "RUSTFLAGS" , "-C target-cpu=native" )
12171220 . with_stderr (
12181221 "\
@@ -1228,19 +1231,22 @@ fn simple_deps_cleaner_dose_not_rebuild() {
12281231 if is_coarse_mtime ( ) {
12291232 sleep_ms ( 1000 ) ;
12301233 }
1231- // This dose not make new files, but it dose update the mtime.
1232- p. cargo ( "build" )
1234+ // This does not make new files, but it does update the mtime.
1235+ p. cargo ( "build -Z mtime-on-use" )
1236+ . masquerade_as_nightly_cargo ( )
12331237 . env ( "RUSTFLAGS" , "-C target-cpu=native" )
12341238 . with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
12351239 . run ( ) ;
12361240 simple_deps_cleaner ( p. target_debug_dir ( ) , timestamp) ;
12371241 // This should not recompile!
1238- p. cargo ( "build" )
1242+ p. cargo ( "build -Z mtime-on-use" )
1243+ . masquerade_as_nightly_cargo ( )
12391244 . env ( "RUSTFLAGS" , "-C target-cpu=native" )
12401245 . with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
12411246 . run ( ) ;
12421247 // But this should be cleaned and so need a rebuild
1243- p. cargo ( "build" )
1248+ p. cargo ( "build -Z mtime-on-use" )
1249+ . masquerade_as_nightly_cargo ( )
12441250 . with_stderr (
12451251 "\
12461252 [COMPILING] bar v0.0.1 ([..])
@@ -1282,7 +1288,7 @@ fn fingerprint_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
12821288}
12831289
12841290#[ test]
1285- fn fingerprint_cleaner_dose_not_rebuild ( ) {
1291+ fn fingerprint_cleaner_does_not_rebuild ( ) {
12861292 let p = project ( )
12871293 . file (
12881294 "Cargo.toml" ,
@@ -1300,8 +1306,11 @@ fn fingerprint_cleaner_dose_not_rebuild() {
13001306 . file ( "bar/src/lib.rs" , "" )
13011307 . build ( ) ;
13021308
1303- p. cargo ( "build" ) . run ( ) ;
1304- p. cargo ( "build" )
1309+ p. cargo ( "build -Z mtime-on-use" )
1310+ . masquerade_as_nightly_cargo ( )
1311+ . run ( ) ;
1312+ p. cargo ( "build -Z mtime-on-use" )
1313+ . masquerade_as_nightly_cargo ( )
13051314 . env ( "RUSTFLAGS" , "-C target-cpu=native" )
13061315 . with_stderr (
13071316 "\
@@ -1317,19 +1326,22 @@ fn fingerprint_cleaner_dose_not_rebuild() {
13171326 if is_coarse_mtime ( ) {
13181327 sleep_ms ( 1000 ) ;
13191328 }
1320- // This dose not make new files, but it dose update the mtime.
1321- p. cargo ( "build" )
1329+ // This does not make new files, but it does update the mtime.
1330+ p. cargo ( "build -Z mtime-on-use" )
1331+ . masquerade_as_nightly_cargo ( )
13221332 . env ( "RUSTFLAGS" , "-C target-cpu=native" )
13231333 . with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
13241334 . run ( ) ;
13251335 fingerprint_cleaner ( p. target_debug_dir ( ) , timestamp) ;
13261336 // This should not recompile!
1327- p. cargo ( "build" )
1337+ p. cargo ( "build -Z mtime-on-use" )
1338+ . masquerade_as_nightly_cargo ( )
13281339 . env ( "RUSTFLAGS" , "-C target-cpu=native" )
13291340 . with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
13301341 . run ( ) ;
13311342 // But this should be cleaned and so need a rebuild
1332- p. cargo ( "build" )
1343+ p. cargo ( "build -Z mtime-on-use" )
1344+ . masquerade_as_nightly_cargo ( )
13331345 . with_stderr (
13341346 "\
13351347 [COMPILING] bar v0.0.1 ([..])
0 commit comments