|
1 | | -use std::clone; |
2 | | - |
3 | 1 | use astoir_hir::nodes::{HIRNode, HIRNodeKind}; |
4 | 2 | use astoir_mir::{blocks::refer::MIRBlockReference, builder::{build_comp_eq, build_field_pointer, build_ir_cast, build_load, build_unsigned_int_const}, vals::{base::BaseMIRValue, int::MIRIntValue}}; |
5 | 3 | use compiler_typing::{SizedType, raw::RawType, tree::Type}; |
6 | 4 | use diagnostics::{DiagnosticResult, DiagnosticSpanOrigin, builders::{make_req_type_kind, make_type_not_partof}}; |
7 | 5 |
|
8 | 6 | use crate::{MIRLoweringContext, lower_hir_type, values::lower_hir_value, vars::lower_hir_variable_reference}; |
9 | 7 |
|
10 | | -pub fn is_enum_value_of_kind<K: DiagnosticSpanOrigin>(block: MIRBlockReference, val: BaseMIRValue, enum_entry: RawType, ctx: &mut MIRLoweringContext, origin: &K) -> DiagnosticResult<MIRIntValue> { |
| 8 | +pub fn is_enum_value_of_kind<K: DiagnosticSpanOrigin>(_block: MIRBlockReference, val: BaseMIRValue, enum_entry: RawType, ctx: &mut MIRLoweringContext, origin: &K) -> DiagnosticResult<MIRIntValue> { |
11 | 9 | let enum_type = match ctx.mir_ctx.ssa_hints.get_hint(val.get_ssa_index()).get_type().as_generic_lowered_safe(origin)? { |
12 | 10 | RawType::Enum(v) => v, |
13 | 11 | RawType::LoweredStruct(_, container) => { |
@@ -48,7 +46,7 @@ pub fn is_enum_value_of_kind<K: DiagnosticSpanOrigin>(block: MIRBlockReference, |
48 | 46 | return build_comp_eq(&mut ctx.mir_ctx, hint_val, hint_true); |
49 | 47 | } |
50 | 48 |
|
51 | | -pub fn cast_to_enum_child<K: DiagnosticSpanOrigin>(block: MIRBlockReference, val: BaseMIRValue, enum_entry: RawType, ctx: &mut MIRLoweringContext, origin: &K) -> DiagnosticResult<BaseMIRValue> { |
| 49 | +pub fn cast_to_enum_child<K: DiagnosticSpanOrigin>(_block: MIRBlockReference, val: BaseMIRValue, enum_entry: RawType, ctx: &mut MIRLoweringContext, origin: &K) -> DiagnosticResult<BaseMIRValue> { |
52 | 50 | let enum_type = match ctx.mir_ctx.ssa_hints.get_hint(val.get_ssa_index()).get_type().as_generic_lowered_safe(origin)? { |
53 | 51 | RawType::Enum(v) => v, |
54 | 52 | RawType::LoweredStruct(_, container) => { |
@@ -107,7 +105,7 @@ pub fn lower_hir_unwrap_cond(block: MIRBlockReference, node: Box<HIRNode>, ctx: |
107 | 105 | } |
108 | 106 |
|
109 | 107 | pub fn lower_hir_unwrap_value(block: MIRBlockReference, node: Box<HIRNode>, ctx: &mut MIRLoweringContext) -> DiagnosticResult<BaseMIRValue> { |
110 | | - if let HIRNodeKind::UnwrapValue { original, new_type, unsafe_unwrap } = node.kind.clone() { |
| 108 | + if let HIRNodeKind::UnwrapValue { original, new_type, unsafe_unwrap: _ } = node.kind.clone() { |
111 | 109 | let original = lower_hir_value(block, original, ctx)?; |
112 | 110 | let new_type = lower_hir_type(ctx, new_type)?; |
113 | 111 |
|
|
0 commit comments