@@ -1540,6 +1540,52 @@ fn changing_rustflags_is_cached() {
1540
1540
. run ( ) ;
1541
1541
}
1542
1542
1543
+ #[ cargo_test( nightly, reason = "requires -Zchecksum-hash-algorithm" ) ]
1544
+ fn changing_rustc_extra_flags_is_cached ( ) {
1545
+ let p = project ( ) . file ( "src/lib.rs" , "" ) . build ( ) ;
1546
+
1547
+ // This isn't ever cached, we always have to recompile
1548
+ p. cargo ( "rustc -Zchecksum-freshness" )
1549
+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
1550
+ . with_stderr_data ( str![ [ r#"
1551
+ [COMPILING] foo v0.0.1 ([ROOT]/foo)
1552
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1553
+
1554
+ "# ] ] )
1555
+ . run ( ) ;
1556
+ p. cargo ( "rustc -Zchecksum-freshness -v -- -C linker=cc" )
1557
+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
1558
+ . with_stderr_data ( str![ [ r#"
1559
+ [DIRTY] foo v0.0.1 ([ROOT]/foo): the profile configuration changed
1560
+ [COMPILING] foo v0.0.1 ([ROOT]/foo)
1561
+ [RUNNING] `rustc [..]
1562
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1563
+
1564
+ "# ] ] )
1565
+ . run ( ) ;
1566
+
1567
+ p. cargo ( "rustc -Zchecksum-freshness -v" )
1568
+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
1569
+ . with_stderr_data ( str![ [ r#"
1570
+ [DIRTY] foo v0.0.1 ([ROOT]/foo): the profile configuration changed
1571
+ [COMPILING] foo v0.0.1 ([ROOT]/foo)
1572
+ [RUNNING] `rustc [..] src/lib.rs [..]
1573
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1574
+
1575
+ "# ] ] )
1576
+ . run ( ) ;
1577
+ p. cargo ( "rustc -Zchecksum-freshness -v -- -C linker=cc" )
1578
+ . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
1579
+ . with_stderr_data ( str![ [ r#"
1580
+ [DIRTY] foo v0.0.1 ([ROOT]/foo): the profile configuration changed
1581
+ [COMPILING] foo v0.0.1 ([ROOT]/foo)
1582
+ [RUNNING] `rustc [..]
1583
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1584
+
1585
+ "# ] ] )
1586
+ . run ( ) ;
1587
+ }
1588
+
1543
1589
#[ cargo_test( nightly, reason = "requires -Zchecksum-hash-algorithm" ) ]
1544
1590
fn reuse_panic_build_dep_test ( ) {
1545
1591
let p = project ( )
0 commit comments