Skip to content

Commit

Permalink
utils: re-export derive_more and remove all other references to it
Browse files Browse the repository at this point in the history
  • Loading branch information
feds01 committed Aug 31, 2023
1 parent faa6e94 commit d916b1b
Show file tree
Hide file tree
Showing 33 changed files with 29 additions and 51 deletions.
9 changes: 0 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions compiler/hash-ast-expand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ edition = "2021"
doctest = false

[dependencies]
derive_more = "0.99"

hash-ast = { path = "../hash-ast" }
hash-attrs = { path = "../hash-attrs" }
hash-fmt = { path = "../hash-fmt" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-ast-expand/src/diagnostics/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Definitions of the various kinds of errors that can occur during the
//! expansion phase of the compiler.
use derive_more::Constructor;
use hash_ast::ast::AstNodeId;
use hash_attrs::{
attr::{AttrArgIdx, AttrValueKind},
Expand All @@ -14,6 +13,7 @@ use hash_reporting::{
};
use hash_source::identifier::Identifier;
use hash_tir::{tys::TyId, utils::params::ParamError};
use hash_utils::derive_more::Constructor;

#[derive(Constructor, Debug)]
pub struct ExpansionError {
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-ast-expand/src/diagnostics/warning.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Compiler warnings that are emitted during AST expansion.
use derive_more::{Constructor, From};
use hash_ast::ast::AstNodeId;
use hash_attrs::diagnostics::AttrWarning;
use hash_reporting::reporter::{Reporter, Reports};
use hash_utils::derive_more::{Constructor, From};

#[derive(Constructor, Debug)]
pub struct ExpansionWarning {
Expand Down
1 change: 0 additions & 1 deletion compiler/hash-attrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
doctest = false

[dependencies]
derive_more = "0.99"
paste = "1.0.14"

hash-ast = { path = "../hash-ast" }
Expand Down
3 changes: 1 addition & 2 deletions compiler/hash-attrs/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use std::{fmt, sync::OnceLock};

use derive_more::From;
use hash_ast::{ast, ast::AstNodeId};
use hash_source::{
constant::{InternedFloat, InternedInt, InternedStr},
Expand All @@ -11,7 +10,7 @@ use hash_source::{
use hash_storage::store::{DefaultPartialStore, PartialStore};
use hash_target::{abi::Integer, data_layout::HasDataLayout, primitives::IntTy};
use hash_tir::params::ParamIndex;
use hash_utils::{fxhash::FxHashMap, lazy_static::lazy_static};
use hash_utils::{derive_more::From, fxhash::FxHashMap, lazy_static::lazy_static};

use crate::{
diagnostics::{AttrError, AttrResult},
Expand Down
1 change: 0 additions & 1 deletion compiler/hash-intrinsics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
doctest = false

[dependencies]
derive_more = "0.99"
num-bigint = "0.4"
num_enum = "0.5"

Expand Down
1 change: 0 additions & 1 deletion compiler/hash-lower/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ doctest = false
[dependencies]
fixedbitset = "0.4.2"
num-traits = "0.2.15"
derive_more = "0.99"

hash-ast = { path = "../hash-ast" }
hash-attrs = { path = "../hash-attrs" }
Expand Down
3 changes: 1 addition & 2 deletions compiler/hash-lower/src/discover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//! For now, non-pure functions are always queued for lowering.
use std::ops::ControlFlow;

use derive_more::Constructor;
use hash_attrs::{attr::attr_store, builtin::attrs};
use hash_pipeline::workspace::StageInfo;
use hash_storage::store::{statics::StoreId, TrivialSequenceStoreKey};
Expand All @@ -17,7 +16,7 @@ use hash_tir::{
terms::TermId,
utils::{traversing::Atom, AccessToUtils},
};
use hash_utils::indexmap::IndexSet;
use hash_utils::{derive_more::Constructor, indexmap::IndexSet};

use crate::ctx::BuilderCtx;

Expand Down
1 change: 0 additions & 1 deletion compiler/hash-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
doctest = false

[dependencies]
derive_more = "0.99"
num-bigint = "0.4"

# For profiling the parser
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-parser/src/diagnostics/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Hash Compiler parser error utilities.
use derive_more::Constructor;
use hash_ast::{ast::TyParamOrigin, origin::PatOrigin};
use hash_pipeline::fs::ImportError;
use hash_reporting::{
Expand All @@ -8,6 +7,7 @@ use hash_reporting::{
};
use hash_source::{identifier::Identifier, location::Span};
use hash_token::TokenKind;
use hash_utils::derive_more::Constructor;

use super::expected::ExpectedItem;

Expand Down
3 changes: 1 addition & 2 deletions compiler/hash-parser/src/diagnostics/warning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
use std::fmt::Display;

use derive_more::Constructor;
use hash_ast::ast::{Expr, TyParamOrigin};
use hash_reporting::reporter::{Reporter, Reports};
use hash_source::location::Span;
use hash_utils::pluralise;
use hash_utils::{derive_more::Constructor, pluralise};

/// Represents a generated warning from within [AstGen][crate::parser::AstGen]
#[derive(Constructor, Debug)]
Expand Down
1 change: 0 additions & 1 deletion compiler/hash-semantics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
doctest = false

[dependencies]
derive_more = "0.99"
num-bigint = "0.4"
once_cell = "1.17"

Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-semantics/src/passes/discovery/defs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Utilities for keeping track of definitions during the discovery pass.
use derive_more::From;
use hash_ast::ast::{self, AstNode, AstNodeId, AstNodeRef};
use hash_reporting::macros::panic_on_span;
use hash_storage::store::{
Expand All @@ -18,6 +17,7 @@ use hash_tir::{
utils::AccessToUtils,
};
use hash_utils::{
derive_more::From,
smallvec::{smallvec, SmallVec},
state::LightState,
};
Expand Down
3 changes: 1 addition & 2 deletions compiler/hash-semantics/src/passes/evaluation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//!
//! Typing errors are reported during this pass.
use derive_more::Constructor;
use hash_ast::ast::{self};
use hash_pipeline::settings::CompilerStageKind;
use hash_source::ModuleKind;
Expand All @@ -16,7 +15,7 @@ use hash_tir::{
utils::common::dump_tir,
};
use hash_typecheck::{normalisation::NormalisationMode, AccessToTypechecking};
use hash_utils::stream_less_writeln;
use hash_utils::{derive_more::Constructor, stream_less_writeln};

use super::ast_utils::AstPass;
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-semantics/src/passes/inference/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//!
//! Typing errors are reported during this pass.
use derive_more::Constructor;
use hash_ast::ast;
use hash_reporting::diagnostic::AccessToDiagnostics;
use hash_tir::{environment::stores::tir_stores, tys::Ty, utils::traversing::Atom};
Expand All @@ -12,6 +11,7 @@ use hash_typecheck::{
inference::FnInferMode,
AccessToTypechecking,
};
use hash_utils::derive_more::Constructor;

use super::ast_utils::AstPass;
use crate::{
Expand Down
1 change: 0 additions & 1 deletion compiler/hash-source/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ doctest = false

[dependencies]
bimap = "0.6.2"
derive_more = "0.99"
fnv = "1.0.7"
num-bigint = "0.4"
once_cell = "1.17"
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-source/src/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
fmt::{self, Display},
};

use derive_more::Constructor;
use hash_utils::derive_more::Constructor;

use crate::SourceId;

Expand Down
1 change: 0 additions & 1 deletion compiler/hash-tir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
doctest = false

[dependencies]
derive_more = "0.99"
num-bigint = "0.4"
textwrap = "0.16"
utility-types = "0.0.2"
Expand Down
3 changes: 1 addition & 2 deletions compiler/hash-tir/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use core::fmt;
use std::fmt::Debug;

use derive_more::From;
use hash_ast::ast;
use hash_storage::{
static_sequence_store_direct,
Expand All @@ -12,7 +11,7 @@ use hash_storage::{
SequenceStore, SequenceStoreKey, TrivialSequenceStoreKey,
},
};
use hash_utils::itertools::Itertools;
use hash_utils::{derive_more::From, itertools::Itertools};

use super::{
locations::{IndexedLocationTarget, LocationTarget},
Expand Down
5 changes: 3 additions & 2 deletions compiler/hash-tir/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ use std::{
ops::Range,
};

use derive_more::From;
use hash_storage::store::{statics::StoreId, SequenceStoreKey, StoreKey, TrivialSequenceStoreKey};
use hash_utils::{fxhash::FxBuildHasher, indexmap::IndexMap, itertools::Itertools};
use hash_utils::{
derive_more::From, fxhash::FxBuildHasher, indexmap::IndexMap, itertools::Itertools,
};

use crate::{
args::{ArgId, ArgsId},
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-tir/src/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::fmt::Display;

use derive_more::From;
use hash_utils::derive_more::From;

use super::{
data::DataDefId, fns::FnDefId, locations::LocationTarget, mods::ModDefId, scopes::StackId,
Expand Down
3 changes: 1 addition & 2 deletions compiler/hash-tir/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use core::fmt;
use std::fmt::Debug;

use derive_more::From;
use hash_source::identifier::Identifier;
use hash_storage::{
static_sequence_store_direct,
Expand All @@ -11,7 +10,7 @@ use hash_storage::{
SequenceStore, SequenceStoreKey, TrivialSequenceStoreKey,
},
};
use hash_utils::itertools::Itertools;
use hash_utils::{derive_more::From, itertools::Itertools};

use super::{
args::{ArgsId, PatArgsId},
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-tir/src/terms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use core::fmt;
use std::fmt::Debug;

use derive_more::From;
use hash_ast::ast;
use hash_storage::{
static_sequence_store_indirect, static_single_store,
Expand All @@ -12,6 +11,7 @@ use hash_storage::{
SequenceStoreKey, TrivialSequenceStoreKey,
},
};
use hash_utils::derive_more::From;

use super::{casting::CastTerm, holes::Hole, symbols::Symbol, tys::TypeOfTerm};
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-tir/src/tys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use core::fmt;
use std::fmt::Debug;

use derive_more::From;
use hash_ast::ast;
use hash_storage::{
static_single_store,
store::statics::{SequenceStoreValue, SingleStoreValue, StoreId},
};
use hash_utils::derive_more::From;

use super::{holes::Hole, symbols::Symbol};
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-tir/src/utils/mods.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Module-related utilities.
use derive_more::Constructor;
use hash_ast::ast::OwnsAstNode;
use hash_source::{identifier::Identifier, ModuleId};
use hash_storage::store::statics::{SequenceStoreValue, SingleStoreValue};
use hash_utils::derive_more::Constructor;

use crate::{
environment::{
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-tir/src/utils/traversing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
use core::fmt;
use std::{cell::RefCell, collections::HashSet, ops::ControlFlow};

use derive_more::{From, TryInto};
use hash_storage::store::{
statics::{SequenceStoreValue, SingleStoreValue, StoreId},
SequenceStoreKey, TrivialSequenceStoreKey,
};
use hash_utils::derive_more::{From, TryInto};

use crate::{
access::AccessTerm,
Expand Down
1 change: 0 additions & 1 deletion compiler/hash-typecheck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
doctest = false

[dependencies]
derive_more = "0.99"
itertools = "0.10"
num-bigint = "0.4"
once_cell = "1.17"
Expand Down
Loading

0 comments on commit d916b1b

Please sign in to comment.