@@ -595,47 +595,47 @@ fn compute_metadata(
595
595
. collect :: < Vec < _ > > ( ) ;
596
596
let use_extra_filename = use_extra_filename ( bcx, unit) ;
597
597
598
- let mut hasher = StableHasher :: new ( ) ;
598
+ let mut shared_hasher = StableHasher :: new ( ) ;
599
599
600
- METADATA_VERSION . hash ( & mut hasher ) ;
600
+ METADATA_VERSION . hash ( & mut shared_hasher ) ;
601
601
602
602
// Unique metadata per (name, source, version) triple. This'll allow us
603
603
// to pull crates from anywhere without worrying about conflicts.
604
604
unit. pkg
605
605
. package_id ( )
606
606
. stable_hash ( bcx. ws . root ( ) )
607
- . hash ( & mut hasher ) ;
607
+ . hash ( & mut shared_hasher ) ;
608
608
609
609
// Also mix in enabled features to our metadata. This'll ensure that
610
610
// when changing feature sets each lib is separately cached.
611
- unit. features . hash ( & mut hasher ) ;
611
+ unit. features . hash ( & mut shared_hasher ) ;
612
612
613
613
// Throw in the profile we're compiling with. This helps caching
614
614
// `panic=abort` and `panic=unwind` artifacts, additionally with various
615
615
// settings like debuginfo and whatnot.
616
- unit. profile . hash ( & mut hasher ) ;
617
- unit. mode . hash ( & mut hasher ) ;
618
- build_runner. lto [ unit] . hash ( & mut hasher ) ;
616
+ unit. profile . hash ( & mut shared_hasher ) ;
617
+ unit. mode . hash ( & mut shared_hasher ) ;
618
+ build_runner. lto [ unit] . hash ( & mut shared_hasher ) ;
619
619
620
620
// Artifacts compiled for the host should have a different
621
621
// metadata piece than those compiled for the target, so make sure
622
622
// we throw in the unit's `kind` as well. Use `fingerprint_hash`
623
623
// so that the StableHash doesn't change based on the pathnames
624
624
// of the custom target JSON spec files.
625
- unit. kind . fingerprint_hash ( ) . hash ( & mut hasher ) ;
625
+ unit. kind . fingerprint_hash ( ) . hash ( & mut shared_hasher ) ;
626
626
627
627
// Finally throw in the target name/kind. This ensures that concurrent
628
628
// compiles of targets in the same crate don't collide.
629
- unit. target . name ( ) . hash ( & mut hasher ) ;
630
- unit. target . kind ( ) . hash ( & mut hasher ) ;
629
+ unit. target . name ( ) . hash ( & mut shared_hasher ) ;
630
+ unit. target . kind ( ) . hash ( & mut shared_hasher ) ;
631
631
632
- hash_rustc_version ( bcx, & mut hasher , unit) ;
632
+ hash_rustc_version ( bcx, & mut shared_hasher , unit) ;
633
633
634
634
if build_runner. bcx . ws . is_member ( & unit. pkg ) {
635
635
// This is primarily here for clippy. This ensures that the clippy
636
636
// artifacts are separate from the `check` ones.
637
637
if let Some ( path) = & build_runner. bcx . rustc ( ) . workspace_wrapper {
638
- path. hash ( & mut hasher ) ;
638
+ path. hash ( & mut shared_hasher ) ;
639
639
}
640
640
}
641
641
@@ -646,7 +646,7 @@ fn compute_metadata(
646
646
. gctx
647
647
. get_env ( "__CARGO_DEFAULT_LIB_METADATA" )
648
648
{
649
- channel. hash ( & mut hasher ) ;
649
+ channel. hash ( & mut shared_hasher ) ;
650
650
}
651
651
652
652
// std units need to be kept separate from user dependencies. std crates
@@ -656,7 +656,7 @@ fn compute_metadata(
656
656
// don't need unstable support. A future experiment might be to set
657
657
// `is_std` to false for build dependencies so that they can be shared
658
658
// with user dependencies.
659
- unit. is_std . hash ( & mut hasher ) ;
659
+ unit. is_std . hash ( & mut shared_hasher ) ;
660
660
661
661
// While we don't hash RUSTFLAGS because it may contain absolute paths that
662
662
// hurts reproducibility, we track whether a unit's RUSTFLAGS is from host
@@ -675,7 +675,7 @@ fn compute_metadata(
675
675
. target_config ( CompileKind :: Host )
676
676
. links_overrides
677
677
!= unit. links_overrides ;
678
- target_configs_are_different. hash ( & mut hasher ) ;
678
+ target_configs_are_different. hash ( & mut shared_hasher ) ;
679
679
}
680
680
681
681
// Mix in the target-metadata of all the dependencies of this target.
@@ -684,9 +684,9 @@ fn compute_metadata(
684
684
. map ( |m| m. meta_hash )
685
685
. collect :: < Vec < _ > > ( ) ;
686
686
dep_hashes. sort ( ) ;
687
- dep_hashes. hash ( & mut hasher ) ;
687
+ dep_hashes. hash ( & mut shared_hasher ) ;
688
688
689
- let meta_hash = UnitHash ( hasher . finish ( ) ) ;
689
+ let meta_hash = UnitHash ( shared_hasher . finish ( ) ) ;
690
690
691
691
Metadata {
692
692
meta_hash,
0 commit comments