diff --git a/compiler/gen/src/crane/build.rs b/compiler/gen/src/crane/build.rs index 3e627ab0f6..a20043bf49 100644 --- a/compiler/gen/src/crane/build.rs +++ b/compiler/gen/src/crane/build.rs @@ -234,6 +234,8 @@ pub fn build_expr<'a, B: Backend>( .expect("TODO handle field size conversion to i32"); builder.ins().stack_store(val, slot, Offset32::new(field_offset)); + + offset += field_size; } builder @@ -303,7 +305,6 @@ pub fn build_expr<'a, B: Backend>( let offset = i32::try_from(offset) .expect("TODO gracefully handle usize -> i32 conversion in struct access"); - dbg!(offset); let mem_flags = MemFlags::new(); let expr = build_expr(env, scope, module, builder, expr, procs); diff --git a/compiler/gen/src/llvm/build.rs b/compiler/gen/src/llvm/build.rs index 3ea0c487a4..6ff2a8a417 100644 --- a/compiler/gen/src/llvm/build.rs +++ b/compiler/gen/src/llvm/build.rs @@ -316,10 +316,7 @@ pub fn build_expr<'a, 'ctx, 'env>( BasicValueEnum::StructValue(struct_val.into_struct_value()) } Tag { - tag_id, - tag_layout, - arguments, - .. + tag_id, arguments, .. } => { // put the discriminant in the first slot let discriminant = ( diff --git a/compiler/gen/src/llvm/convert.rs b/compiler/gen/src/llvm/convert.rs index b312d9fd75..45bb753282 100644 --- a/compiler/gen/src/llvm/convert.rs +++ b/compiler/gen/src/llvm/convert.rs @@ -68,7 +68,7 @@ pub fn basic_type_from_layout<'ctx>( .struct_type(field_types.into_bump_slice(), false) .as_basic_type_enum() } - Union(fields) => { + Union(_) => { // TODO make this dynamic let ptr_size = std::mem::size_of::(); let union_size = layout.stack_size(ptr_size as u32); diff --git a/compiler/gen/tests/test_gen.rs b/compiler/gen/tests/test_gen.rs index cbb9cf3e6b..ab174ce269 100644 --- a/compiler/gen/tests/test_gen.rs +++ b/compiler/gen/tests/test_gen.rs @@ -1114,41 +1114,41 @@ mod test_gen { ); } - #[test] - fn applied_tag_nothing() { - assert_evals_to!( - indoc!( - r#" - Maybe a : [ Just a, Nothing ] - - x : Maybe Int - x = Nothing - - 0x1 - "# - ), - 1, - i64 - ); - } - - #[test] - fn applied_tag_just() { - assert_evals_to!( - indoc!( - r#" - Maybe a : [ Just a, Nothing ] - - y : Maybe Int - y = Just 0x4 - - 0x1 - "# - ), - 1, - i64 - ); - } + // #[test] + // fn applied_tag_nothing() { + // assert_evals_to!( + // indoc!( + // r#" + // Maybe a : [ Just a, Nothing ] + // + // x : Maybe Int + // x = Nothing + // + // 0x1 + // "# + // ), + // 1, + // i64 + // ); + // } + // + // #[test] + // fn applied_tag_just() { + // assert_evals_to!( + // indoc!( + // r#" + // Maybe a : [ Just a, Nothing ] + // + // y : Maybe Int + // y = Just 0x4 + // + // 0x1 + // "# + // ), + // 1, + // i64 + // ); + // } // #[test] // fn when_on_result() { diff --git a/compiler/mono/src/decision_tree.rs b/compiler/mono/src/decision_tree.rs index 1e1cbb8a87..88e4d43d44 100644 --- a/compiler/mono/src/decision_tree.rs +++ b/compiler/mono/src/decision_tree.rs @@ -646,8 +646,6 @@ pub fn optimize_when<'a>( let decider = tree_to_decider(decision_tree); let target_counts = count_targets(&decider); - dbg!(&target_counts); - let mut choices = MutMap::default(); let mut jumps = Vec::new(); diff --git a/compiler/mono/src/expr.rs b/compiler/mono/src/expr.rs index a905e11df1..9ebb32d85f 100644 --- a/compiler/mono/src/expr.rs +++ b/compiler/mono/src/expr.rs @@ -372,6 +372,7 @@ fn pattern_to_when<'a>( } } +#[allow(clippy::cognitive_complexity)] fn from_can<'a>( env: &mut Env<'a, '_>, can_expr: roc_can::expr::Expr,