diff --git a/compiler/hash-ast-expand/src/attr.rs b/compiler/hash-ast-expand/src/attr.rs index 8cc8f3547..30faf9b2e 100644 --- a/compiler/hash-ast-expand/src/attr.rs +++ b/compiler/hash-ast-expand/src/attr.rs @@ -17,11 +17,8 @@ use hash_target::HasTarget; use hash_tir::{ intrinsics::definitions::Primitive, tir::{ - args::Arg, - lits::{CharLit, FloatLit, IntLit, Lit, StrLit}, - node::{Node, NodeOrigin}, - params::{utils::validate_and_reorder_args_against_params, ParamIndex}, - terms::{Term, Ty, TyId}, + validate_and_reorder_args_against_params, Arg, CharLit, FloatLit, IntLit, Lit, Node, + NodeOrigin, ParamIndex, StrLit, Term, Ty, TyId, }, }; diff --git a/compiler/hash-ast-expand/src/diagnostics/error.rs b/compiler/hash-ast-expand/src/diagnostics/error.rs index ca09e77e7..23389c961 100644 --- a/compiler/hash-ast-expand/src/diagnostics/error.rs +++ b/compiler/hash-ast-expand/src/diagnostics/error.rs @@ -12,7 +12,7 @@ use hash_reporting::{ reporter::{Reporter, Reports}, }; use hash_source::identifier::Identifier; -use hash_tir::tir::{params::utils::ParamError, terms::TyId}; +use hash_tir::tir::{ParamError, TyId}; use hash_utils::derive_more::{Constructor, From}; #[derive(Constructor, Debug)] diff --git a/compiler/hash-ast-utils/src/pretty/mod.rs b/compiler/hash-ast-utils/src/pretty/mod.rs index 7db74eee2..d5603bf38 100644 --- a/compiler/hash-ast-utils/src/pretty/mod.rs +++ b/compiler/hash-ast-utils/src/pretty/mod.rs @@ -7,7 +7,9 @@ mod state; use collection::CollectionPrintingOptions; use config::AstPrintingConfig; use hash_ast::{ - ast::{self, walk_mut_self, AstVisitorMutSelf, ParamOrigin}, + ast::{ + walk_mut_self, AstVisitorMutSelf, ParamOrigin, {self}, + }, ast_visitor_mut_self_default_impl, }; use hash_token::{delimiter::Delimiter, FloatLitKind, IntLitKind}; diff --git a/compiler/hash-attrs/src/attr.rs b/compiler/hash-attrs/src/attr.rs index 2f63e61f6..43f2dd765 100644 --- a/compiler/hash-attrs/src/attr.rs +++ b/compiler/hash-attrs/src/attr.rs @@ -13,7 +13,7 @@ use hash_source::{ }; use hash_storage::store::{DefaultPartialStore, PartialStore}; use hash_target::{abi::Integer, data_layout::HasDataLayout, primitives::IntTy, size::Size}; -use hash_tir::tir::params::ParamIndex; +use hash_tir::tir::ParamIndex; use hash_utils::{derive_more::From, fxhash::FxHashMap, lazy_static::lazy_static}; use crate::{ diff --git a/compiler/hash-attrs/src/ty.rs b/compiler/hash-attrs/src/ty.rs index 4780b0800..1d2b83684 100644 --- a/compiler/hash-attrs/src/ty.rs +++ b/compiler/hash-attrs/src/ty.rs @@ -4,7 +4,7 @@ use hash_ast_utils::attr::AttrTarget; use hash_source::identifier::Identifier; -use hash_tir::tir::params::ParamsId; +use hash_tir::tir::ParamsId; use hash_utils::{ fxhash::FxHashMap, index_vec::{define_index_type, IndexVec}, diff --git a/compiler/hash-codegen-llvm/src/translation/constants.rs b/compiler/hash-codegen-llvm/src/translation/constants.rs index 770632c7e..243301e62 100644 --- a/compiler/hash-codegen-llvm/src/translation/constants.rs +++ b/compiler/hash-codegen-llvm/src/translation/constants.rs @@ -6,7 +6,9 @@ use hash_codegen::{ }, traits::{constants::ConstValueBuilderMethods, ty::TypeBuilderMethods}, }; -use hash_ir::constant::{self, AllocRange}; +use hash_ir::constant::{ + AllocRange, {self}, +}; use hash_source::constant::{InternedStr, Size}; use hash_storage::store::statics::StoreId; use inkwell::{ diff --git a/compiler/hash-codegen/src/lower/locals.rs b/compiler/hash-codegen/src/lower/locals.rs index d1cddaf8f..b9fc6d59a 100644 --- a/compiler/hash-codegen/src/lower/locals.rs +++ b/compiler/hash-codegen/src/lower/locals.rs @@ -7,7 +7,9 @@ use core::fmt; use fixedbitset::FixedBitSet; use hash_ir::{ - ir::{self, IrRef, Local, PlaceProjection, START_BLOCK}, + ir::{ + IrRef, Local, PlaceProjection, START_BLOCK, {self}, + }, traversal, visitor::{ImmutablePlaceContext, IrVisitorMut, MutablePlaceContext, PlaceContext}, }; diff --git a/compiler/hash-codegen/src/lower/mod.rs b/compiler/hash-codegen/src/lower/mod.rs index 83aea8545..ebe2551f6 100644 --- a/compiler/hash-codegen/src/lower/mod.rs +++ b/compiler/hash-codegen/src/lower/mod.rs @@ -8,7 +8,9 @@ use std::iter; use fixedbitset::FixedBitSet; use hash_abi::{FnAbiId, PassMode}; use hash_ir::{ - ir::{self, Local}, + ir::{ + Local, {self}, + }, traversal, ty::InstanceId, }; diff --git a/compiler/hash-codegen/src/lower/operands.rs b/compiler/hash-codegen/src/lower/operands.rs index d130fabf3..d39b9f928 100644 --- a/compiler/hash-codegen/src/lower/operands.rs +++ b/compiler/hash-codegen/src/lower/operands.rs @@ -8,7 +8,9 @@ use hash_ir::{ use hash_layout::TyInfo; use hash_storage::store::statics::StoreId; use hash_target::{ - abi::{self, AbiRepresentation}, + abi::{ + AbiRepresentation, {self}, + }, alignment::Alignment, size::Size, }; diff --git a/compiler/hash-codegen/src/lower/place.rs b/compiler/hash-codegen/src/lower/place.rs index 1e38da0e9..2cc6a5b29 100644 --- a/compiler/hash-codegen/src/lower/place.rs +++ b/compiler/hash-codegen/src/lower/place.rs @@ -2,7 +2,9 @@ //! IR. use hash_ir::{ - ir::{self, ProjectionId}, + ir::{ + ProjectionId, {self}, + }, ty::{IrTyId, PlaceTy, VariantIdx}, }; use hash_layout::{LayoutShape, Variants}; diff --git a/compiler/hash-codegen/src/lower/rvalue.rs b/compiler/hash-codegen/src/lower/rvalue.rs index 2f2d2d02b..4a8949df0 100644 --- a/compiler/hash-codegen/src/lower/rvalue.rs +++ b/compiler/hash-codegen/src/lower/rvalue.rs @@ -5,8 +5,12 @@ use std::cmp::Ordering; use hash_ir::{ cast::{CastTy, IntCastKind}, - ir::{self, BinOp, RValue}, - ty::{self, IrTyId, RefKind, VariantIdx, COMMON_IR_TYS}, + ir::{ + BinOp, RValue, {self}, + }, + ty::{ + IrTyId, RefKind, VariantIdx, COMMON_IR_TYS, {self}, + }, }; use hash_storage::store::statics::StoreId; diff --git a/compiler/hash-codegen/src/traits/misc.rs b/compiler/hash-codegen/src/traits/misc.rs index 7e8864ead..98f5e4340 100644 --- a/compiler/hash-codegen/src/traits/misc.rs +++ b/compiler/hash-codegen/src/traits/misc.rs @@ -4,7 +4,9 @@ //! entry point of the program. use hash_abi::FnAbi; -use hash_ir::ty::{self, InstanceId}; +use hash_ir::ty::{ + InstanceId, {self}, +}; use super::BackendTypes; diff --git a/compiler/hash-exhaustiveness/src/constant.rs b/compiler/hash-exhaustiveness/src/constant.rs index 3e7e23ded..9cb94f7fd 100644 --- a/compiler/hash-exhaustiveness/src/constant.rs +++ b/compiler/hash-exhaustiveness/src/constant.rs @@ -3,7 +3,7 @@ //! used within the exhaustiveness sub-system to represent these values within //! a single data type. use hash_source::constant::InternedInt; -use hash_tir::tir::terms::TyId; +use hash_tir::tir::TyId; #[derive(Debug, Clone, Copy)] pub struct Constant { diff --git a/compiler/hash-exhaustiveness/src/construct.rs b/compiler/hash-exhaustiveness/src/construct.rs index 96f4a46aa..0e62a08ba 100644 --- a/compiler/hash-exhaustiveness/src/construct.rs +++ b/compiler/hash-exhaustiveness/src/construct.rs @@ -24,15 +24,13 @@ //! //! In other words, all the possible (valid) values of the `char` type. //! A similar process occurs with all other wildcard types, -use std::fmt::{self, Debug}; +use std::fmt::{ + Debug, {self}, +}; use hash_source::constant::InternedStr; use hash_storage::store::{statics::StoreId, SequenceStoreKey, Store}; -use hash_tir::tir::{ - data::{CtorDefId, DataTy}, - node::NodesId, - terms::{tuples::TupleTy, Ty}, -}; +use hash_tir::tir::{CtorDefId, DataTy, NodesId, TupleTy, Ty}; use hash_utils::smallvec::{smallvec, SmallVec}; use super::range::{IntRange, SplitIntRange}; diff --git a/compiler/hash-exhaustiveness/src/deconstruct.rs b/compiler/hash-exhaustiveness/src/deconstruct.rs index 1d93cc8ba..883e251ee 100644 --- a/compiler/hash-exhaustiveness/src/deconstruct.rs +++ b/compiler/hash-exhaustiveness/src/deconstruct.rs @@ -6,18 +6,15 @@ //! [DeconstructedPat]s stored within the `fields` parameter of the structure. use std::{ cell::Cell, - fmt::{self, Debug}, + fmt::{ + Debug, {self}, + }, }; use hash_storage::store::{statics::StoreId, Store}; use hash_tir::{ intrinsics::utils::try_use_ty_as_array_ty, - tir::{ - data::{CtorDefId, DataTy}, - node::NodesId, - pats::PatId, - terms::{Ty, TyId}, - }, + tir::{CtorDefId, DataTy, NodesId, PatId, Ty, TyId}, }; use hash_utils::{itertools::Itertools, smallvec::SmallVec}; diff --git a/compiler/hash-exhaustiveness/src/diagnostics.rs b/compiler/hash-exhaustiveness/src/diagnostics.rs index 09979d2a8..0ed5284db 100644 --- a/compiler/hash-exhaustiveness/src/diagnostics.rs +++ b/compiler/hash-exhaustiveness/src/diagnostics.rs @@ -7,7 +7,7 @@ use hash_reporting::{ reporter::Reporter, }; use hash_source::location::Span; -use hash_tir::tir::{lits::LitPat, node::HasAstNodeId, pats::PatId}; +use hash_tir::tir::{HasAstNodeId, LitPat, PatId}; use hash_utils::{ itertools::Itertools, pluralise, diff --git a/compiler/hash-exhaustiveness/src/fields.rs b/compiler/hash-exhaustiveness/src/fields.rs index 71fc008ef..ef4178930 100644 --- a/compiler/hash-exhaustiveness/src/fields.rs +++ b/compiler/hash-exhaustiveness/src/fields.rs @@ -10,11 +10,7 @@ use hash_storage::store::{statics::StoreId, Store}; use hash_tir::{ intrinsics::utils::try_use_ty_as_array_ty, - tir::{ - data::{CtorDefId, DataDefCtors, DataTy}, - node::NodesId, - terms::{tuples::TupleTy, Ty, TyId}, - }, + tir::{CtorDefId, DataDefCtors, DataTy, NodesId, TupleTy, Ty, TyId}, }; use hash_utils::itertools::Itertools; diff --git a/compiler/hash-exhaustiveness/src/lib.rs b/compiler/hash-exhaustiveness/src/lib.rs index dba07627e..73eaa56fc 100644 --- a/compiler/hash-exhaustiveness/src/lib.rs +++ b/compiler/hash-exhaustiveness/src/lib.rs @@ -73,7 +73,7 @@ use hash_reporting::diagnostic::Diagnostics; use hash_source::location::Span; use hash_storage::store::CloneStore; use hash_target::HasTarget; -use hash_tir::tir::{pats::PatId, terms::TyId}; +use hash_tir::tir::{PatId, TyId}; use hash_utils::derive_more::Deref; use storage::{ DeconstructedCtorId, DeconstructedCtorStore, DeconstructedPatId, DeconstructedPatStore, diff --git a/compiler/hash-exhaustiveness/src/lower.rs b/compiler/hash-exhaustiveness/src/lower.rs index ee427d099..90e2f9101 100644 --- a/compiler/hash-exhaustiveness/src/lower.rs +++ b/compiler/hash-exhaustiveness/src/lower.rs @@ -17,19 +17,9 @@ use hash_tir::{ scopes::BindingPat, term_as_variant, tir::{ - args::{PatArg, PatArgsId, PatOrCapture}, - data::{ArrayCtorInfo, CtorDefId, CtorPat, DataTy}, - lits::{CharLit, IntLit, Lit, LitPat, StrLit}, - node::{Node, NodeOrigin, NodesId}, - params::{ParamId, ParamsId}, - pats::{Pat, PatId, RangePat, Spread}, - symbols::SymbolId, - terms::{ - arrays::ArrayPat, - control::{IfPat, OrPat}, - tuples::{TuplePat, TupleTy}, - Ty, TyId, - }, + ArrayCtorInfo, ArrayPat, CharLit, CtorDefId, CtorPat, DataTy, IfPat, IntLit, Lit, LitPat, + Node, NodeOrigin, NodesId, OrPat, ParamId, ParamsId, Pat, PatArg, PatArgsId, PatId, + PatOrCapture, RangePat, Spread, StrLit, SymbolId, TuplePat, TupleTy, Ty, TyId, }, }; use hash_utils::{itertools::Itertools, smallvec::SmallVec}; diff --git a/compiler/hash-exhaustiveness/src/range.rs b/compiler/hash-exhaustiveness/src/range.rs index 1524f8380..13ae84d56 100644 --- a/compiler/hash-exhaustiveness/src/range.rs +++ b/compiler/hash-exhaustiveness/src/range.rs @@ -40,10 +40,7 @@ use hash_reporting::diagnostic::Diagnostics; use hash_storage::store::Store; use hash_tir::{ intrinsics::utils::try_use_ty_as_int_ty, - tir::{ - pats::{PatId, RangePat}, - terms::TyId, - }, + tir::{PatId, RangePat, TyId}, }; use crate::{ diff --git a/compiler/hash-exhaustiveness/src/stack.rs b/compiler/hash-exhaustiveness/src/stack.rs index 489796c0c..84ae6c2a6 100644 --- a/compiler/hash-exhaustiveness/src/stack.rs +++ b/compiler/hash-exhaustiveness/src/stack.rs @@ -4,7 +4,9 @@ //! transformations, and [StackOps] contains functions //! that are relevant to the usefulness and exhaustiveness //! algorithm. -use std::fmt::{self, Debug}; +use std::fmt::{ + Debug, {self}, +}; use hash_utils::smallvec::{smallvec, SmallVec}; diff --git a/compiler/hash-exhaustiveness/src/usefulness.rs b/compiler/hash-exhaustiveness/src/usefulness.rs index 68ac452f9..1f55e358e 100644 --- a/compiler/hash-exhaustiveness/src/usefulness.rs +++ b/compiler/hash-exhaustiveness/src/usefulness.rs @@ -8,7 +8,7 @@ use std::iter::once; use hash_storage::store::Store; -use hash_tir::tir::{pats::PatId, terms::TyId}; +use hash_tir::tir::{PatId, TyId}; use hash_utils::{itertools::Itertools, stack::ensure_sufficient_stack}; use super::{ @@ -113,7 +113,7 @@ pub(crate) struct MatchArm { /// Whether the arm has an `if-guard`. pub(crate) has_guard: bool, - /// The corresponding [hash_tir::tir::pats::Pat] with this + /// The corresponding [hash_tir::tir::Pat] with this /// match arm. pub(crate) id: PatId, } diff --git a/compiler/hash-exhaustiveness/src/wildcard.rs b/compiler/hash-exhaustiveness/src/wildcard.rs index 9c749852d..90a6bc056 100644 --- a/compiler/hash-exhaustiveness/src/wildcard.rs +++ b/compiler/hash-exhaustiveness/src/wildcard.rs @@ -8,10 +8,7 @@ use hash_storage::store::{statics::StoreId, SequenceStoreKey, Store, TrivialSequ use hash_target::size::Size; use hash_tir::{ intrinsics::utils::try_use_ty_as_int_ty, - tir::{ - data::{DataDefCtors, DataTy, NumericCtorBits, PrimitiveCtorInfo}, - terms::Ty, - }, + tir::{DataDefCtors, DataTy, NumericCtorBits, PrimitiveCtorInfo, Ty}, }; use hash_utils::smallvec::{smallvec, SmallVec}; diff --git a/compiler/hash-ir-utils/src/lib.rs b/compiler/hash-ir-utils/src/lib.rs index c72bf9875..905f9071e 100644 --- a/compiler/hash-ir-utils/src/lib.rs +++ b/compiler/hash-ir-utils/src/lib.rs @@ -13,7 +13,9 @@ pub mod pretty; use std::{ fmt, - io::{self, Write}, + io::{ + Write, {self}, + }, iter, ops::Deref, }; diff --git a/compiler/hash-ir/src/basic_blocks.rs b/compiler/hash-ir/src/basic_blocks.rs index 6590e29fd..84b0f3c1b 100644 --- a/compiler/hash-ir/src/basic_blocks.rs +++ b/compiler/hash-ir/src/basic_blocks.rs @@ -8,8 +8,8 @@ use std::{cell::OnceCell, fmt}; use hash_utils::{ graph::{ - self, dominators::{dominators, Dominators}, + {self}, }, index_vec::IndexVec, smallvec::{smallvec, SmallVec}, diff --git a/compiler/hash-ir/src/constant.rs b/compiler/hash-ir/src/constant.rs index 86077eea8..c53f039b1 100644 --- a/compiler/hash-ir/src/constant.rs +++ b/compiler/hash-ir/src/constant.rs @@ -15,7 +15,7 @@ use hash_storage::{static_single_store, store::statics::StoreId}; use hash_target::{ alignment::Alignment, data_layout::HasDataLayout, primitives::IntTy, size::Size, }; -use hash_tir::tir::lits::Lit; +use hash_tir::tir::Lit; use hash_utils::derive_more::Constructor; use crate::{ diff --git a/compiler/hash-ir/src/ir.rs b/compiler/hash-ir/src/ir.rs index dc354d507..7f68959fa 100644 --- a/compiler/hash-ir/src/ir.rs +++ b/compiler/hash-ir/src/ir.rs @@ -3,7 +3,9 @@ use core::slice; use std::{ fmt, - iter::{self, once}, + iter::{ + once, {self}, + }, }; use hash_ast::ast::AstNodeId; @@ -21,7 +23,9 @@ use hash_tir::intrinsics::definitions::{ }; use hash_utils::{ graph::dominators::Dominators, - index_vec::{self, IndexVec}, + index_vec::{ + IndexVec, {self}, + }, smallvec::{smallvec, SmallVec}, }; diff --git a/compiler/hash-ir/src/lib.rs b/compiler/hash-ir/src/lib.rs index df47fb001..f3fd0628b 100644 --- a/compiler/hash-ir/src/lib.rs +++ b/compiler/hash-ir/src/lib.rs @@ -29,10 +29,7 @@ use hash_source::entry_point::EntryPointState; use hash_storage::{store::SequenceStoreKey, stores}; use hash_tir::{ intrinsics::definitions::Intrinsic as TirIntrinsic, - tir::{ - data::{DataDefId, DataTy}, - terms::{fns::FnDefId, TyId}, - }, + tir::{DataDefId, DataTy, FnDefId, TyId}, }; use hash_utils::fxhash::FxHashMap; use intrinsics::Intrinsics; diff --git a/compiler/hash-ir/src/ty.rs b/compiler/hash-ir/src/ty.rs index d8dd2954e..dcd5f5b74 100644 --- a/compiler/hash-ir/src/ty.rs +++ b/compiler/hash-ir/src/ty.rs @@ -6,7 +6,9 @@ use std::{ cmp, - fmt::{self, Debug}, + fmt::{ + Debug, {self}, + }, }; use hash_ast::ast; @@ -28,14 +30,18 @@ use hash_storage::{ }, }; use hash_target::{ - abi::{self, Abi, Integer, ScalarKind}, + abi::{ + Abi, Integer, ScalarKind, {self}, + }, data_layout::HasDataLayout, primitives::BigIntTy, size::Size, }; use hash_utils::{ bitflags::bitflags, - index_vec::{self, index_vec, IndexVec}, + index_vec::{ + index_vec, IndexVec, {self}, + }, lazy_static, }; diff --git a/compiler/hash-lexer/src/lib.rs b/compiler/hash-lexer/src/lib.rs index 7e2fecb61..b569e4108 100644 --- a/compiler/hash-lexer/src/lib.rs +++ b/compiler/hash-lexer/src/lib.rs @@ -6,10 +6,9 @@ use std::cell::Cell; use error::{LexerDiagnostics, LexerError, LexerErrorKind, LexerResult, NumericLitKind}; use hash_reporting::diagnostic::AccessToDiagnosticsMut; use hash_source::{ - self, identifier::{Identifier, IDENTS}, location::{ByteRange, Span, SpannedSource}, - SourceId, + SourceId, {self}, }; use hash_target::primitives::{FloatTy, IntTy}; use hash_token::{ diff --git a/compiler/hash-link/src/lib.rs b/compiler/hash-link/src/lib.rs index 71b714a6c..13d86349a 100644 --- a/compiler/hash-link/src/lib.rs +++ b/compiler/hash-link/src/lib.rs @@ -9,7 +9,9 @@ pub(crate) mod platform; use std::{ fs, - io::{self, Write}, + io::{ + Write, {self}, + }, path::{Path, PathBuf}, process::{Output, Stdio}, time::Duration, diff --git a/compiler/hash-lower/src/build/block.rs b/compiler/hash-lower/src/build/block.rs index 5df15bd7c..09d679b4f 100644 --- a/compiler/hash-lower/src/build/block.rs +++ b/compiler/hash-lower/src/build/block.rs @@ -12,13 +12,7 @@ use hash_storage::store::{statics::StoreId, TrivialSequenceStoreKey}; use hash_tir::{ context::{Context, ScopeKind}, scopes::{BlockStatement, BlockTerm}, - tir::{ - node::HasAstNodeId, - terms::{ - control::{LoopTerm, MatchTerm}, - Term, TermId, - }, - }, + tir::{HasAstNodeId, LoopTerm, MatchTerm, Term, TermId}, }; use super::{BlockAnd, BlockAndExtend, BodyBuilder, LoopBlockInfo}; diff --git a/compiler/hash-lower/src/build/category.rs b/compiler/hash-lower/src/build/category.rs index bee8da40a..4a07df8fd 100644 --- a/compiler/hash-lower/src/build/category.rs +++ b/compiler/hash-lower/src/build/category.rs @@ -1,7 +1,7 @@ //! Defines a category of AST expressions which can be used to determine how to //! lower them throughout the lowering stage. -use hash_tir::tir::terms::{Term, Ty}; +use hash_tir::tir::{Term, Ty}; /// A [Category] represents what category [ast::Expr]s belong to /// when they are being lowered. Depending on the category, we diff --git a/compiler/hash-lower/src/build/constant.rs b/compiler/hash-lower/src/build/constant.rs index 97a78d540..4f608749b 100644 --- a/compiler/hash-lower/src/build/constant.rs +++ b/compiler/hash-lower/src/build/constant.rs @@ -5,11 +5,7 @@ use hash_ir::ir; use hash_reporting::macros::panic_on_span; use hash_storage::store::statics::StoreId; -use hash_tir::tir::{ - lits::LitId, - node::HasAstNodeId, - terms::{Term, TermId}, -}; +use hash_tir::tir::{HasAstNodeId, LitId, Term, TermId}; use super::BodyBuilder; diff --git a/compiler/hash-lower/src/build/into.rs b/compiler/hash-lower/src/build/into.rs index d1a287423..2bb881bbb 100644 --- a/compiler/hash-lower/src/build/into.rs +++ b/compiler/hash-lower/src/build/into.rs @@ -7,8 +7,8 @@ use hash_ast::ast::AstNodeId; use hash_ir::{ intrinsics::Intrinsic, ir::{ - self, AggregateKind, BasicBlock, Const, LogicalBinOp, Operand, Place, RValue, Statement, - StatementKind, TerminatorKind, + AggregateKind, BasicBlock, Const, LogicalBinOp, Operand, Place, RValue, Statement, + StatementKind, TerminatorKind, {self}, }, ty::{AdtId, IrTy, IrTyId, Mutability, RefKind, VariantIdx, COMMON_IR_TYS}, }; @@ -21,18 +21,8 @@ use hash_tir::{ scopes::AssignTerm, term_as_variant, tir::{ - args::ArgsId, - data::CtorTerm, - node::NodesId, - params::ParamIndex, - terms::{ - arrays::ArrayTerm, - control::{LoopControlTerm, ReturnTerm}, - fns::CallTerm, - refs::{self, RefTerm}, - tuples::TupleTerm, - Term, TermId, Ty, UnsafeTerm, - }, + ArgsId, ArrayTerm, CallTerm, CtorTerm, LoopControlTerm, NodesId, ParamIndex, RefTerm, + ReturnTerm, Term, TermId, TupleTerm, Ty, UnsafeTerm, {self}, }, }; use hash_utils::itertools::Itertools; @@ -304,9 +294,9 @@ impl<'tcx> BodyBuilder<'tcx> { // the type of the expression, and where the expression comes // from. let kind = match kind { - refs::RefKind::Local => RefKind::Normal, - refs::RefKind::Raw => RefKind::Raw, - refs::RefKind::Rc => RefKind::Rc, + tir::RefKind::Local => RefKind::Normal, + tir::RefKind::Raw => RefKind::Raw, + tir::RefKind::Rc => RefKind::Rc, }; let place = unpack!(block = self.as_place(block, subject, mutability)); diff --git a/compiler/hash-lower/src/build/matches/candidate.rs b/compiler/hash-lower/src/build/matches/candidate.rs index 36f606593..db69e28b7 100644 --- a/compiler/hash-lower/src/build/matches/candidate.rs +++ b/compiler/hash-lower/src/build/matches/candidate.rs @@ -13,7 +13,9 @@ use std::{borrow::Borrow, mem}; -use hash_ast::ast::{self, AstNodeId}; +use hash_ast::ast::{ + AstNodeId, {self}, +}; use hash_ir::{ ir::{BasicBlock, Place, PlaceProjection}, ty::{AdtId, IrTy, Mutability}, @@ -24,15 +26,7 @@ use hash_tir::{ atom_info::ItemInAtomInfo, scopes::BindingPat, tir::{ - args::PatArgsId, - data::CtorPat, - params::ParamIndex, - pats::{Pat, PatId, RangePat}, - symbols::SymbolId, - terms::{ - control::{IfPat, MatchCase}, - tuples::TuplePat, - }, + CtorPat, IfPat, MatchCase, ParamIndex, Pat, PatArgsId, PatId, RangePat, SymbolId, TuplePat, }, }; use hash_utils::{ diff --git a/compiler/hash-lower/src/build/matches/const_range.rs b/compiler/hash-lower/src/build/matches/const_range.rs index 519d84f2b..5b506feac 100644 --- a/compiler/hash-lower/src/build/matches/const_range.rs +++ b/compiler/hash-lower/src/build/matches/const_range.rs @@ -6,14 +6,16 @@ use std::cmp::Ordering; use hash_ast::ast; use hash_ir::{ constant::ConstKind, - ir::{self, Const}, + ir::{ + Const, {self}, + }, ty::{IrTy, IrTyId}, }; use hash_ir_utils::const_utils::ConstUtils; use hash_layout::compute::LayoutComputer; use hash_storage::store::statics::StoreId; use hash_target::{data_layout::HasDataLayout, primitives::FloatTy}; -use hash_tir::tir::pats::RangePat; +use hash_tir::tir::RangePat; use crate::build::BodyBuilder; diff --git a/compiler/hash-lower/src/build/matches/declarations.rs b/compiler/hash-lower/src/build/matches/declarations.rs index 3eafec5a4..9e0fa8dba 100644 --- a/compiler/hash-lower/src/build/matches/declarations.rs +++ b/compiler/hash-lower/src/build/matches/declarations.rs @@ -10,18 +10,7 @@ use hash_reporting::macros::panic_on_span; use hash_storage::store::{statics::StoreId, TrivialSequenceStoreKey}; use hash_tir::{ scopes::{BindingPat, Decl}, - tir::{ - data::CtorPat, - node::NodesId, - pats::{Pat, PatId}, - symbols::SymbolId, - terms::{ - arrays::ArrayPat, - control::{IfPat, OrPat}, - tuples::TuplePat, - TermId, - }, - }, + tir::{ArrayPat, CtorPat, IfPat, NodesId, OrPat, Pat, PatId, SymbolId, TermId, TuplePat}, }; use super::{candidate::Candidate, BlockAnd, BodyBuilder}; diff --git a/compiler/hash-lower/src/build/matches/mod.rs b/compiler/hash-lower/src/build/matches/mod.rs index de5306c82..2cd2e4dc7 100644 --- a/compiler/hash-lower/src/build/matches/mod.rs +++ b/compiler/hash-lower/src/build/matches/mod.rs @@ -10,22 +10,19 @@ mod test; use std::mem; -use hash_ast::ast::{self, AstNodeId}; +use hash_ast::ast::{ + AstNodeId, {self}, +}; use hash_ir::{ - ir::{self, BasicBlock, LogicalBinOp, Place, RValue, TerminatorKind}, + ir::{ + BasicBlock, LogicalBinOp, Place, RValue, TerminatorKind, {self}, + }, ty::{Mutability, RefKind}, }; use hash_storage::store::statics::StoreId; use hash_tir::{ context::{Context, ScopeKind}, - tir::{ - node::NodesId, - pats::{Pat, PatId}, - terms::{ - control::{IfPat, MatchCasesId}, - Term, TermId, - }, - }, + tir::{IfPat, MatchCasesId, NodesId, Pat, PatId, Term, TermId}, }; use hash_utils::{itertools::Itertools, stack::ensure_sufficient_stack}; diff --git a/compiler/hash-lower/src/build/matches/optimise.rs b/compiler/hash-lower/src/build/matches/optimise.rs index 088f8fb70..80dcde0bc 100644 --- a/compiler/hash-lower/src/build/matches/optimise.rs +++ b/compiler/hash-lower/src/build/matches/optimise.rs @@ -10,7 +10,7 @@ use hash_ir::{ ty::{IrTy, IrTyId}, }; use hash_storage::store::statics::StoreId; -use hash_tir::tir::pats::{PatId, Spread}; +use hash_tir::tir::{PatId, Spread}; use hash_utils::smallvec::SmallVec; use super::candidate::{Candidate, MatchPair}; diff --git a/compiler/hash-lower/src/build/matches/test.rs b/compiler/hash-lower/src/build/matches/test.rs index 1c3baf417..a179de494 100644 --- a/compiler/hash-lower/src/build/matches/test.rs +++ b/compiler/hash-lower/src/build/matches/test.rs @@ -6,7 +6,9 @@ use std::cmp::Ordering; use fixedbitset::FixedBitSet; -use hash_ast::ast::{self, AstNodeId}; +use hash_ast::ast::{ + AstNodeId, {self}, +}; use hash_ir::{ ir::{ BasicBlock, BinOp, Const, ConstKind, Operand, PlaceProjection, RValue, SwitchTargets, @@ -18,14 +20,7 @@ use hash_reporting::macros::panic_on_span; use hash_storage::store::statics::StoreId; use hash_tir::{ atom_info::ItemInAtomInfo, - tir::{ - args::PatArgsId, - data::CtorPat, - node::NodesId, - params::ParamIndex, - pats::{Pat, PatId, RangePat, Spread}, - terms::control::IfPat, - }, + tir::{CtorPat, IfPat, NodesId, ParamIndex, Pat, PatArgsId, PatId, RangePat, Spread}, }; use hash_utils::indexmap::IndexMap; diff --git a/compiler/hash-lower/src/build/mod.rs b/compiler/hash-lower/src/build/mod.rs index af5fe9e20..9cd16109c 100644 --- a/compiler/hash-lower/src/build/mod.rs +++ b/compiler/hash-lower/src/build/mod.rs @@ -25,14 +25,7 @@ use hash_storage::store::{statics::StoreId, SequenceStoreKey}; use hash_target::{HasTarget, Target}; use hash_tir::{ context::{Context, HasContext, ScopeKind}, - tir::{ - node::NodesId, - symbols::SymbolId, - terms::{ - fns::{FnDef, FnDefId, FnTy}, - TermId, - }, - }, + tir::{FnDef, FnDefId, FnTy, NodesId, SymbolId, TermId}, }; use hash_utils::{fxhash::FxHashMap, index_vec::IndexVec}; diff --git a/compiler/hash-lower/src/build/place.rs b/compiler/hash-lower/src/build/place.rs index 238e9e160..62db61196 100644 --- a/compiler/hash-lower/src/build/place.rs +++ b/compiler/hash-lower/src/build/place.rs @@ -5,10 +5,7 @@ use hash_ir::{ ty::{IrTyId, Mutability, VariantIdx}, }; use hash_storage::store::statics::StoreId; -use hash_tir::tir::{ - params::ParamIndex, - terms::{access::AccessTerm, arrays::IndexTerm, refs::DerefTerm, Term, TermId, Ty}, -}; +use hash_tir::tir::{AccessTerm, DerefTerm, IndexTerm, ParamIndex, Term, TermId, Ty}; use super::{unpack, BlockAnd, BlockAndExtend, BodyBuilder}; diff --git a/compiler/hash-lower/src/build/rvalue.rs b/compiler/hash-lower/src/build/rvalue.rs index 8c29e16c2..df1c02671 100644 --- a/compiler/hash-lower/src/build/rvalue.rs +++ b/compiler/hash-lower/src/build/rvalue.rs @@ -10,10 +10,7 @@ use hash_ir::{ use hash_source::constant::IntTy; use hash_storage::store::statics::StoreId; use hash_target::HasTarget; -use hash_tir::tir::{ - node::HasAstNodeId, - terms::{Term, TermId, Ty}, -}; +use hash_tir::tir::{HasAstNodeId, Term, TermId, Ty}; use super::{ category::Category, ty::FnCallTermKind, unpack, BlockAnd, BlockAndExtend, BodyBuilder, diff --git a/compiler/hash-lower/src/build/temp.rs b/compiler/hash-lower/src/build/temp.rs index 74f4ea867..9bf072c60 100644 --- a/compiler/hash-lower/src/build/temp.rs +++ b/compiler/hash-lower/src/build/temp.rs @@ -4,7 +4,7 @@ use hash_ir::{ ir::{BasicBlock, Local, LocalDecl, Place}, ty::{IrTyId, Mutability}, }; -use hash_tir::tir::terms::TermId; +use hash_tir::tir::TermId; use super::{BlockAnd, BodyBuilder}; use crate::build::{unpack, BlockAndExtend}; diff --git a/compiler/hash-lower/src/build/ty.rs b/compiler/hash-lower/src/build/ty.rs index 3cb458f64..fc803310a 100644 --- a/compiler/hash-lower/src/build/ty.rs +++ b/compiler/hash-lower/src/build/ty.rs @@ -7,7 +7,9 @@ use hash_ast::ast::AstNodeId; use hash_ir::{ - ir::{self, Const, ConstKind, Scalar}, + ir::{ + Const, ConstKind, Scalar, {self}, + }, ty::{IrTy, IrTyId, ToIrTy, COMMON_IR_TYS}, }; use hash_storage::store::{statics::StoreId, TrivialSequenceStoreKey}; @@ -18,15 +20,7 @@ use hash_tir::{ definitions::{BinOp, CondBinOp, Intrinsic as TirIntrinsic, ShortCircuitingBoolOp, UnOp}, utils::try_use_term_as_integer_lit, }, - tir::{ - data::DataTy, - lits::{Lit, LitPat}, - pats::PatId, - terms::{ - fns::{CallTerm, FnDefId}, - Term, TermId, TyId, - }, - }, + tir::{CallTerm, DataTy, FnDefId, Lit, LitPat, PatId, Term, TermId, TyId}, }; use super::BodyBuilder; diff --git a/compiler/hash-lower/src/build/utils.rs b/compiler/hash-lower/src/build/utils.rs index 9ac92e9d8..ea47ec9f5 100644 --- a/compiler/hash-lower/src/build/utils.rs +++ b/compiler/hash-lower/src/build/utils.rs @@ -14,13 +14,8 @@ use hash_ir::{ }; use hash_storage::store::statics::{SequenceStoreValue, StoreId}; use hash_tir::tir::{ - args::Arg, - data::DataTy, - mods::{ModMember, ModMemberValue}, - node::{HasAstNodeId, Node, NodeId}, - pats::PatId, - symbols::SymbolId, - terms::{fns::FnDefId, TermId}, + Arg, DataTy, FnDefId, HasAstNodeId, ModMember, ModMemberValue, Node, NodeId, PatId, SymbolId, + TermId, }; use super::BodyBuilder; diff --git a/compiler/hash-lower/src/ctx.rs b/compiler/hash-lower/src/ctx.rs index 6c78983dd..1ef69abe5 100644 --- a/compiler/hash-lower/src/ctx.rs +++ b/compiler/hash-lower/src/ctx.rs @@ -18,12 +18,7 @@ use hash_tir::{ atom_info::{AtomInfoStore, HasAtomInfo}, context::{Context, HasContext}, stores::tir_stores, - tir::{ - args::Arg, - data::{DataDefId, DataTy}, - mods::ModDefId, - node::{Node, NodeId}, - }, + tir::{Arg, DataDefId, DataTy, ModDefId, Node, NodeId}, }; use hash_utils::stream_writeln; diff --git a/compiler/hash-lower/src/discover.rs b/compiler/hash-lower/src/discover.rs index b9439e478..759e87fd7 100644 --- a/compiler/hash-lower/src/discover.rs +++ b/compiler/hash-lower/src/discover.rs @@ -10,11 +10,7 @@ use hash_storage::store::{statics::StoreId, TrivialSequenceStoreKey}; use hash_tir::{ atom_info::ItemInAtomInfo, stores::tir_stores, - tir::{ - mods::{ModDef, ModKind, ModMemberValue}, - node::HasAstNodeId, - terms::{fns::FnDefId, TermId}, - }, + tir::{FnDefId, HasAstNodeId, ModDef, ModKind, ModMemberValue, TermId}, visitor::{Atom, Visitor}, }; use hash_utils::{derive_more::Constructor, indexmap::IndexSet}; diff --git a/compiler/hash-lower/src/lib.rs b/compiler/hash-lower/src/lib.rs index 73cbbe095..05d77f5f5 100644 --- a/compiler/hash-lower/src/lib.rs +++ b/compiler/hash-lower/src/lib.rs @@ -32,7 +32,7 @@ use hash_pipeline::{ use hash_semantics::storage::SemanticStorage; use hash_source::SourceId; use hash_storage::store::{statics::StoreId, Store}; -use hash_tir::{stores::tir_stores, tir::node::HasAstNodeId}; +use hash_tir::{stores::tir_stores, tir::HasAstNodeId}; use hash_utils::{ indexmap::IndexMap, rayon, diff --git a/compiler/hash-lower/src/lower_ty.rs b/compiler/hash-lower/src/lower_ty.rs index 5d2ee367f..22722e4d9 100644 --- a/compiler/hash-lower/src/lower_ty.rs +++ b/compiler/hash-lower/src/lower_ty.rs @@ -7,8 +7,8 @@ use hash_ir::{ intrinsics::Intrinsic, lang_items::LangItem, ty::{ - self, Adt, AdtField, AdtFlags, AdtId, AdtVariant, AdtVariants, Instance, IrTy, IrTyId, - IrTyListId, Mutability, COMMON_IR_TYS, + Adt, AdtField, AdtFlags, AdtId, AdtVariant, AdtVariants, Instance, IrTy, IrTyId, + IrTyListId, Mutability, COMMON_IR_TYS, {self}, }, TyCacheEntry, }; @@ -26,17 +26,9 @@ use hash_tir::{ utils::try_use_term_as_integer_lit, }, tir::{ - data::{ - ArrayCtorInfo, CtorDefsId, DataDef, DataDefCtors, DataTy, NumericCtorBits, - NumericCtorInfo, PrimitiveCtorInfo, - }, - node::{HasAstNodeId, NodesId}, - terms::{ - fns::{FnDef, FnDefId, FnTy}, - refs::RefTy, - tuples::TupleTy, - Ty, TyId, - }, + ArrayCtorInfo, CtorDefsId, DataDef, DataDefCtors, DataTy, FnDef, FnDefId, FnTy, + HasAstNodeId, NodesId, NumericCtorBits, NumericCtorInfo, PrimitiveCtorInfo, RefTy, TupleTy, + Ty, TyId, }, }; use hash_utils::{index_vec::index_vec, itertools::Itertools}; @@ -130,9 +122,9 @@ impl<'ir> BuilderCtx<'ir> { let ty = self.ty_id_from_tir_ty(ty); let mutability = if mutable { Mutability::Mutable } else { Mutability::Immutable }; let ref_kind = match kind { - hash_tir::tir::terms::refs::RefKind::Rc => ty::RefKind::Rc, - hash_tir::tir::terms::refs::RefKind::Raw => ty::RefKind::Raw, - hash_tir::tir::terms::refs::RefKind::Local => ty::RefKind::Normal, + hash_tir::tir::RefKind::Rc => ty::RefKind::Rc, + hash_tir::tir::RefKind::Raw => ty::RefKind::Raw, + hash_tir::tir::RefKind::Local => ty::RefKind::Normal, }; IrTy::Ref(ty, mutability, ref_kind) diff --git a/compiler/hash-lower/src/optimise/constant_propagations.rs b/compiler/hash-lower/src/optimise/constant_propagations.rs index de4457649..2000cc070 100644 --- a/compiler/hash-lower/src/optimise/constant_propagations.rs +++ b/compiler/hash-lower/src/optimise/constant_propagations.rs @@ -3,7 +3,9 @@ //! Hash IR. use hash_ir::{ - ir::{self, Const, ConstKind, Scalar}, + ir::{ + Const, ConstKind, Scalar, {self}, + }, ty::{IrTy, IrTyId}, }; use hash_layout::compute::LayoutComputer; diff --git a/compiler/hash-pipeline/src/settings.rs b/compiler/hash-pipeline/src/settings.rs index 8e6dae9e3..abbf040fd 100644 --- a/compiler/hash-pipeline/src/settings.rs +++ b/compiler/hash-pipeline/src/settings.rs @@ -3,7 +3,9 @@ //! to the Compiler pipeline. use core::fmt; use std::{ - env::{self, temp_dir}, + env::{ + temp_dir, {self}, + }, fmt::Display, path::PathBuf, str::FromStr, diff --git a/compiler/hash-reporting/src/diagnostic.rs b/compiler/hash-reporting/src/diagnostic.rs index 81c5e2d5d..b98aa3fb2 100644 --- a/compiler/hash-reporting/src/diagnostic.rs +++ b/compiler/hash-reporting/src/diagnostic.rs @@ -2,11 +2,7 @@ //! adding errors and warnings into an abstract diagnostic store that //! some stage within the compiler can implement. -use std::{ - cell::RefCell, - fmt::{self}, - mem::take, -}; +use std::{cell::RefCell, fmt, mem::take}; use hash_utils::thin_vec::ThinVec; diff --git a/compiler/hash-semantics/src/diagnostics/definitions.rs b/compiler/hash-semantics/src/diagnostics/definitions.rs index dbe3ad93e..8a718b163 100644 --- a/compiler/hash-semantics/src/diagnostics/definitions.rs +++ b/compiler/hash-semantics/src/diagnostics/definitions.rs @@ -1,7 +1,7 @@ //! Error-related data structures for errors that occur during typechecking. use hash_exhaustiveness::diagnostics::{ExhaustivenessError, ExhaustivenessWarning}; use hash_source::location::Span; -use hash_tir::tir::{symbols::SymbolId, terms::TermId}; +use hash_tir::tir::{SymbolId, TermId}; use hash_typecheck::errors::TcError; use hash_utils::thin_vec::ThinVec; diff --git a/compiler/hash-semantics/src/diagnostics/reporting.rs b/compiler/hash-semantics/src/diagnostics/reporting.rs index 763207642..cf3d63774 100644 --- a/compiler/hash-semantics/src/diagnostics/reporting.rs +++ b/compiler/hash-semantics/src/diagnostics/reporting.rs @@ -2,7 +2,7 @@ use hash_reporting::{ hash_error_codes::error_codes::HashErrorCode, reporter::{Reporter, Reports}, }; -use hash_tir::tir::node::HasAstNodeId; +use hash_tir::tir::HasAstNodeId; use hash_typecheck::errors::TcErrorReporter; use super::definitions::{SemanticError, SemanticWarning}; diff --git a/compiler/hash-semantics/src/env.rs b/compiler/hash-semantics/src/env.rs index 914a2ac07..22cded244 100644 --- a/compiler/hash-semantics/src/env.rs +++ b/compiler/hash-semantics/src/env.rs @@ -3,7 +3,7 @@ use hash_pipeline::settings::HasCompilerSettings; use hash_reporting::diagnostic::{Diagnostics, HasDiagnostics}; use hash_source::entry_point::EntryPointState; use hash_target::HasTarget; -use hash_tir::tir::{mods::ModDefId, terms::fns::FnDefId}; +use hash_tir::tir::{FnDefId, ModDefId}; use once_cell::sync::OnceCell; use crate::{ diff --git a/compiler/hash-semantics/src/passes/ast_info.rs b/compiler/hash-semantics/src/passes/ast_info.rs index 61fb8924d..2357f2b57 100644 --- a/compiler/hash-semantics/src/passes/ast_info.rs +++ b/compiler/hash-semantics/src/passes/ast_info.rs @@ -5,12 +5,8 @@ use hash_tir::{ context::ContextMember, scopes::StackId, tir::{ - args::{ArgId, ArgsSeqId, PatArgId, PatArgsSeqId}, - data::{CtorDefId, CtorDefsSeqId, DataDefId}, - mods::{ModDefId, ModMemberId, ModMembersSeqId}, - params::{ParamId, ParamsSeqId}, - pats::PatId, - terms::{fns::FnDefId, TermId, TyId}, + ArgId, ArgsSeqId, CtorDefId, CtorDefsSeqId, DataDefId, FnDefId, ModDefId, ModMemberId, + ModMembersSeqId, ParamId, ParamsSeqId, PatArgId, PatArgsSeqId, PatId, TermId, TyId, }, }; use hash_utils::{fxhash::FxHashMap, parking_lot::RwLock}; diff --git a/compiler/hash-semantics/src/passes/discovery/defs.rs b/compiler/hash-semantics/src/passes/discovery/defs.rs index c8331cb36..15ee7931c 100644 --- a/compiler/hash-semantics/src/passes/discovery/defs.rs +++ b/compiler/hash-semantics/src/passes/discovery/defs.rs @@ -1,7 +1,9 @@ //! Utilities for keeping track of definitions during the discovery pass. use std::{fmt::Display, option::Option}; -use hash_ast::ast::{self, AstNode, AstNodeId, AstNodeRef, OwnsAstNode}; +use hash_ast::ast::{ + AstNode, AstNodeId, AstNodeRef, OwnsAstNode, {self}, +}; use hash_reporting::macros::panic_on_span; use hash_source::{identifier::Identifier, ModuleId, SourceMapUtils}; use hash_storage::store::{ @@ -12,11 +14,9 @@ use hash_tir::{ context::ContextMember, scopes::StackId, tir::{ - data::{CtorDef, CtorDefData, CtorDefId, DataDefCtors, DataDefId}, - mods::{ModDef, ModDefId, ModKind, ModMember, ModMemberId, ModMemberValue}, - node::{HasAstNodeId, Node, NodeId, NodeOrigin, NodesId}, - symbols::SymbolId, - terms::{fns::FnDefId, TyId}, + CtorDef, CtorDefData, CtorDefId, DataDefCtors, DataDefId, FnDefId, HasAstNodeId, ModDef, + ModDefId, ModKind, ModMember, ModMemberId, ModMemberValue, Node, NodeId, NodeOrigin, + NodesId, SymbolId, TyId, }, }; use hash_utils::{ diff --git a/compiler/hash-semantics/src/passes/discovery/mod.rs b/compiler/hash-semantics/src/passes/discovery/mod.rs index 2371fca8b..f0cb26e9e 100644 --- a/compiler/hash-semantics/src/passes/discovery/mod.rs +++ b/compiler/hash-semantics/src/passes/discovery/mod.rs @@ -2,11 +2,13 @@ //! the AST and adds them to the stores. use hash_ast::{ - ast::{self, AstNodeId}, + ast::{ + AstNodeId, {self}, + }, visitor::AstVisitor, }; use hash_source::SourceId; -use hash_tir::tir::{node::NodeOrigin, symbols::SymbolId}; +use hash_tir::tir::{NodeOrigin, SymbolId}; use hash_utils::{derive_more::Deref, state::LightState}; use self::defs::DefDiscoveryState; diff --git a/compiler/hash-semantics/src/passes/discovery/params.rs b/compiler/hash-semantics/src/passes/discovery/params.rs index f122b7a95..389041e05 100644 --- a/compiler/hash-semantics/src/passes/discovery/params.rs +++ b/compiler/hash-semantics/src/passes/discovery/params.rs @@ -1,10 +1,9 @@ //! Utilities for creating parameters and arguments during discovery. -use hash_ast::ast::{self, AstNodeId}; -use hash_storage::store::statics::SequenceStoreValue; -use hash_tir::tir::{ - node::{Node, NodeOrigin, NodesId}, - params::{Param, ParamId, ParamIndex, ParamsId}, +use hash_ast::ast::{ + AstNodeId, {self}, }; +use hash_storage::store::statics::SequenceStoreValue; +use hash_tir::tir::{Node, NodeOrigin, NodesId, Param, ParamId, ParamIndex, ParamsId}; use super::DiscoveryPass; use crate::env::SemanticEnv; diff --git a/compiler/hash-semantics/src/passes/discovery/visitor.rs b/compiler/hash-semantics/src/passes/discovery/visitor.rs index 6c102be7d..7c38851af 100644 --- a/compiler/hash-semantics/src/passes/discovery/visitor.rs +++ b/compiler/hash-semantics/src/passes/discovery/visitor.rs @@ -1,7 +1,9 @@ //! AST visitor for the discovery pass. use hash_ast::{ - ast::{self, AstNodeRef}, + ast::{ + AstNodeRef, {self}, + }, ast_visitor_default_impl, visitor::walk, }; @@ -10,15 +12,8 @@ use hash_storage::store::statics::SequenceStoreValue; use hash_tir::{ scopes::Stack, tir::{ - data::DataDef, - mods::{ModDef, ModKind, ModMember}, - node::{Node, NodeOrigin}, - symbols::SymbolId, - terms::{ - fns::{FnDef, FnTy}, - tuples::TupleTy, - Term, Ty, - }, + DataDef, FnDef, FnTy, ModDef, ModKind, ModMember, Node, NodeOrigin, SymbolId, Term, + TupleTy, Ty, }, }; use hash_utils::itertools::Itertools; diff --git a/compiler/hash-semantics/src/passes/evaluation/mod.rs b/compiler/hash-semantics/src/passes/evaluation/mod.rs index a9b237668..5d754fb1b 100644 --- a/compiler/hash-semantics/src/passes/evaluation/mod.rs +++ b/compiler/hash-semantics/src/passes/evaluation/mod.rs @@ -3,17 +3,13 @@ //! //! Typing errors are reported during this pass. -use hash_ast::ast::{self}; +use hash_ast::ast; use hash_pipeline::settings::CompilerStageKind; use hash_source::{ModuleKind, SourceId}; use hash_storage::store::statics::SequenceStoreValue; use hash_tir::{ dump::dump_tir, - tir::{ - args::Arg, - node::{Node, NodeId}, - terms::{fns::CallTerm, Term, TermId}, - }, + tir::{Arg, CallTerm, Node, NodeId, Term, TermId}, }; use hash_typecheck::{normalisation::NormalisationMode, TcEnv}; use hash_utils::{ diff --git a/compiler/hash-semantics/src/passes/inference/mod.rs b/compiler/hash-semantics/src/passes/inference/mod.rs index 192bf2181..01f08d856 100644 --- a/compiler/hash-semantics/src/passes/inference/mod.rs +++ b/compiler/hash-semantics/src/passes/inference/mod.rs @@ -5,7 +5,7 @@ use hash_ast::ast; use hash_source::SourceId; -use hash_tir::{tir::terms::Ty, visitor::Atom}; +use hash_tir::{tir::Ty, visitor::Atom}; use hash_typecheck::{ errors::{TcError, TcResult}, inference::FnInferMode, diff --git a/compiler/hash-semantics/src/passes/resolution/defs.rs b/compiler/hash-semantics/src/passes/resolution/defs.rs index 78ea4a1a1..d8b87787f 100644 --- a/compiler/hash-semantics/src/passes/resolution/defs.rs +++ b/compiler/hash-semantics/src/passes/resolution/defs.rs @@ -5,15 +5,12 @@ use std::cell::Cell; -use hash_ast::ast::{self, AstNodeRef}; +use hash_ast::ast::{ + AstNodeRef, {self}, +}; use hash_reporting::diagnostic::Diagnostics; use hash_storage::store::{statics::StoreId, SequenceStoreKey}; -use hash_tir::tir::{ - data::DataDefCtors, - mods::{ModDefId, ModMemberValue}, - node::NodesId, - terms::Ty, -}; +use hash_tir::tir::{DataDefCtors, ModDefId, ModMemberValue, NodesId, Ty}; use super::{scoping::ContextKind, ResolutionPass}; use crate::{ diff --git a/compiler/hash-semantics/src/passes/resolution/exprs.rs b/compiler/hash-semantics/src/passes/resolution/exprs.rs index 8163a6917..8091d4f67 100644 --- a/compiler/hash-semantics/src/passes/resolution/exprs.rs +++ b/compiler/hash-semantics/src/passes/resolution/exprs.rs @@ -6,7 +6,9 @@ use std::collections::HashSet; -use hash_ast::ast::{self, AstNode, AstNodeId, AstNodeRef}; +use hash_ast::ast::{ + AstNode, AstNodeId, AstNodeRef, {self}, +}; use hash_attrs::{attr::attr_store, builtin::attrs}; use hash_reporting::macros::panic_on_span; use hash_storage::store::{ @@ -20,21 +22,10 @@ use hash_tir::{ }, scopes::{AssignTerm, BlockStatement, BlockTerm, Decl}, tir::{ - args::{Arg, ArgsId}, - data::DataTy, - lits::{CharLit, FloatLit, IntLit, Lit, StrLit}, - node::{Node, NodeId, NodeOrigin}, - params::ParamIndex, - terms::{ - access::AccessTerm, - arrays::{ArrayTerm, IndexTerm}, - casting::CastTerm, - control::{LoopControlTerm, LoopTerm, MatchCase, MatchTerm, ReturnTerm}, - fns::CallTerm, - refs::{DerefTerm, RefKind, RefTerm}, - tuples::TupleTerm, - Term, TermId, Ty, TyOfTerm, UnsafeTerm, - }, + AccessTerm, Arg, ArgsId, ArrayTerm, CallTerm, CastTerm, CharLit, DataTy, DerefTerm, + FloatLit, IndexTerm, IntLit, Lit, LoopControlTerm, LoopTerm, MatchCase, MatchTerm, Node, + NodeId, NodeOrigin, ParamIndex, RefKind, RefTerm, ReturnTerm, StrLit, Term, TermId, + TupleTerm, Ty, TyOfTerm, UnsafeTerm, }, }; use hash_utils::itertools::Itertools; diff --git a/compiler/hash-semantics/src/passes/resolution/mod.rs b/compiler/hash-semantics/src/passes/resolution/mod.rs index ee293069e..f6710dcdc 100644 --- a/compiler/hash-semantics/src/passes/resolution/mod.rs +++ b/compiler/hash-semantics/src/passes/resolution/mod.rs @@ -4,7 +4,7 @@ //! //! Any scoping errors are reported here. -use hash_ast::ast::{self}; +use hash_ast::ast; use hash_source::SourceId; use hash_utils::derive_more::Deref; diff --git a/compiler/hash-semantics/src/passes/resolution/params.rs b/compiler/hash-semantics/src/passes/resolution/params.rs index ab243c0f7..c754f81ba 100644 --- a/compiler/hash-semantics/src/passes/resolution/params.rs +++ b/compiler/hash-semantics/src/passes/resolution/params.rs @@ -1,17 +1,16 @@ //! Resolution of AST parameters and arguments to terms. -use hash_ast::ast::{self, AstNodeId, AstNodeRef}; +use hash_ast::ast::{ + AstNodeId, AstNodeRef, {self}, +}; use hash_source::location::Span; use hash_storage::store::{ statics::{SequenceStoreValue, StoreId}, SequenceStoreKey, }; use hash_tir::tir::{ - args::{ArgsId, PatArgsId}, - node::{Node, NodeOrigin}, - params::{Param, ParamId, ParamsId, SomeParamsOrArgsId}, - pats::Spread, - terms::{fns::CallTerm, Term, TermId, Ty}, + ArgsId, CallTerm, Node, NodeOrigin, Param, ParamId, ParamsId, PatArgsId, SomeParamsOrArgsId, + Spread, Term, TermId, Ty, }; use super::ResolutionPass; diff --git a/compiler/hash-semantics/src/passes/resolution/paths.rs b/compiler/hash-semantics/src/passes/resolution/paths.rs index 5893c983a..2e15e6971 100644 --- a/compiler/hash-semantics/src/passes/resolution/paths.rs +++ b/compiler/hash-semantics/src/passes/resolution/paths.rs @@ -21,21 +21,16 @@ use std::fmt; -use hash_ast::ast::{self, AstNodeId}; +use hash_ast::ast::{ + AstNodeId, {self}, +}; use hash_source::{identifier::Identifier, location::Span}; use hash_storage::store::statics::{SequenceStoreValue, StoreId}; use hash_tir::{ intrinsics::definitions::Intrinsic, tir::{ - args::{Arg, ArgsId}, - data::{CtorPat, CtorTerm, DataDefId}, - mods::{ModDefId, ModMemberValue}, - node::{Node, NodeId, NodeOrigin}, - symbols::SymbolId, - terms::{ - fns::{CallTerm, FnDefId}, - Term, - }, + Arg, ArgsId, CallTerm, CtorPat, CtorTerm, DataDefId, FnDefId, ModDefId, ModMemberValue, + Node, NodeId, NodeOrigin, SymbolId, Term, }, }; diff --git a/compiler/hash-semantics/src/passes/resolution/pats.rs b/compiler/hash-semantics/src/passes/resolution/pats.rs index 08be81f90..b23b90ba4 100644 --- a/compiler/hash-semantics/src/passes/resolution/pats.rs +++ b/compiler/hash-semantics/src/passes/resolution/pats.rs @@ -6,25 +6,18 @@ use std::iter::empty; -use hash_ast::ast::{self, AstNodeId, AstNodeRef}; +use hash_ast::ast::{ + AstNodeId, AstNodeRef, {self}, +}; use hash_reporting::macros::panic_on_span; use hash_storage::store::{statics::SequenceStoreValue, SequenceStoreKey}; use hash_tir::{ intrinsics::utils::bool_pat, scopes::BindingPat, tir::{ - args::{PatArg, PatArgsId, PatOrCapture}, - data::CtorPat, - lits::{CharLit, Lit, LitPat, StrLit}, - node::{Node, NodeId, NodeOrigin}, - params::ParamIndex, - pats::{Pat, PatId, PatListId, RangePat, Spread}, - symbols::SymbolId, - terms::{ - arrays::ArrayPat, - control::{IfPat, OrPat}, - tuples::TuplePat, - }, + ArrayPat, CharLit, CtorPat, IfPat, Lit, LitPat, Node, NodeId, NodeOrigin, OrPat, + ParamIndex, Pat, PatArg, PatArgsId, PatId, PatListId, PatOrCapture, RangePat, Spread, + StrLit, SymbolId, TuplePat, }, }; diff --git a/compiler/hash-semantics/src/passes/resolution/scoping.rs b/compiler/hash-semantics/src/passes/resolution/scoping.rs index 8bf28eb13..80cb71b55 100644 --- a/compiler/hash-semantics/src/passes/resolution/scoping.rs +++ b/compiler/hash-semantics/src/passes/resolution/scoping.rs @@ -1,19 +1,17 @@ //! General helper functions for traversing scopes and adding bindings. use std::{collections::HashMap, fmt}; -use hash_ast::ast::{self, AstNodeId}; +use hash_ast::ast::{ + AstNodeId, {self}, +}; use hash_source::identifier::Identifier; use hash_storage::store::{statics::StoreId, SequenceStoreKey, TrivialSequenceStoreKey}; use hash_tir::{ scopes::StackId, term_as_variant, tir::{ - data::{CtorDefId, DataDefCtors, DataDefId}, - mods::{ModDefId, ModMemberId}, - node::{NodeOrigin, NodesId}, - params::ParamId, - symbols::SymbolId, - terms::{fns::FnTy, tuples::TupleTy}, + CtorDefId, DataDefCtors, DataDefId, FnTy, ModDefId, ModMemberId, NodeOrigin, NodesId, + ParamId, SymbolId, TupleTy, }, }; use hash_utils::{derive_more::Deref, state::HeavyState}; diff --git a/compiler/hash-semantics/src/passes/resolution/tys.rs b/compiler/hash-semantics/src/passes/resolution/tys.rs index d4503956c..048aba1f8 100644 --- a/compiler/hash-semantics/src/passes/resolution/tys.rs +++ b/compiler/hash-semantics/src/passes/resolution/tys.rs @@ -4,22 +4,17 @@ //! correspond to paths into TC-types. It does not handle all types; non-path //! types are handled later. -use hash_ast::ast::{self, AstNodeId, AstNodeRef}; +use hash_ast::ast::{ + AstNodeId, AstNodeRef, {self}, +}; use hash_reporting::macros::panic_on_span; use hash_source::identifier::IDENTS; use hash_storage::store::statics::SequenceStoreValue; use hash_tir::{ intrinsics::definitions::{array_ty, equal_ty, list_ty}, tir::{ - args::{Arg, ArgsId}, - data::DataTy, - node::{Node, NodeOrigin}, - params::ParamIndex, - terms::{ - fns::CallTerm, - refs::{RefKind, RefTy}, - Term, Ty, TyId, TyOfTerm, - }, + Arg, ArgsId, CallTerm, DataTy, Node, NodeOrigin, ParamIndex, RefKind, RefTy, Term, Ty, + TyId, TyOfTerm, }, }; diff --git a/compiler/hash-semantics/src/passes/tc_env_impl.rs b/compiler/hash-semantics/src/passes/tc_env_impl.rs index d2b4f9904..c37cc4d3e 100644 --- a/compiler/hash-semantics/src/passes/tc_env_impl.rs +++ b/compiler/hash-semantics/src/passes/tc_env_impl.rs @@ -66,7 +66,7 @@ impl HasAtomInfo for TcEnvImpl<'_, E> { } impl TcEnv for TcEnvImpl<'_, E> { - fn entry_point(&self) -> &EntryPointState { + fn entry_point(&self) -> &EntryPointState { self.env.entry_point() } diff --git a/compiler/hash-semantics/src/prelude.rs b/compiler/hash-semantics/src/prelude.rs index 30ff85bd7..eef35f0d8 100644 --- a/compiler/hash-semantics/src/prelude.rs +++ b/compiler/hash-semantics/src/prelude.rs @@ -1,7 +1,7 @@ use hash_source::entry_point::EntryPointState; use hash_tir::{ intrinsics::make::make_root_mod, - tir::{mods::ModDefId, terms::fns::FnDefId}, + tir::{FnDefId, ModDefId}, }; use once_cell::sync::OnceCell; diff --git a/compiler/hash-source/src/constant.rs b/compiler/hash-source/src/constant.rs index a1df37537..ea9e4759d 100644 --- a/compiler/hash-source/src/constant.rs +++ b/compiler/hash-source/src/constant.rs @@ -7,7 +7,9 @@ use std::{ cmp::Ordering, fmt, - io::{self, Read}, + io::{ + Read, {self}, + }, ops::{IndexMut, Neg}, }; diff --git a/compiler/hash-source/src/location.rs b/compiler/hash-source/src/location.rs index 5d10fc83f..4c5a26a2c 100644 --- a/compiler/hash-source/src/location.rs +++ b/compiler/hash-source/src/location.rs @@ -1,7 +1,9 @@ //! Hash Compiler source locations utilities and definitions. use std::{ convert::TryInto, - fmt::{self, Display}, + fmt::{ + Display, {self}, + }, ops::{Deref, DerefMut}, }; @@ -150,7 +152,7 @@ impl Span { } } -/// Represents a position within a source using a `row` and `column` +/// Represents a position within a source using a `row` and `column` #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct RowCol { /// The row number, indexing starts from `0`, but when printed, one is diff --git a/compiler/hash-target/src/lib.rs b/compiler/hash-target/src/lib.rs index 0f4142bf3..1e3763a32 100644 --- a/compiler/hash-target/src/lib.rs +++ b/compiler/hash-target/src/lib.rs @@ -12,7 +12,9 @@ pub mod targets; use std::{ borrow::Cow, env::consts::{ARCH, OS}, - fmt::{self, Display, Formatter}, + fmt::{ + Display, Formatter, {self}, + }, }; use abi::{Abi, Integer}; diff --git a/compiler/hash-tir/src/atom_info.rs b/compiler/hash-tir/src/atom_info.rs index 48de56017..21afeaa80 100644 --- a/compiler/hash-tir/src/atom_info.rs +++ b/compiler/hash-tir/src/atom_info.rs @@ -4,15 +4,7 @@ use std::hash::Hash; use hash_storage::store::{DefaultPartialStore, PartialCloneStore, PartialStore}; -use crate::tir::{ - args::{ArgsId, PatArgsId}, - params::ParamsId, - pats::PatId, - terms::{ - fns::{FnDefId, FnTy}, - TermId, TyId, - }, -}; +use crate::tir::{ArgsId, FnDefId, FnTy, ParamsId, PatArgsId, PatId, TermId, TyId}; macro_rules! atom_info { ($($name:ident: <$item:ident, $item_ty:ty>),* $(,)?) => { diff --git a/compiler/hash-tir/src/building.rs b/compiler/hash-tir/src/building.rs index c2feaf39c..3816f4503 100644 --- a/compiler/hash-tir/src/building.rs +++ b/compiler/hash-tir/src/building.rs @@ -11,13 +11,8 @@ pub mod gen { use hash_utils::itertools::Itertools; use crate::tir::{ - args::{Arg, ArgsId}, - data::{DataDef, DataDefCtors, DataDefId, PrimitiveCtorInfo}, - node::{Node, NodeOrigin}, - params::{Param, ParamsId}, - pats::{Pat, PatId}, - symbols::SymbolId, - terms::{refs::RefKind, Term, TermId, Ty, TyId}, + Arg, ArgsId, DataDef, DataDefCtors, DataDefId, Node, NodeOrigin, Param, ParamsId, Pat, + PatId, PrimitiveCtorInfo, RefKind, SymbolId, Term, TermId, Ty, TyId, }; /// Create a symbol with the given name. diff --git a/compiler/hash-tir/src/context.rs b/compiler/hash-tir/src/context.rs index 0d77e9b4c..c391dc7a6 100644 --- a/compiler/hash-tir/src/context.rs +++ b/compiler/hash-tir/src/context.rs @@ -19,16 +19,8 @@ use crate::{ scopes::StackId, sub::Sub, tir::{ - args::{ArgId, ArgsId}, - data::{CtorDefId, DataDefId}, - mods::ModDefId, - params::{ParamId, ParamsId}, - symbols::SymbolId, - terms::{ - fns::{FnDefId, FnTy}, - tuples::TupleTy, - TermId, TyId, - }, + ArgId, ArgsId, CtorDefId, DataDefId, FnDefId, FnTy, ModDefId, ParamId, ParamsId, SymbolId, + TermId, TupleTy, TyId, }, }; diff --git a/compiler/hash-tir/src/intrinsics/definitions.rs b/compiler/hash-tir/src/intrinsics/definitions.rs index 2b84fa62e..652baa4fc 100644 --- a/compiler/hash-tir/src/intrinsics/definitions.rs +++ b/compiler/hash-tir/src/intrinsics/definitions.rs @@ -23,11 +23,8 @@ use crate::{ }, make_intrinsics, make_primitives, tir::{ - data::{numeric_ctors, ArrayCtorInfo, CtorDefId, DataDefId, PrimitiveCtorInfo}, - lits::Lit, - mods::ModMember, - node::{NodeId, NodeOrigin}, - terms::{fns::FnTy, refs::RefKind, Term, TermId, TyId}, + numeric_ctors, ArrayCtorInfo, CtorDefId, DataDefId, FnTy, Lit, ModMember, NodeId, + NodeOrigin, PrimitiveCtorInfo, RefKind, Term, TermId, TyId, }, }; diff --git a/compiler/hash-tir/src/intrinsics/make.rs b/compiler/hash-tir/src/intrinsics/make.rs index c6c47d65a..55809d98f 100644 --- a/compiler/hash-tir/src/intrinsics/make.rs +++ b/compiler/hash-tir/src/intrinsics/make.rs @@ -11,10 +11,8 @@ use crate::{ building::gen, context::HasContext, tir::{ - data::{CtorDefId, DataDefId}, - mods::{ModDef, ModDefId, ModKind, ModMember, ModMemberValue}, - node::Node, - terms::{fns::FnTy, TermId}, + CtorDefId, DataDefId, FnTy, ModDef, ModDefId, ModKind, ModMember, ModMemberValue, Node, + TermId, }, }; @@ -133,9 +131,9 @@ macro_rules! make_intrinsics { // ##GeneratedOrigin: Intrinsics do not have a source location. /// All the intrinsics as a tuple. - pub fn all_intrinsics_as_mod_members() -> &'static [$crate::tir::node::Node] { - use $crate::tir::node::Node; - use $crate::tir::mods::ModMemberValue; + pub fn all_intrinsics_as_mod_members() -> &'static [$crate::tir::Node] { + use $crate::tir::Node; + use $crate::tir::ModMemberValue; use std::sync::OnceLock; static INTRINSICS_MOD: OnceLock>> = OnceLock::new(); @@ -300,9 +298,9 @@ macro_rules! make_primitives { // ##GeneratedOrigin: Intrinsics do not have a source location. /// All the primitives as module members. - pub fn all_primitives_as_mod_members() -> &'static [$crate::tir::node::Node] { - use $crate::tir::node::Node; - use $crate::tir::mods::ModMemberValue; + pub fn all_primitives_as_mod_members() -> &'static [$crate::tir::Node] { + use $crate::tir::Node; + use $crate::tir::ModMemberValue; use std::sync::OnceLock; static PRIMITIVES_MOD: OnceLock>> = OnceLock::new(); @@ -397,10 +395,10 @@ macro_rules! make_primitives { #[allow(non_snake_case)] pub fn [<$name:snake _ty>]( $($($param_name: TermId),*,)? - origin: $crate::tir::node::NodeOrigin, + origin: $crate::tir::NodeOrigin, ) -> TyId { - use $crate::tir::terms::Ty; - use $crate::tir::args::Arg; + use $crate::tir::Ty; + use $crate::tir::Arg; Ty::indexed_data_ty( [<$name:camel Primitive>].def(), Arg::seq_positional([$($($param_name,)*)?], origin), @@ -414,8 +412,8 @@ macro_rules! make_primitives { pub fn [<$name:snake _gen_ty>]( $($($param_name: TermId),*)? ) -> TyId { - use $crate::tir::terms::Ty; - use $crate::tir::args::Arg; + use $crate::tir::Ty; + use $crate::tir::Arg; Ty::indexed_data_ty( [<$name:camel Primitive>].def(), Arg::seq_positional([$($($param_name,)*)?], NodeOrigin::Generated), @@ -429,10 +427,10 @@ macro_rules! make_primitives { #[allow(non_snake_case)] pub fn [<$name:snake _ty>]( $($($prim_param_name: TermId),*,)? - origin: $crate::tir::node::NodeOrigin, + origin: $crate::tir::NodeOrigin, ) -> TyId { - use $crate::tir::terms::Ty; - use $crate::tir::args::Arg; + use $crate::tir::Ty; + use $crate::tir::Arg; Ty::indexed_data_ty( [<$name:camel Primitive>].def(), Arg::seq_positional([$($($prim_param_name,)*)?], origin), @@ -446,8 +444,8 @@ macro_rules! make_primitives { pub fn [<$name:snake _gen_ty>]( $($($prim_param_name: TermId),*)? ) -> TyId { - use $crate::tir::terms::Ty; - use $crate::tir::args::Arg; + use $crate::tir::Ty; + use $crate::tir::Arg; Ty::indexed_data_ty( [<$name:camel Primitive>].def(), Arg::seq_positional([$($($prim_param_name,)*)?], NodeOrigin::Generated), diff --git a/compiler/hash-tir/src/intrinsics/utils.rs b/compiler/hash-tir/src/intrinsics/utils.rs index a6b80dbc9..3107ecf27 100644 --- a/compiler/hash-tir/src/intrinsics/utils.rs +++ b/compiler/hash-tir/src/intrinsics/utils.rs @@ -1,5 +1,5 @@ /// Various utility functions for working with intrinsics and primitives. -use hash_ast::ast::{self}; +use hash_ast::ast; use hash_source::constant::{ FloatConstant, FloatConstantValue, FloatTy, IntConstant, IntConstantValue, IntTy, InternedFloat, InternedInt, SIntTy, UIntTy, @@ -15,12 +15,8 @@ use super::{ use crate::{ context::HasContext, tir::{ - args::{Arg, PatArg}, - data::{ArrayCtorInfo, CtorDefId, CtorPat, CtorTerm, DataDefCtors, PrimitiveCtorInfo}, - lits::{CharLit, IntLit, Lit}, - node::{Node, NodeOrigin}, - pats::{Pat, PatId}, - terms::{Term, TermId, Ty, TyId}, + Arg, ArrayCtorInfo, CharLit, CtorDefId, CtorPat, CtorTerm, DataDefCtors, IntLit, Lit, Node, + NodeOrigin, Pat, PatArg, PatId, PrimitiveCtorInfo, Term, TermId, Ty, TyId, }, }; diff --git a/compiler/hash-tir/src/scopes.rs b/compiler/hash-tir/src/scopes.rs index ed99ae512..6d2201120 100644 --- a/compiler/hash-tir/src/scopes.rs +++ b/compiler/hash-tir/src/scopes.rs @@ -19,13 +19,7 @@ use utility_types::omit; use crate::{ context::ContextMember, stores::tir_stores, - tir::{ - mods::ModDefId, - node::{Node, NodeOrigin}, - pats::{Pat, PatId}, - symbols::SymbolId, - terms::{Term, TermId, TyId}, - }, + tir::{ModDefId, Node, NodeOrigin, Pat, PatId, SymbolId, Term, TermId, TyId}, tir_node_sequence_store_direct, tir_node_single_store, }; diff --git a/compiler/hash-tir/src/stores.rs b/compiler/hash-tir/src/stores.rs index 0b14d5e36..b1fa09bbc 100644 --- a/compiler/hash-tir/src/stores.rs +++ b/compiler/hash-tir/src/stores.rs @@ -9,18 +9,11 @@ use crate::{ atom_info::AtomInfoStore, scopes::{BlockStatementsSeqStore, BlockStatementsStore, StackStore}, tir::{ - args::{ArgsSeqStore, ArgsStore, PatArgsSeqStore, PatArgsStore}, - data::{CtorDefsSeqStore, CtorDefsStore, DataDefStore}, - lits::LitStore, - mods::{ModDefStore, ModMembersSeqStore, ModMembersStore}, - params::{ParamsSeqStore, ParamsStore}, - pats::{PatListSeqStore, PatListStore, PatStore}, - symbols::SymbolStore, - terms::{ - control::{MatchCasesSeqStore, MatchCasesStore}, - fns::FnDefStore, - TermListSeqStore, TermListStore, TermStore, - }, + ArgsSeqStore, ArgsStore, CtorDefsSeqStore, CtorDefsStore, DataDefStore, FnDefStore, + LitStore, MatchCasesSeqStore, MatchCasesStore, ModDefStore, ModMembersSeqStore, + ModMembersStore, ParamsSeqStore, ParamsStore, PatArgsSeqStore, PatArgsStore, + PatListSeqStore, PatListStore, PatStore, SymbolStore, TermListSeqStore, TermListStore, + TermStore, }, }; @@ -118,9 +111,9 @@ macro_rules! tir_debug_name_of_store_id { #[macro_export] macro_rules! impl_nodes_id { ($id:ty, $id_seq:ty) => { - impl $crate::tir::node::NodesId for $id { + impl $crate::tir::NodesId for $id { type Elements = $id_seq; - fn elements_node(&self) -> $crate::tir::node::Node { + fn elements_node(&self) -> $crate::tir::Node { use hash_storage::store::statics::StoreId; self.value() } @@ -132,14 +125,14 @@ macro_rules! impl_nodes_id { #[macro_export] macro_rules! impl_node_id { ($id:ty) => { - impl $crate::tir::node::NodeId for $id { - fn origin(self) -> $crate::tir::node::NodeOrigin { + impl $crate::tir::NodeId for $id { + fn origin(self) -> $crate::tir::NodeOrigin { use hash_storage::store::statics::StoreId; self.borrow().origin } } - impl $crate::tir::node::HasAstNodeId for $id { + impl $crate::tir::HasAstNodeId for $id { fn node_id(&self) -> Option { use hash_storage::store::statics::StoreId; self.value().node_id() @@ -186,7 +179,7 @@ macro_rules! tir_node_single_store { hash_storage::static_single_store!( store = $store_vis $store, id = $id_vis $id, - value = $crate::tir::node::Node<$value>, + value = $crate::tir::Node<$value>, store_name = $store_name, store_source = tir_stores() ); @@ -256,7 +249,7 @@ macro_rules! tir_node_sequence_store_direct { hash_storage::static_sequence_store_direct!( store = $store_vis $seq_store, id = $id_vis $id_seq[$el_id], - value = $crate::tir::node::Node<$value>, + value = $crate::tir::Node<$value>, store_name = $seq_store_name, store_source = tir_stores() ); @@ -270,7 +263,7 @@ macro_rules! tir_node_sequence_store_direct { type ElementKey = $el_id; fn to_index_and_len(self) -> (usize, usize) { - use $crate::tir::node::NodesId; + use $crate::tir::NodesId; self.elements().to_index_and_len() } @@ -359,7 +352,7 @@ macro_rules! tir_node_sequence_store_indirect { type ElementKey = $el_id; fn to_index_and_len(self) -> (usize, usize) { - use $crate::tir::node::NodesId; + use $crate::tir::NodesId; self.elements().to_index_and_len() } diff --git a/compiler/hash-tir/src/sub.rs b/compiler/hash-tir/src/sub.rs index 4fd718c3a..ce15f4e15 100644 --- a/compiler/hash-tir/src/sub.rs +++ b/compiler/hash-tir/src/sub.rs @@ -3,7 +3,7 @@ use std::fmt::{self, Display, Formatter}; use hash_utils::smallvec::SmallVec; -use crate::tir::{symbols::SymbolId, terms::TermId}; +use crate::tir::{SymbolId, TermId}; /// An entry in a substitution. /// diff --git a/compiler/hash-tir/src/tir/args.rs b/compiler/hash-tir/src/tir/args.rs index 098ad41f4..224c712fd 100644 --- a/compiler/hash-tir/src/tir/args.rs +++ b/compiler/hash-tir/src/tir/args.rs @@ -12,11 +12,8 @@ use hash_utils::{derive_more::From, itertools::Itertools}; use crate::{ stores::tir_stores, tir::{ - node::{HasAstNodeId, Node, NodeId, NodeOrigin, NodesId}, - params::{ParamIndex, ParamsId}, - pats::PatId, - symbols::SymbolId, - terms::{Term, TermId}, + HasAstNodeId, Node, NodeId, NodeOrigin, NodesId, ParamIndex, ParamsId, PatId, SymbolId, + Term, TermId, }, tir_node_sequence_store_direct, }; diff --git a/compiler/hash-tir/src/tir/data.rs b/compiler/hash-tir/src/tir/data.rs index aace6eab6..a36a08e49 100644 --- a/compiler/hash-tir/src/tir/data.rs +++ b/compiler/hash-tir/src/tir/data.rs @@ -17,12 +17,8 @@ use utility_types::omit; use crate::{ stores::tir_stores, tir::{ - args::{Arg, ArgsId, PatArgsId}, - node::{Node, NodeId, NodeOrigin, NodesId}, - params::ParamsId, - pats::{PatArgsWithSpread, Spread}, - symbols::SymbolId, - terms::{TermId, TyId}, + Arg, ArgsId, Node, NodeId, NodeOrigin, NodesId, ParamsId, PatArgsId, PatArgsWithSpread, + Spread, SymbolId, TermId, TyId, }, tir_node_sequence_store_direct, tir_node_single_store, }; diff --git a/compiler/hash-tir/src/tir/mod.rs b/compiler/hash-tir/src/tir/mod.rs index 3b6df8f9e..171b62abf 100644 --- a/compiler/hash-tir/src/tir/mod.rs +++ b/compiler/hash-tir/src/tir/mod.rs @@ -7,3 +7,13 @@ pub mod params; pub mod pats; pub mod symbols; pub mod terms; + +pub use args::*; +pub use data::*; +pub use lits::*; +pub use mods::*; +pub use node::*; +pub use params::*; +pub use pats::*; +pub use symbols::*; +pub use terms::*; diff --git a/compiler/hash-tir/src/tir/mods.rs b/compiler/hash-tir/src/tir/mods.rs index 142ab9973..57ffb851f 100644 --- a/compiler/hash-tir/src/tir/mods.rs +++ b/compiler/hash-tir/src/tir/mods.rs @@ -13,7 +13,7 @@ use utility_types::omit; use crate::{ intrinsics::{definitions::Intrinsic, make::IsIntrinsic}, stores::tir_stores, - tir::{data::DataDefId, node::Node, symbols::SymbolId, terms::fns::FnDefId}, + tir::{DataDefId, FnDefId, Node, SymbolId}, tir_node_sequence_store_direct, tir_node_single_store, }; diff --git a/compiler/hash-tir/src/tir/params/mod.rs b/compiler/hash-tir/src/tir/params/mod.rs index 5ecc7e6d1..0299754eb 100644 --- a/compiler/hash-tir/src/tir/params/mod.rs +++ b/compiler/hash-tir/src/tir/params/mod.rs @@ -13,21 +13,16 @@ use crate::{ context::ScopeKind, stores::tir_stores, tir::{ - args::{ArgsId, PatArgsId, SomeArgsId}, - data::{CtorDefId, DataDefId}, - node::{HasAstNodeId, Node, NodeId, NodeOrigin, NodesId}, - symbols::SymbolId, - terms::{ - fns::{FnDefId, FnTy}, - tuples::TupleTy, - TermId, Ty, TyId, - }, + ArgsId, CtorDefId, DataDefId, FnDefId, FnTy, HasAstNodeId, Node, NodeId, NodeOrigin, + NodesId, PatArgsId, SomeArgsId, SymbolId, TermId, TupleTy, Ty, TyId, }, tir_node_sequence_store_direct, }; pub mod utils; +pub use utils::*; + /// A parameter, declaring a potentially named variable with a given type and /// possibly a default value. #[derive(Debug, Clone, Copy)] diff --git a/compiler/hash-tir/src/tir/params/utils.rs b/compiler/hash-tir/src/tir/params/utils.rs index 37656a957..d6af03340 100644 --- a/compiler/hash-tir/src/tir/params/utils.rs +++ b/compiler/hash-tir/src/tir/params/utils.rs @@ -13,10 +13,8 @@ use hash_storage::store::{ use hash_utils::{pluralise, printing::SequenceDisplay}; use crate::tir::{ - args::{Arg, ArgId, ArgsId, PatArg, PatArgId, PatArgsId, PatOrCapture, SomeArgId, SomeArgsId}, - node::{HasAstNodeId, Node, NodeId, NodesId}, - params::{ParamId, ParamIndex, ParamsId}, - pats::Spread, + Arg, ArgId, ArgsId, HasAstNodeId, Node, NodeId, NodesId, ParamId, ParamIndex, ParamsId, PatArg, + PatArgId, PatArgsId, PatOrCapture, SomeArgId, SomeArgsId, Spread, }; /// An error that can occur when checking [Param]s against [Args]. diff --git a/compiler/hash-tir/src/tir/pats.rs b/compiler/hash-tir/src/tir/pats.rs index 29ba5915c..030356de0 100644 --- a/compiler/hash-tir/src/tir/pats.rs +++ b/compiler/hash-tir/src/tir/pats.rs @@ -13,17 +13,7 @@ use hash_utils::derive_more::From; use crate::{ scopes::BindingPat, stores::tir_stores, - tir::{ - args::{PatArgsId, PatOrCapture}, - data::CtorPat, - lits::LitPat, - symbols::SymbolId, - terms::{ - arrays::ArrayPat, - control::{IfPat, OrPat}, - tuples::TuplePat, - }, - }, + tir::{ArrayPat, CtorPat, IfPat, LitPat, OrPat, PatArgsId, PatOrCapture, SymbolId, TuplePat}, tir_node_sequence_store_indirect, tir_node_single_store, }; diff --git a/compiler/hash-tir/src/tir/symbols.rs b/compiler/hash-tir/src/tir/symbols.rs index cddce4dc5..77f70acb8 100644 --- a/compiler/hash-tir/src/tir/symbols.rs +++ b/compiler/hash-tir/src/tir/symbols.rs @@ -10,7 +10,7 @@ use hash_storage::{ use crate::{ stores::tir_stores, - tir::node::{Node, NodeOrigin}, + tir::{Node, NodeOrigin}, tir_node_single_store, }; diff --git a/compiler/hash-tir/src/tir/terms/access.rs b/compiler/hash-tir/src/tir/terms/access.rs index 213887e17..9f361540f 100644 --- a/compiler/hash-tir/src/tir/terms/access.rs +++ b/compiler/hash-tir/src/tir/terms/access.rs @@ -4,7 +4,7 @@ use core::fmt; use hash_ast::ast; -use crate::tir::{params::ParamIndex, terms::TermId}; +use crate::tir::{ParamIndex, TermId}; /// Term to access a nested value. #[derive(Debug, Clone, Copy)] diff --git a/compiler/hash-tir/src/tir/terms/arrays.rs b/compiler/hash-tir/src/tir/terms/arrays.rs index 44c3d268e..17dcd6bdc 100644 --- a/compiler/hash-tir/src/tir/terms/arrays.rs +++ b/compiler/hash-tir/src/tir/terms/arrays.rs @@ -3,11 +3,7 @@ use std::fmt::Display; use hash_storage::store::{statics::StoreId, TrivialSequenceStoreKey}; -use crate::tir::{ - node::NodesId, - pats::{PatId, PatListId, Spread}, - terms::{TermId, TermListId}, -}; +use crate::tir::{NodesId, PatId, PatListId, Spread, TermId, TermListId}; /// A term that is used as an index into an array. #[derive(Debug, Clone, Copy)] diff --git a/compiler/hash-tir/src/tir/terms/casting.rs b/compiler/hash-tir/src/tir/terms/casting.rs index 45af7f3ce..647399400 100644 --- a/compiler/hash-tir/src/tir/terms/casting.rs +++ b/compiler/hash-tir/src/tir/terms/casting.rs @@ -1,7 +1,7 @@ //! Definitions related to type casting and coercion. use core::fmt; -use crate::tir::terms::{TermId, TyId}; +use crate::tir::{TermId, TyId}; /// Cast a given term to a given type. See [`CastKind`]. /// diff --git a/compiler/hash-tir/src/tir/terms/control.rs b/compiler/hash-tir/src/tir/terms/control.rs index d30dd38ee..4debd0a78 100644 --- a/compiler/hash-tir/src/tir/terms/control.rs +++ b/compiler/hash-tir/src/tir/terms/control.rs @@ -10,10 +10,7 @@ use textwrap::indent; use crate::{ scopes::StackId, stores::tir_stores, - tir::{ - pats::{PatId, PatListId}, - terms::{Term, TermId}, - }, + tir::{PatId, PatListId, Term, TermId}, tir_node_sequence_store_direct, }; diff --git a/compiler/hash-tir/src/tir/terms/fns.rs b/compiler/hash-tir/src/tir/terms/fns.rs index bf056be36..ec73aacd2 100644 --- a/compiler/hash-tir/src/tir/terms/fns.rs +++ b/compiler/hash-tir/src/tir/terms/fns.rs @@ -7,12 +7,7 @@ use typed_builder::TypedBuilder; use crate::{ stores::tir_stores, - tir::{ - args::ArgsId, - params::ParamsId, - symbols::SymbolId, - terms::{TermId, Ty, TyId}, - }, + tir::{ArgsId, ParamsId, SymbolId, TermId, Ty, TyId}, tir_node_single_store, }; diff --git a/compiler/hash-tir/src/tir/terms/holes.rs b/compiler/hash-tir/src/tir/terms/holes.rs index 25bc56c2f..f81567838 100644 --- a/compiler/hash-tir/src/tir/terms/holes.rs +++ b/compiler/hash-tir/src/tir/terms/holes.rs @@ -2,7 +2,7 @@ use core::fmt; -use crate::tir::{node::NodeOrigin, symbols::SymbolId}; +use crate::tir::{NodeOrigin, SymbolId}; /// A hole, or in other words a variable which will be resolved as a term later. /// diff --git a/compiler/hash-tir/src/tir/terms/mod.rs b/compiler/hash-tir/src/tir/terms/mod.rs index 756af8a19..c6a4b405a 100644 --- a/compiler/hash-tir/src/tir/terms/mod.rs +++ b/compiler/hash-tir/src/tir/terms/mod.rs @@ -14,22 +14,7 @@ use crate::{ scopes::{AssignTerm, BlockTerm}, stores::tir_stores, tir::{ - args::{Arg, ArgsId}, - data::{CtorTerm, DataDefId, DataTy}, - lits::LitId, - node::{Node, NodeId, NodeOrigin}, - params::Param, - symbols::SymbolId, - terms::{ - access::AccessTerm, - arrays::{ArrayTerm, IndexTerm}, - casting::CastTerm, - control::{LoopControlTerm, LoopTerm, MatchTerm, ReturnTerm}, - fns::{CallTerm, FnDefId, FnTy}, - holes::Hole, - refs::{DerefTerm, RefKind, RefTerm, RefTy}, - tuples::{TupleTerm, TupleTy}, - }, + Arg, ArgsId, CtorTerm, DataDefId, DataTy, LitId, Node, NodeId, NodeOrigin, Param, SymbolId, }, tir_node_sequence_store_indirect, tir_node_single_store, visitor::Atom, @@ -44,6 +29,15 @@ pub mod holes; pub mod refs; pub mod tuples; +pub use access::*; +pub use arrays::*; +pub use casting::*; +pub use control::*; +pub use fns::*; +pub use holes::*; +pub use refs::*; +pub use tuples::*; + /// A term that can contain unsafe operations. #[derive(Debug, Clone, Copy)] pub struct UnsafeTerm { @@ -150,7 +144,7 @@ pub type TyListId = TermListId; macro_rules! term_as_variant { ($self:expr, $term:expr, $variant:ident) => {{ let term = $term; - if let $crate::tir::terms::Term::$variant(term) = *term { + if let $crate::tir::Term::$variant(term) = *term { term } else { panic!("Expected term {} to be a {}", term, stringify!($variant)) diff --git a/compiler/hash-tir/src/tir/terms/refs.rs b/compiler/hash-tir/src/tir/terms/refs.rs index 24b02e2a4..deefd5cf5 100644 --- a/compiler/hash-tir/src/tir/terms/refs.rs +++ b/compiler/hash-tir/src/tir/terms/refs.rs @@ -2,7 +2,7 @@ use std::fmt::Display; -use crate::tir::terms::{TermId, TyId}; +use crate::tir::{TermId, TyId}; // @@Todo: explanations about semantics diff --git a/compiler/hash-tir/src/tir/terms/tuples.rs b/compiler/hash-tir/src/tir/terms/tuples.rs index e4c5882ed..0672a0de7 100644 --- a/compiler/hash-tir/src/tir/terms/tuples.rs +++ b/compiler/hash-tir/src/tir/terms/tuples.rs @@ -2,11 +2,7 @@ use std::fmt::Display; -use crate::tir::{ - args::{ArgsId, PatArgsId}, - params::ParamsId, - pats::{PatArgsWithSpread, Spread}, -}; +use crate::tir::{ArgsId, ParamsId, PatArgsId, PatArgsWithSpread, Spread}; /// A tuple type. /// diff --git a/compiler/hash-tir/src/visitor.rs b/compiler/hash-tir/src/visitor.rs index de8d54a8b..fcf452ffe 100644 --- a/compiler/hash-tir/src/visitor.rs +++ b/compiler/hash-tir/src/visitor.rs @@ -12,22 +12,12 @@ use hash_utils::derive_more::{From, TryInto}; use crate::{ scopes::{AssignTerm, BlockStatement, BlockStatementsId, BlockTerm, Decl}, tir::{ - args::{Arg, ArgsId, PatArg, PatArgsId, PatOrCapture}, - data::{CtorDefId, CtorPat, CtorTerm, DataDefCtors, DataDefId, DataTy, PrimitiveCtorInfo}, - mods::{ModDefId, ModMemberId, ModMemberValue}, - node::{HasAstNodeId, Node, NodeId, NodeOrigin, NodesId}, - params::{Param, ParamsId}, - pats::{Pat, PatId, PatListId}, - terms::{ - access::AccessTerm, - arrays::{ArrayPat, ArrayTerm, IndexTerm}, - casting::CastTerm, - control::{IfPat, LoopTerm, MatchCase, MatchTerm, OrPat, ReturnTerm}, - fns::{CallTerm, FnDef, FnDefId, FnTy}, - refs::{DerefTerm, RefTerm, RefTy}, - tuples::{TuplePat, TupleTerm, TupleTy}, - Term, TermId, TermListId, Ty, TyOfTerm, UnsafeTerm, - }, + AccessTerm, Arg, ArgsId, ArrayPat, ArrayTerm, CallTerm, CastTerm, CtorDefId, CtorPat, + CtorTerm, DataDefCtors, DataDefId, DataTy, DerefTerm, FnDef, FnDefId, FnTy, HasAstNodeId, + IfPat, IndexTerm, LoopTerm, MatchCase, MatchTerm, ModDefId, ModMemberId, ModMemberValue, + Node, NodeId, NodeOrigin, NodesId, OrPat, Param, ParamsId, Pat, PatArg, PatArgsId, PatId, + PatListId, PatOrCapture, PrimitiveCtorInfo, RefTerm, RefTy, ReturnTerm, Term, TermId, + TermListId, TuplePat, TupleTerm, TupleTy, Ty, TyOfTerm, UnsafeTerm, }, }; diff --git a/compiler/hash-typecheck/src/errors.rs b/compiler/hash-typecheck/src/errors.rs index 9eecf164b..b78ea7421 100644 --- a/compiler/hash-typecheck/src/errors.rs +++ b/compiler/hash-typecheck/src/errors.rs @@ -10,10 +10,8 @@ use hash_source::location::Span; use hash_storage::store::SequenceStoreKey; use hash_tir::{ tir::{ - node::{HasAstNodeId, NodeId, NodeOrigin}, - params::{utils::ParamError, ParamIndex, ParamsId, SomeParamsOrArgsId}, - pats::PatId, - terms::{fns::FnDefId, TermId, TyId}, + FnDefId, HasAstNodeId, NodeId, NodeOrigin, ParamError, ParamIndex, ParamsId, PatId, + SomeParamsOrArgsId, TermId, TyId, }, visitor::Atom, }; diff --git a/compiler/hash-typecheck/src/inference.rs b/compiler/hash-typecheck/src/inference.rs index 135c75393..daa4acf26 100644 --- a/compiler/hash-typecheck/src/inference.rs +++ b/compiler/hash-typecheck/src/inference.rs @@ -33,30 +33,14 @@ use hash_tir::{ sub::Sub, term_as_variant, tir::{ - args::{Arg, ArgId, ArgsId, PatArgsId, PatOrCapture}, - data::{CtorDefId, CtorPat, CtorTerm, DataDefCtors, DataDefId, DataTy, PrimitiveCtorInfo}, - lits::{Lit, LitId}, - mods::{ModDefId, ModMemberId, ModMemberValue}, - node::{HasAstNodeId, Node, NodeId, NodeOrigin, NodesId}, - params::{ - utils::{ - validate_and_reorder_args_against_params, - validate_and_reorder_pat_args_against_params, validate_params, - }, - Param, ParamsId, - }, - pats::{Pat, PatId, PatListId, RangePat, Spread}, - symbols::SymbolId, - terms::{ - access::AccessTerm, - arrays::{ArrayPat, ArrayTerm, IndexTerm}, - casting::CastTerm, - control::{IfPat, LoopControlTerm, LoopTerm, MatchTerm, OrPat, ReturnTerm}, - fns::{CallTerm, FnDefId, FnTy}, - refs::{DerefTerm, RefTerm, RefTy}, - tuples::{TuplePat, TupleTerm, TupleTy}, - Term, TermId, TermListId, Ty, TyId, TyOfTerm, UnsafeTerm, - }, + validate_and_reorder_args_against_params, validate_and_reorder_pat_args_against_params, + validate_params, AccessTerm, Arg, ArgId, ArgsId, ArrayPat, ArrayTerm, CallTerm, CastTerm, + CtorDefId, CtorPat, CtorTerm, DataDefCtors, DataDefId, DataTy, DerefTerm, FnDefId, FnTy, + HasAstNodeId, IfPat, IndexTerm, Lit, LitId, LoopControlTerm, LoopTerm, MatchTerm, ModDefId, + ModMemberId, ModMemberValue, Node, NodeId, NodeOrigin, NodesId, OrPat, Param, ParamsId, + Pat, PatArgsId, PatId, PatListId, PatOrCapture, PrimitiveCtorInfo, RangePat, RefTerm, + RefTy, ReturnTerm, Spread, SymbolId, Term, TermId, TermListId, TuplePat, TupleTerm, + TupleTy, Ty, TyId, TyOfTerm, UnsafeTerm, }, visitor::{Atom, Visitor}, }; diff --git a/compiler/hash-typecheck/src/lib.rs b/compiler/hash-typecheck/src/lib.rs index 7be2c2725..5ffe8de81 100644 --- a/compiler/hash-typecheck/src/lib.rs +++ b/compiler/hash-typecheck/src/lib.rs @@ -18,7 +18,7 @@ use hash_tir::{ atom_info::HasAtomInfo, context::{Context, HasContext}, intrinsics::make::IntrinsicAbilities, - tir::terms::{fns::FnDefId, TermId}, + tir::{FnDefId, TermId}, }; use inference::InferenceOps; use substitution::SubstitutionOps; diff --git a/compiler/hash-typecheck/src/normalisation.rs b/compiler/hash-typecheck/src/normalisation.rs index 7f6304f98..7e6d75168 100644 --- a/compiler/hash-typecheck/src/normalisation.rs +++ b/compiler/hash-typecheck/src/normalisation.rs @@ -16,23 +16,10 @@ use hash_tir::{ scopes::{AssignTerm, BlockStatement, BlockTerm}, stores::tir_stores, tir::{ - args::{Arg, ArgsId, PatArgsId, PatOrCapture}, - lits::{Lit, LitPat}, - node::{Node, NodeId, NodesId}, - params::ParamIndex, - pats::{Pat, PatId, PatListId, RangePat, Spread}, - symbols::SymbolId, - terms::{ - access::AccessTerm, - arrays::{ArrayTerm, IndexTerm}, - casting::CastTerm, - control::{LoopControlTerm, LoopTerm, MatchTerm, ReturnTerm}, - fns::{CallTerm, FnDefId}, - holes::Hole, - refs::DerefTerm, - tuples::TupleTerm, - Term, TermId, TermListId, Ty, TyId, TyOfTerm, UnsafeTerm, - }, + AccessTerm, Arg, ArgsId, ArrayTerm, CallTerm, CastTerm, DerefTerm, FnDefId, Hole, + IndexTerm, Lit, LitPat, LoopControlTerm, LoopTerm, MatchTerm, Node, NodeId, NodesId, + ParamIndex, Pat, PatArgsId, PatId, PatListId, PatOrCapture, RangePat, ReturnTerm, Spread, + SymbolId, Term, TermId, TermListId, TupleTerm, Ty, TyId, TyOfTerm, UnsafeTerm, }, visitor::{Atom, Visitor}, }; diff --git a/compiler/hash-typecheck/src/substitution.rs b/compiler/hash-typecheck/src/substitution.rs index 39010e6cf..a44514a44 100644 --- a/compiler/hash-typecheck/src/substitution.rs +++ b/compiler/hash-typecheck/src/substitution.rs @@ -8,13 +8,8 @@ use hash_tir::{ context::ContextMember, sub::Sub, tir::{ - args::{ArgsId, PatArgsId}, - mods::ModDefId, - node::NodeId, - params::{ParamId, ParamIndex, ParamsId}, - pats::Pat, - symbols::SymbolId, - terms::{access::AccessTerm, holes::Hole, Term, TermId, Ty}, + AccessTerm, ArgsId, Hole, ModDefId, NodeId, ParamId, ParamIndex, ParamsId, Pat, PatArgsId, + SymbolId, Term, TermId, Ty, }, visitor::{Atom, Visitor}, }; diff --git a/compiler/hash-typecheck/src/unification.rs b/compiler/hash-typecheck/src/unification.rs index d41412cd2..81156742f 100644 --- a/compiler/hash-typecheck/src/unification.rs +++ b/compiler/hash-typecheck/src/unification.rs @@ -7,16 +7,8 @@ use hash_tir::{ context::ScopeKind, sub::Sub, tir::{ - args::ArgsId, - data::DataDefCtors, - lits::Lit, - params::{utils::validate_params, ParamsId}, - symbols::SymbolId, - terms::{ - fns::{CallTerm, FnTy}, - holes::Hole, - Term, TermId, Ty, TyId, - }, + validate_params, ArgsId, CallTerm, DataDefCtors, FnTy, Hole, Lit, ParamsId, SymbolId, Term, + TermId, Ty, TyId, }, visitor::Atom, }; diff --git a/compiler/hash-untyped-semantics/src/visitor.rs b/compiler/hash-untyped-semantics/src/visitor.rs index 14261fde3..d6a31fc95 100644 --- a/compiler/hash-untyped-semantics/src/visitor.rs +++ b/compiler/hash-untyped-semantics/src/visitor.rs @@ -8,8 +8,8 @@ use std::{collections::HashSet, convert::Infallible, mem}; use hash_ast::{ ast::{ - self, walk_mut_self, AstNodeRef, AstVisitorMutSelf, BindingPat, Block, BlockExpr, - Declaration, EnumDef, Expr, LitExpr, Mutability, Name, ParamOrigin, StructDef, + walk_mut_self, AstNodeRef, AstVisitorMutSelf, BindingPat, Block, BlockExpr, Declaration, + EnumDef, Expr, LitExpr, Mutability, Name, ParamOrigin, StructDef, {self}, }, ast_visitor_mut_self_default_impl, origin::BlockOrigin, diff --git a/tests/testing-internal/src/metadata.rs b/tests/testing-internal/src/metadata.rs index 0fc68b843..62f5b06df 100644 --- a/tests/testing-internal/src/metadata.rs +++ b/tests/testing-internal/src/metadata.rs @@ -4,7 +4,9 @@ use std::{ fs, - io::{self, BufRead, BufReader}, + io::{ + BufRead, BufReader, {self}, + }, path::PathBuf, };