@@ -315,11 +315,13 @@ pub fn prepare_target<'a, 'cfg>(
315
315
/// A compilation unit dependency has a fingerprint that is comprised of:
316
316
/// * its package ID
317
317
/// * its extern crate name
318
+ /// * its public/private status
318
319
/// * its calculated fingerprint for the dependency
319
320
#[ derive( Clone ) ]
320
321
struct DepFingerprint {
321
322
pkg_id : u64 ,
322
323
name : String ,
324
+ public : bool ,
323
325
fingerprint : Arc < Fingerprint > ,
324
326
}
325
327
@@ -429,10 +431,11 @@ impl<'de> Deserialize<'de> for DepFingerprint {
429
431
where
430
432
D : de:: Deserializer < ' de > ,
431
433
{
432
- let ( pkg_id, name, hash) = <( u64 , String , u64 ) >:: deserialize ( d) ?;
434
+ let ( pkg_id, name, public , hash) = <( u64 , String , bool , u64 ) >:: deserialize ( d) ?;
433
435
Ok ( DepFingerprint {
434
436
pkg_id,
435
437
name,
438
+ public,
436
439
fingerprint : Arc :: new ( Fingerprint {
437
440
memoized_hash : Mutex :: new ( Some ( hash) ) ,
438
441
..Fingerprint :: new ( )
@@ -850,11 +853,13 @@ impl hash::Hash for Fingerprint {
850
853
for DepFingerprint {
851
854
pkg_id,
852
855
name,
856
+ public,
853
857
fingerprint,
854
858
} in deps
855
859
{
856
860
pkg_id. hash ( h) ;
857
861
name. hash ( h) ;
862
+ public. hash ( h) ;
858
863
// use memoized dep hashes to avoid exponential blowup
859
864
h. write_u64 ( Fingerprint :: hash ( fingerprint) ) ;
860
865
}
@@ -900,6 +905,7 @@ impl DepFingerprint {
900
905
) -> CargoResult < DepFingerprint > {
901
906
let fingerprint = calculate ( cx, dep) ?;
902
907
let name = cx. bcx . extern_crate_name ( parent, dep) ?;
908
+ let public = cx. bcx . is_public_dependency ( parent, dep) ;
903
909
904
910
// We need to be careful about what we hash here. We have a goal of
905
911
// supporting renaming a project directory and not rebuilding
@@ -920,6 +926,7 @@ impl DepFingerprint {
920
926
Ok ( DepFingerprint {
921
927
pkg_id,
922
928
name,
929
+ public,
923
930
fingerprint,
924
931
} )
925
932
}
0 commit comments