Skip to content

Commit d83934e

Browse files
committed
chore: removed all of the warnings
1 parent 5510645 commit d83934e

17 files changed

Lines changed: 32 additions & 32 deletions

File tree

compiler/ast_parser/src/structs/enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use ast::{tree::{ASTTreeNode, ASTTreeNodeKind}, types::ASTType};
22
use compiler_utils::hash::HashedString;
3-
use diagnostics::{DiagnosticResult, diagnostic::Diagnostic};
3+
use diagnostics::{DiagnosticResult};
44
use lexer::token::{LexerToken, LexerTokenType};
55

6-
use crate::{functions::parse_function_declaraction, structs::members::parse_types_field_member, types::{parse_type_generic, parse_type_parameters_declaration}};
6+
use crate::{functions::parse_function_declaraction, structs::members::parse_types_field_member, types::{parse_type_parameters_declaration}};
77

88
pub fn parse_enum_entry(tokens: &Vec<LexerToken>, ind: &mut usize) -> DiagnosticResult<Box<ASTTreeNode>> {
99
let start = tokens[*ind].pos.clone();

compiler/ast_parser/src/use_statements.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ pub fn parse_use_statement(tokens: &Vec<LexerToken>, ind: &mut usize) -> Diagnos
4040

4141
*ind += 1;
4242

43-
return Ok((Box::new(ASTTreeNode::new(ASTTreeNodeKind::UseStatement { shards: steps, use_clauses: uses }, start, tokens[*ind].get_end_pos()))))
43+
return Ok(Box::new(ASTTreeNode::new(ASTTreeNodeKind::UseStatement { shards: steps, use_clauses: uses }, start, tokens[*ind].get_end_pos())))
4444
}

compiler/astoir_hir/src/nodes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use std::collections::HashMap;
44

5-
use compiler_typing::{enums::{RawEnumEntryContainer, RawEnumTypeContainer}, raw::RawType, references::TypeReference, storage::{BOOLEAN_TYPE, STATIC_STR}, structs::RawStructTypeContainer, transmutation::array::can_transmute_inner, tree::Type};
5+
use compiler_typing::{enums::{RawEnumTypeContainer}, raw::RawType, references::TypeReference, structs::RawStructTypeContainer, transmutation::array::can_transmute_inner, tree::Type};
66
use compiler_utils::{Position, hash::SelfHash};
77
use diagnostics::{DiagnosticSpanOrigin, builders::{make_diff_type, make_diff_type_val}, diagnostic::{Diagnostic, Span, SpanKind, SpanPosition}, unsure_panic};
88
use lexer::toks::{comp::ComparingOperator, math::MathOperator};

compiler/astoir_hir_lowering/src/enums.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn lower_ast_enum_entry(context: &mut HIRContext, node: Box<ASTTreeNode>, co
2929
}
3030

