build: rearrange dependencies (#399)

This commit is contained in:
Myriad-Dreamin 2024-07-11 11:03:55 +08:00 committed by GitHub
parent 1b769a4ddd
commit 4acc39b237
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 261 additions and 229 deletions

View file

@ -24,8 +24,8 @@ use std::{
use dashmap::{DashMap, SharedValue};
use ecow::EcoString;
use fxhash::FxHasher;
use hashbrown::{hash_map::RawEntryMut, HashMap};
use rustc_hash::FxHasher;
use triomphe::Arc;
use typst::{foundations::Str, syntax::ast::Ident};

View file

@ -15,7 +15,7 @@ use std::ops;
pub use ena::undo_log::Snapshot;
type FxHashMap<K, V> = fxhash::FxHashMap<K, V>;
type FxHashMap<K, V> = rustc_hash::FxHashMap<K, V>;
pub type SnapshotMapStorage<K, V> = SnapshotMap<K, V, FxHashMap<K, V>, ()>;
pub type SnapshotMapRef<'a, K, V, L> = SnapshotMap<K, V, &'a mut FxHashMap<K, V>, &'a mut L>;

View file

@ -21,8 +21,17 @@ pub(crate) use sig::*;
mod tests {
use super::*;
use crate::adt::interner::Interned;
use fxhash::hash64;
use reflexo::vector::ir::DefId;
use rustc_hash::FxHasher;
use std::hash::{Hash, Hasher};
/// A convenience function for when you need a quick 64-bit hash.
#[inline]
pub fn hash64<T: Hash + ?Sized>(v: &T) -> u64 {
let mut state = FxHasher::default();
v.hash(&mut state);
state.finish()
}
pub fn var_ins(s: &str) -> Ty {
Ty::Var(TypeVar::new(s.into(), DefId(hash64(s))))