@@ -43,7 +43,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
4343use rustc_serialize:: opaque:: { FileEncoder , MemDecoder } ;
4444use rustc_serialize:: { Decodable , Decoder , Encodable , Encoder } ;
4545use tracing:: debug;
46- use xxhash_rust :: xxh3;
46+ use twox_hash :: xxh3:: { self , HasherExt } ;
4747
4848mod caching_source_map_view;
4949pub mod source_map;
@@ -78,7 +78,7 @@ use rustc_data_structures::sync::{FreezeLock, FreezeWriteGuard, Lock, Lrc};
7878use std:: borrow:: Cow ;
7979use std:: cmp:: { self , Ordering } ;
8080use std:: fmt:: Display ;
81- use std:: hash:: Hash ;
81+ use std:: hash:: { Hash , Hasher } ;
8282use std:: io:: { self , Read } ;
8383use std:: ops:: { Add , Range , Sub } ;
8484use std:: path:: { Path , PathBuf } ;
@@ -1531,7 +1531,7 @@ impl SourceFileHash {
15311531 value. copy_from_slice ( & Sha256 :: digest ( data) ) ;
15321532 }
15331533 SourceFileHashAlgorithm :: XxHash => {
1534- value. copy_from_slice ( & xxh3:: xxh3_128 ( data) . to_be_bytes ( ) ) ;
1534+ value. copy_from_slice ( & xxh3:: hash128 ( data) . to_be_bytes ( ) ) ;
15351535 }
15361536 } ;
15371537 hash
@@ -1569,9 +1569,9 @@ impl SourceFileHash {
15691569 match kind {
15701570 SourceFileHashAlgorithm :: XxHash => {
15711571 digest (
1572- xxh3:: Xxh3 :: new ( ) ,
1573- |h, b| h. update ( b) ,
1574- |h, out| out. copy_from_slice ( & h. digest128 ( ) . to_be_bytes ( ) ) ,
1572+ xxh3:: Hash128 :: default ( ) ,
1573+ |h, b| h. write ( b) ,
1574+ |h, out| out. copy_from_slice ( & h. finish_ext ( ) . to_be_bytes ( ) ) ,
15751575 src,
15761576 & mut buf,
15771577 value,
0 commit comments