diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index e0671d6f7ff..3938e08ba76 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -1494,7 +1494,7 @@ impl<'context> Elaborator<'context> { traits: BTreeMap::new(), trait_impls: Vec::new(), globals: Vec::new(), - impls: std::collections::HashMap::new(), + impls: rustc_hash::FxHashMap::default(), }; items.functions = function_sets; diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs index 37ece01c805..e6a98d9264d 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs @@ -31,7 +31,8 @@ use crate::parser::{ParserError, SortedModule}; use fm::FileId; use iter_extended::vecmap; use noirc_errors::{CustomDiagnostic, Span}; -use std::collections::{BTreeMap, HashMap}; +use rustc_hash::FxHashMap as HashMap; +use std::collections::BTreeMap; use std::vec; @@ -253,7 +254,7 @@ impl DefCollector { types: BTreeMap::new(), type_aliases: BTreeMap::new(), traits: BTreeMap::new(), - impls: HashMap::new(), + impls: HashMap::default(), globals: vec![], trait_impls: vec![], }, diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs index c9198a1d04c..3a54771dee8 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs @@ -1,11 +1,12 @@ use std::path::Path; -use std::{collections::HashMap, vec}; +use std::vec; use acvm::{AcirField, FieldElement}; use fm::{FileId, FileManager, FILE_EXTENSION}; use noirc_errors::Location; use num_bigint::BigUint; use num_traits::Num; +use rustc_hash::FxHashMap as HashMap; use crate::ast::{ FunctionDefinition, Ident, ItemVisibility, LetStatement, ModuleDeclaration, NoirFunction, @@ -400,7 +401,7 @@ impl<'a> ModCollector<'a> { self_type: None, }; - let mut method_ids = HashMap::new(); + let mut method_ids = HashMap::default(); for trait_item in &trait_definition.items { match trait_item { TraitItem::Function { diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index e4959cb3dd9..0600706922b 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use rustc_hash::FxHashMap as HashMap; use crate::ast::{Ident, NoirFunction}; use crate::{