3131
pub fn lower_ast_enum(context: &mut HIRContext, node: Box<ASTTreeNode>) -> DiagnosticResult<Box<HIRNode>> {
32-
if let ASTTreeNodeKind::EnumDeclaration { name, entries, functions, type_params } = node.kind.clone() {
32+
if let ASTTreeNodeKind::EnumDeclaration { name, entries, functions: _, type_params } = node.kind.clone() {
3333
let mut container = RawEnumTypeContainer::new(context.type_storage.types.vals.len(), type_params);
3434

3535
for entry in entries {

compiler/astoir_mir/src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Utility functions to build instructions and more
22
33
use compiler_typing::{SizedType, raw::RawType, storage::TypeStorage, tree::Type};
4-
use diagnostics::{DiagnosticResult, MaybeDiagnostic, diagnostic::Diagnostic, unsure_panic};
4+
use diagnostics::{DiagnosticResult, MaybeDiagnostic, unsure_panic};
55

66
use crate::{blocks::{hints::MIRValueHint, refer::MIRBlockReference}, ctx::MIRContext, insts::MIRInstruction, vals::{arrays::MIRArrayValue, base::BaseMIRValue, float::MIRFloatValue, int::MIRIntValue, ptr::MIRPointerValue, structs::MIRStructValue}};
77

compiler/astoir_mir_lowering/src/casts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use diagnostics::DiagnosticResult;
55
use crate::{MIRLoweringContext, lower_hir_type, values::lower_hir_value};
66

77
pub fn lower_cast(block: MIRBlockReference, node: Box<HIRNode>, ctx: &mut MIRLoweringContext) -> DiagnosticResult<BaseMIRValue> {
8-
if let HIRNodeKind::CastValue { intentional, value, old_type, new_type } = node.kind.clone() {
8+
if let HIRNodeKind::CastValue { intentional: _, value, old_type, new_type } = node.kind.clone() {
99
let value = lower_hir_value(block, value, ctx)?;
1010
let old_type = lower_hir_type(ctx, old_type)?;
1111

compiler/astoir_mir_lowering/src/introductions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn handle_var_introduction_queue(block: MIRBlockReference, node: Box<HIRNode
1313
let new_var = new_var.unwrap();
1414
let eligible = ctx.hir_ctx.function_contexts[func].as_ref().unwrap().is_eligible_for_ssa(new_var);
1515

16-
let casted = cast_to_enum_child(block, original, new_type.as_generic(&ctx.hir_ctx.type_storage), ctx, &*node)?;
16+
let casted = cast_to_enum_child(block, original, new_type.as_generic(), ctx, &*node)?;
1717

1818
if eligible {
1919
ctx.mir_ctx.blocks[block].variables.insert(new_var, MIRBlockVariableSSAHint { kind: MIRBlockVariableType::SSA, hint: Some(casted) });

compiler/astoir_mir_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::HashMap, hash::Hash};
1+
use std::{collections::HashMap};
22

33
use astoir_hir::{ctx::HIRContext, nodes::{HIRNode, HIRNodeKind}};
44
use astoir_mir::ctx::MIRContext;

compiler/astoir_mir_lowering/src/type_tools.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
use std::clone;
2-
31
use astoir_hir::nodes::{HIRNode, HIRNodeKind};
42
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}};
53
use compiler_typing::{SizedType, raw::RawType, tree::Type};
64
use diagnostics::{DiagnosticResult, DiagnosticSpanOrigin, builders::{make_req_type_kind, make_type_not_partof}};
75

86
use crate::{MIRLoweringContext, lower_hir_type, values::lower_hir_value, vars::lower_hir_variable_reference};
97

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> {
119
let enum_type = match ctx.mir_ctx.ssa_hints.get_hint(val.get_ssa_index()).get_type().as_generic_lowered_safe(origin)? {
1210
RawType::Enum(v) => v,
1311
RawType::LoweredStruct(_, container) => {
@@ -48,7 +46,7 @@ pub fn is_enum_value_of_kind<K: DiagnosticSpanOrigin>(block: MIRBlockReference,
4846
return build_comp_eq(&mut ctx.mir_ctx, hint_val, hint_true);
4947
}
5048

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> {
5250
let enum_type = match ctx.mir_ctx.ssa_hints.get_hint(val.get_ssa_index()).get_type().as_generic_lowered_safe(origin)? {
5351
RawType::Enum(v) => v,
5452
RawType::LoweredStruct(_, container) => {
@@ -107,7 +105,7 @@ pub fn lower_hir_unwrap_cond(block: MIRBlockReference, node: Box<HIRNode>, ctx:
107105
}
108106

109107
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() {
111109
let original = lower_hir_value(block, original, ctx)?;
112110
let new_type = lower_hir_type(ctx, new_type)?;
113111

compiler/compiler_main/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ astoir = { path = "../astoir" }
88
ast = { path = "../ast" }
99
ast_parser = { path = "../ast_parser" }
1010
lexer = { path = "../lexer" }
11-
llvm_ir_bridge = { path = "../llvm_ir_bridge", optional = true }
11+
llvm_ir_bridge = { path = "../llvm_ir_bridge", optional = true, default-features = false}
1212
diagnostics = { path = "../diagnostics" }
1313
compiler_utils = { path = "../compiler_utils" }
1414

0 commit comments

Comments
 (0)