Fix some warnings
This commit is contained in:
		
							parent
							
								
									9df1593de9
								
							
						
					
					
						commit
						97f5eebf22
					
				| @ -131,7 +131,7 @@ impl InstructionHolder { | |||||||
|     fn builder_fmt( |     fn builder_fmt( | ||||||
|         &self, |         &self, | ||||||
|         f: &mut impl std::fmt::Write, |         f: &mut impl std::fmt::Write, | ||||||
|         builder: &Builder, |         _builder: &Builder, | ||||||
|         debug: &Option<DebugInformation>, |         debug: &Option<DebugInformation>, | ||||||
|     ) -> std::fmt::Result { |     ) -> std::fmt::Result { | ||||||
|         if let Some(record) = &self.record { |         if let Some(record) = &self.record { | ||||||
| @ -171,8 +171,8 @@ impl TerminatorKind { | |||||||
|     fn builder_fmt( |     fn builder_fmt( | ||||||
|         &self, |         &self, | ||||||
|         f: &mut impl std::fmt::Write, |         f: &mut impl std::fmt::Write, | ||||||
|         builder: &Builder, |         _builder: &Builder, | ||||||
|         debug: &Option<DebugInformation>, |         _debug: &Option<DebugInformation>, | ||||||
|     ) -> std::fmt::Result { |     ) -> std::fmt::Result { | ||||||
|         match self { |         match self { | ||||||
|             TerminatorKind::Ret(instr) => writeln!(f, "ret {:?}", instr), |             TerminatorKind::Ret(instr) => writeln!(f, "ret {:?}", instr), | ||||||
|  | |||||||
| @ -7,10 +7,8 @@ use std::{fmt::Debug, marker::PhantomData}; | |||||||
| use builder::{BlockValue, Builder, FunctionValue, InstructionValue, ModuleValue, TypeValue}; | use builder::{BlockValue, Builder, FunctionValue, InstructionValue, ModuleValue, TypeValue}; | ||||||
| use debug_information::{ | use debug_information::{ | ||||||
|     DebugFileData, DebugInformation, DebugLocationValue, DebugMetadataValue, DebugProgramValue, |     DebugFileData, DebugInformation, DebugLocationValue, DebugMetadataValue, DebugProgramValue, | ||||||
|     InstructionDebugRecordData, |  | ||||||
| }; | }; | ||||||
| use fmt::PrintableModule; | use fmt::PrintableModule; | ||||||
| use util::match_types; |  | ||||||
| 
 | 
 | ||||||
| pub mod builder; | pub mod builder; | ||||||
| pub mod compile; | pub mod compile; | ||||||
|  | |||||||
| @ -1,12 +1,12 @@ | |||||||
| use std::{array, collections::HashMap, hash::Hash, mem}; | use std::{collections::HashMap, mem}; | ||||||
| 
 | 
 | ||||||
| use reid_lib::{ | use reid_lib::{ | ||||||
|     builder::{InstructionValue, ModuleValue, TypeValue}, |     builder::{InstructionValue, TypeValue}, | ||||||
|     compile::CompiledModule, |     compile::CompiledModule, | ||||||
|     debug_information::{ |     debug_information::{ | ||||||
|         DebugArrayType, DebugBasicType, DebugFieldType, DebugFileData, DebugInformation, |         DebugArrayType, DebugBasicType, DebugFieldType, DebugFileData, DebugInformation, | ||||||
|         DebugLocalVariable, DebugLocation, DebugMetadata, DebugParamVariable, DebugPointerType, |         DebugLocalVariable, DebugLocation, DebugMetadata, DebugPointerType, DebugPosition, | ||||||
|         DebugPosition, DebugProgramValue, DebugRecordKind, DebugStructType, DebugSubprogramData, |         DebugProgramValue, DebugRecordKind, DebugStructType, DebugSubprogramData, | ||||||
|         DebugSubprogramOptionals, DebugSubprogramType, DebugTypeData, DebugTypeValue, |         DebugSubprogramOptionals, DebugSubprogramType, DebugTypeData, DebugTypeValue, | ||||||
|         DwarfEncoding, DwarfFlags, InstructionDebugRecordData, |         DwarfEncoding, DwarfFlags, InstructionDebugRecordData, | ||||||
|     }, |     }, | ||||||
| @ -15,12 +15,10 @@ use reid_lib::{ | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| use crate::{ | use crate::{ | ||||||
|     error_raporting::ErrorModules, |  | ||||||
|     lexer::{FullToken, Position}, |     lexer::{FullToken, Position}, | ||||||
|     mir::{ |     mir::{ | ||||||
|         self, implement::TypeCategory, CustomTypeKey, Metadata, ModuleMap, NamedVariableRef, |         self, implement::TypeCategory, CustomTypeKey, Metadata, NamedVariableRef, SourceModuleId, | ||||||
|         SourceModuleId, StructField, StructType, TypeDefinition, TypeDefinitionKind, TypeKind, |         StructField, StructType, TypeDefinition, TypeDefinitionKind, TypeKind, VagueLiteral, | ||||||
|         VagueLiteral, |  | ||||||
|     }, |     }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -57,9 +55,6 @@ impl mir::Context { | |||||||
| #[derive(Clone)] | #[derive(Clone)] | ||||||
| struct ModuleCodegen<'ctx> { | struct ModuleCodegen<'ctx> { | ||||||
|     module: Module<'ctx>, |     module: Module<'ctx>, | ||||||
|     tokens: &'ctx Vec<FullToken>, |  | ||||||
|     debug_types: Option<HashMap<TypeKind, DebugTypeValue>>, |  | ||||||
|     type_values: HashMap<CustomTypeKey, TypeValue>, |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl<'ctx> std::fmt::Debug for ModuleCodegen<'ctx> { | impl<'ctx> std::fmt::Debug for ModuleCodegen<'ctx> { | ||||||
| @ -456,12 +451,7 @@ impl mir::Module { | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         ModuleCodegen { |         ModuleCodegen { module } | ||||||
|             module, |  | ||||||
|             debug_types: Some(debug_types), |  | ||||||
|             type_values, |  | ||||||
|             tokens: &self.tokens, |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| use std::{fmt::Debug, hint::unreachable_unchecked, str::Chars}; | use std::{fmt::Debug, str::Chars}; | ||||||
| 
 | 
 | ||||||
| static DECIMAL_NUMERICS: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; | static DECIMAL_NUMERICS: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -2,10 +2,7 @@ use std::fmt::{Debug, Display, Write}; | |||||||
| 
 | 
 | ||||||
| use crate::pad_adapter::PadAdapter; | use crate::pad_adapter::PadAdapter; | ||||||
| 
 | 
 | ||||||
| use super::{ | use super::{typerefs::TypeRefs, *}; | ||||||
|     typerefs::{TypeRef, TypeRefs}, |  | ||||||
|     *, |  | ||||||
| }; |  | ||||||
| 
 | 
 | ||||||
| impl Display for TypeRefs { | impl Display for TypeRefs { | ||||||
|     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||||||
|  | |||||||
| @ -10,7 +10,7 @@ use std::{ | |||||||
| use crate::{ | use crate::{ | ||||||
|     compile_module, |     compile_module, | ||||||
|     error_raporting::{ErrorModules, ReidError}, |     error_raporting::{ErrorModules, ReidError}, | ||||||
|     mir::{SourceModuleId, TypeDefinition, CustomTypeKey, TypeKind}, |     mir::{CustomTypeKey, SourceModuleId, TypeDefinition, TypeKind}, | ||||||
|     parse_module, |     parse_module, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -232,7 +232,7 @@ impl<'map> Pass for LinkerPass<'map> { | |||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 fn import_type(base: &String, ty: &TypeKind) -> (TypeKind, Vec<CustomTypeKey>) { |                 fn import_type(_: &String, ty: &TypeKind) -> (TypeKind, Vec<CustomTypeKey>) { | ||||||
|                     let mut imported_types = Vec::new(); |                     let mut imported_types = Vec::new(); | ||||||
|                     let ty = match &ty { |                     let ty = match &ty { | ||||||
|                         TypeKind::CustomType(key) => { |                         TypeKind::CustomType(key) => { | ||||||
|  | |||||||
| @ -9,7 +9,6 @@ use std::{convert::Infallible, iter}; | |||||||
| use crate::{mir::TypeKind, util::try_all}; | use crate::{mir::TypeKind, util::try_all}; | ||||||
| 
 | 
 | ||||||
| use super::{ | use super::{ | ||||||
|     implement::pick_return, |  | ||||||
|     pass::{Pass, PassResult, PassState}, |     pass::{Pass, PassResult, PassState}, | ||||||
|     typecheck::ErrorKind, |     typecheck::ErrorKind, | ||||||
|     typerefs::{ScopeTypeRefs, TypeRef, TypeRefs}, |     typerefs::{ScopeTypeRefs, TypeRef, TypeRefs}, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user