Skip to content

Commit

Permalink
Merge branch 'hash-org:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
yrnehli authored Apr 7, 2024
2 parents d26cac4 + 272e0da commit e99dd76
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 16 deletions.
5 changes: 3 additions & 2 deletions compiler/hash-ast-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! Defines various utilties that can be used on the AST. Mainly, this
//! Defines various utilities that can be used on the AST. Mainly, this
//! crate defines AST printing functionalities, including the `tree` view
//! and the `pretty` prininging view, in addition to the implementation of
//! and the `pretty` printing view, in addition to the implementation of
//! the `#dump_ast` directive.
#![feature(let_chains)]
#![allow(dead_code)]

pub mod attr;
pub mod dump;
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-attrs/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define_index_type! {
/// map spans to nodes, and vice versa. [AstNodeId]s are unique and
/// they are always increasing as a new nodes are created.
pub struct AttrId = u32;
MAX_INDEX = i32::max_value() as usize;
MAX_INDEX = i32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/hash-exhaustiveness/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ define_index_type! {
/// Id of a [DeconstructedPat] in the [ExhaustivenessCtx].
pub struct DeconstructedPatId = u32;

MAX_INDEX = u32::max_value() as usize;
MAX_INDEX = u32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));
}

define_index_type! {
/// Id of a [DeconstructedCtor] in the [ExhaustivenessCtx].
pub struct DeconstructedCtorId = u32;

MAX_INDEX = u32::max_value() as usize;
MAX_INDEX = u32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/hash-ir/src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ index_vec::define_index_type! {
/// Index for [BasicBlockData] stores within generated [Body]s.
pub struct BasicBlock = u32;

MAX_INDEX = u32::max_value() as usize;
MAX_INDEX = u32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));

DEBUG_FORMAT = "bb{}";
Expand All @@ -868,7 +868,7 @@ index_vec::define_index_type! {
/// Index for [LocalDecl] stores within generated [Body]s.
pub struct Local = u32;

MAX_INDEX = u32::max_value() as usize;
MAX_INDEX = u32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));

DEBUG_FORMAT = "_{}";
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-lower/src/build/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<'tcx> BodyBuilder<'tcx> {
}
Term::Call(ref fn_term @ CallTerm { subject, args, .. }) => {
match self.classify_fn_call_term(fn_term) {
FnCallTermKind::Call(_) => {
FnCallTermKind::Call => {
// Get the type of the function into or to to get the
// fn-type so that we can enter the scope.
let ty = self.ctx.get_inferred_ty(subject);
Expand Down
6 changes: 3 additions & 3 deletions compiler/hash-lower/src/build/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use super::BodyBuilder;
pub enum FnCallTermKind {
/// A function call, the term doesn't change and should just be
/// handled as a function call.
Call(CallTerm),
Call,

/// A cast intrinsic operation, we perform a cast from the type of the
/// first term into the desired second [ReprTyId].
Expand Down Expand Up @@ -174,13 +174,13 @@ impl<'tcx> BodyBuilder<'tcx> {
| TirIntrinsic::Memcmp
| TirIntrinsic::Memcpy
| TirIntrinsic::Abort
| TirIntrinsic::Panic => FnCallTermKind::Call(*term),
| TirIntrinsic::Panic => FnCallTermKind::Call,
TirIntrinsic::Eval | TirIntrinsic::UserError | TirIntrinsic::DebugPrint => {
panic!("Found unexpected intrinsic {} which should have been evaluated during TC", intrinsic)
}
}
}
_ => FnCallTermKind::Call(*term),
_ => FnCallTermKind::Call,
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-repr/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ index_vec::define_index_type! {
/// Index for [VariantIdx] stores within generated [Body]s.
pub struct VariantIdx = u32;

MAX_INDEX = i32::max_value() as usize;
MAX_INDEX = i32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));

DEBUG_FORMAT = "variant#{}";
Expand Down
4 changes: 2 additions & 2 deletions compiler/hash-source/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define_index_type! {
/// A [ModuleId] is a [SourceId] which points to a module.
pub struct ModuleId = u32;

MAX_INDEX = u32::max_value() as usize;
MAX_INDEX = u32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));

DEBUG_FORMAT = "module:{}";
Expand All @@ -42,7 +42,7 @@ define_index_type! {
/// An [InteractiveId] is a [SourceId] which points to an interactive block.
pub struct InteractiveId = u32;

MAX_INDEX = u32::max_value() as usize;
MAX_INDEX = u32::MAX as usize;
DISABLE_MAX_INDEX_CHECK = cfg!(not(debug_assertions));

DEBUG_FORMAT = "interactive:{}";
Expand Down
2 changes: 0 additions & 2 deletions compiler/hash-vm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! Hash Compiler VM crate.
#![feature(unchecked_math)]

mod heap;
mod stack;

Expand Down

0 comments on commit e99dd76

Please sign in to comment.