Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Check core crates for wasm32-unknown-unknown
run: cargo check -p fe-common -p fe-parser -p fe-hir -p fe-hir-analysis --target wasm32-unknown-unknown
run: cargo check -p fe-common -p fe-parser -p fe-hir --target wasm32-unknown-unknown
- name: Check filesystem crates for wasm32-wasip1
run: cargo check -p fe-driver -p fe-resolver -p fe --target wasm32-wasip1

Expand Down
28 changes: 5 additions & 23 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ edition = "2024"
common = { path = "crates/common", package = "fe-common" }
driver = { path = "crates/driver", package = "fe-driver" }
hir = { path = "crates/hir", package = "fe-hir" }
hir-analysis = { path = "crates/hir-analysis", package = "fe-hir-analysis" }
parser = { path = "crates/parser", package = "fe-parser" }
test-utils = { path = "crates/test-utils", package = "fe-test-utils" }
resolver = { path = "crates/resolver", package = "fe-resolver" }
Expand Down
1 change: 0 additions & 1 deletion crates/driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ smol_str.workspace = true

common.workspace = true
hir.workspace = true
hir-analysis.workspace = true
resolver.workspace = true
url.workspace = true
tracing.workspace = true
12 changes: 6 additions & 6 deletions crates/driver/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ use codespan_reporting::term::{
};
use common::file::File;
use common::{define_input_db, diagnostics::CompleteDiagnostic};
use hir::{
Ingot,
hir_def::TopLevelMod,
lower::{map_file_to_mod, module_tree},
};
use hir_analysis::{
use hir::analysis::{
analysis_pass::{AnalysisPassManager, ParsingPass},
diagnostics::DiagnosticVoucher,
name_resolution::ImportAnalysisPass,
Expand All @@ -19,6 +14,11 @@ use hir_analysis::{
ImplAnalysisPass, ImplTraitAnalysisPass, TraitAnalysisPass, TypeAliasAnalysisPass,
},
};
use hir::{
Ingot,
hir_def::TopLevelMod,
lower::{map_file_to_mod, module_tree},
};

use crate::diagnostics::ToCsDiag;

Expand Down
2 changes: 1 addition & 1 deletion crates/driver/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use common::{
file::File,
};
use cs::{diagnostic as cs_diag, files as cs_files};
use hir_analysis::diagnostics::{DiagnosticVoucher, SpannedHirAnalysisDb};
use hir::analysis::diagnostics::{DiagnosticVoucher, SpannedHirAnalysisDb};

pub trait ToCsDiag {
fn to_cs(&self, db: &dyn SpannedInputDb) -> cs_diag::Diagnostic<File>;
Expand Down
40 changes: 0 additions & 40 deletions crates/hir-analysis/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions crates/hir-analysis/build.rs

This file was deleted.

17 changes: 17 additions & 0 deletions crates/hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,34 @@ description = "Provides HIR definition and lowering for Fe lang"
doctest = false

[dependencies]
bitflags = "2.8"
camino.workspace = true
cranelift-entity = "0.115"
derive_more.workspace = true
dot2 = "1.0"
either = "1.13"
ena = { version = "0.14", features = ["persistent"] }
indexmap = "2.0"
itertools = "0.14"
num-bigint.workspace = true
num-traits = "0.2.19"
paste.workspace = true
rustc-hash.workspace = true
salsa.workspace = true
smallvec.workspace = true
smallvec1.workspace = true
thin-vec.workspace = true
tracing.workspace = true

common.workspace = true
parser.workspace = true
test-utils.workspace = true
url.workspace = true

[dev-dependencies]
ascii_tree = "0.1"
camino.workspace = true
codespan-reporting.workspace = true
dir-test.workspace = true
driver.workspace = true
test-utils.workspace = true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{HirAnalysisDb, diagnostics::DiagnosticVoucher};
use hir::{
use crate::analysis::{HirAnalysisDb, diagnostics::DiagnosticVoucher};
use crate::{
ParserError,
hir_def::{ModuleTree, TopLevelMod},
lower::parse_file_impl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! implement [`DiagnosticVoucher`] which defines the conversion into
//! [`CompleteDiagnostic`].

use crate::{
use crate::analysis::{
HirAnalysisDb,
name_resolution::diagnostics::{ImportDiag, PathResDiag},
ty::{
Expand All @@ -16,16 +16,16 @@ use crate::{
ty_def::{TyData, TyVarSort},
},
};
use crate::{
ParserError, SpannedHirDb,
hir_def::{FieldIndex, PathKind},
span::LazySpan,
};
use common::diagnostics::{
CompleteDiagnostic, DiagnosticPass, GlobalErrorCode, LabelStyle, Severity, Span, SpanKind,
SubDiagnostic,
};
use either::Either;
use hir::{
ParserError, SpannedHirDb,
hir_def::{FieldIndex, PathKind},
span::LazySpan,
};
use itertools::Itertools;

/// All diagnostics accumulated in salsa-db should implement
Expand Down Expand Up @@ -54,7 +54,7 @@ impl DiagnosticVoucher for CompleteDiagnostic {

#[salsa::db]
pub trait SpannedHirAnalysisDb:
salsa::Database + hir::HirDb + hir::SpannedHirDb + HirAnalysisDb
salsa::Database + crate::HirDb + crate::SpannedHirDb + HirAnalysisDb
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use hir::{HirDb, span::DynLazySpan};
use crate::{HirDb, span::DynLazySpan};
pub mod analysis_pass;
pub mod diagnostics;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use either::Either;
use hir::{
use crate::{
hir_def::{IdentId, PathId, TopLevelMod, Trait},
span::DynLazySpan,
};
use either::Either;
use salsa::Update;
use thin_vec::ThinVec;

use super::NameRes;
use crate::{
use crate::analysis::{
HirAnalysisDb,
ty::ty_def::Kind,
ty::{func_def::FuncDef, trait_def::TraitInstId, ty_def::TyId},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use std::{
mem,
};

use common::{indexmap::IndexMap, ingot::Ingot};
use hir::{
use crate::{
hir_def::{HirIngot, IdentId, Use, prim_ty::PrimTy, scope_graph::ScopeId},
span::DynLazySpan,
};
use common::{indexmap::IndexMap, ingot::Ingot};
use itertools::Itertools;
use rustc_hash::{FxHashMap, FxHashSet};
use salsa::Update;
Expand All @@ -22,7 +22,7 @@ use super::{
NameResolutionResult, NameResolver, QueryDirective,
},
};
use crate::{HirAnalysisDb, name_resolution::visibility_checker::is_use_visible};
use crate::analysis::{HirAnalysisDb, name_resolution::visibility_checker::is_use_visible};

pub(crate) struct ImportResolver<'db> {
db: &'db dyn HirAnalysisDb,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::hir_def::{IdentId, Trait, scope_graph::ScopeId};
use common::indexmap::IndexSet;
use hir::hir_def::{IdentId, Trait, scope_graph::ScopeId};
use rustc_hash::FxHashSet;
use thin_vec::ThinVec;

use crate::{
use crate::analysis::{
HirAnalysisDb,
name_resolution::{available_traits_in_scope, is_scope_visible_from},
ty::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ mod path_resolver;
pub(crate) mod traits_in_scope;
mod visibility_checker;

use crate::hir_def::TopLevelMod;
use common::ingot::Ingot;
use hir::hir_def::TopLevelMod;
pub use import_resolver::ResolvedImports;
pub use name_resolver::{
EarlyNameQueryId, NameDerivation, NameDomain, NameRes, NameResBucket, NameResKind,
Expand All @@ -23,7 +23,9 @@ pub use traits_in_scope::available_traits_in_scope;
pub(crate) use visibility_checker::is_scope_visible_from;

use self::{diagnostics::ImportDiag, import_resolver::DefaultImporter};
use crate::{HirAnalysisDb, analysis_pass::ModuleAnalysisPass, diagnostics::DiagnosticVoucher};
use crate::analysis::{
HirAnalysisDb, analysis_pass::ModuleAnalysisPass, diagnostics::DiagnosticVoucher,
};

#[salsa::tracked(return_ref)]
pub fn resolve_query<'db>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{cmp, fmt, mem};

use bitflags::bitflags;
use hir::{
use crate::{
hir_def::{
Enum, EnumVariant, GenericParam, GenericParamOwner, HirIngot, IdentId, ItemKind, Mod,
TopLevelMod, Trait, Use,
Expand All @@ -14,6 +13,7 @@ use hir::{
},
span::DynLazySpan,
};
use bitflags::bitflags;
use rustc_hash::{FxHashMap, FxHashSet};
use salsa::Update;
use thin_vec::ThinVec;
Expand All @@ -22,7 +22,7 @@ use super::{
import_resolver::Importer,
visibility_checker::{is_scope_visible_from, is_use_visible},
};
use crate::HirAnalysisDb;
use crate::analysis::HirAnalysisDb;

#[salsa::interned]
#[derive(Debug)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use common::indexmap::IndexMap;
use either::Either;
use hir::{
use crate::{
hir_def::{
Const, Enum, EnumVariant, GenericParamOwner, IdentId, ImplTrait, ItemKind, Partial, PathId,
PathKind, Trait, TypeBound, TypeId, TypeKind, VariantKind, scope_graph::ScopeId,
},
span::{DynLazySpan, path::LazyPathSpan},
};
use common::indexmap::IndexMap;
use either::Either;
use smallvec::{SmallVec, smallvec};
use thin_vec::ThinVec;

Expand All @@ -19,7 +19,7 @@ use super::{
resolve_query,
visibility_checker::is_ty_visible_from,
};
use crate::{
use crate::analysis::{
HirAnalysisDb,
name_resolution::{NameResKind, QueryDirective},
ty::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::hir_def::{Body, ExprId, ItemKind, Mod, TopLevelMod, Trait, scope_graph::ScopeId};
use common::indexmap::IndexSet;
use hir::hir_def::{Body, ExprId, ItemKind, Mod, TopLevelMod, Trait, scope_graph::ScopeId};

use crate::{HirAnalysisDb, name_resolution::resolve_imports};
use crate::analysis::{HirAnalysisDb, name_resolution::resolve_imports};

/// Returns the all traits that are available in the given scope.
pub fn available_traits_in_scope<'db>(
Expand Down
Loading
Loading