diff --git a/crates/mun_codegen/src/code_gen/error.rs b/crates/mun_codegen/src/code_gen/error.rs index 210c890ee..e6bc58ddd 100644 --- a/crates/mun_codegen/src/code_gen/error.rs +++ b/crates/mun_codegen/src/code_gen/error.rs @@ -8,5 +8,5 @@ pub enum CodeGenerationError { #[error("error creating object file")] CouldNotCreateObjectFile(io::Error), #[error("error generating machine code")] - CodeGenerationError(String), + MachineCodeError(String), } diff --git a/crates/mun_codegen/src/code_gen/object_file.rs b/crates/mun_codegen/src/code_gen/object_file.rs index 99ef2917c..384ceaa97 100644 --- a/crates/mun_codegen/src/code_gen/object_file.rs +++ b/crates/mun_codegen/src/code_gen/object_file.rs @@ -19,7 +19,7 @@ impl ObjectFile { ) -> Result { let obj = target_machine .write_to_memory_buffer(module, FileType::Object) - .map_err(|e| CodeGenerationError::CodeGenerationError(e.to_string()))?; + .map_err(|e| CodeGenerationError::MachineCodeError(e.to_string()))?; let mut obj_file = tempfile::NamedTempFile::new() .map_err(CodeGenerationError::CouldNotCreateObjectFile)?; diff --git a/crates/mun_codegen/src/ir/body.rs b/crates/mun_codegen/src/ir/body.rs index f4fd6d4f6..53962356e 100644 --- a/crates/mun_codegen/src/ir/body.rs +++ b/crates/mun_codegen/src/ir/body.rs @@ -411,7 +411,7 @@ impl<'db, 'ink, 't> BodyIrGenerator<'db, 'ink, 't> { struct_ir_ty .ptr_type(AddressSpace::Generic) .ptr_type(AddressSpace::Generic), - &format!("{}_ptr_ptr", hir_struct.name(self.db).to_string()), + &format!("{}_ptr_ptr", hir_struct.name(self.db)), ) .into_pointer_value(); @@ -420,7 +420,7 @@ impl<'db, 'ink, 't> BodyIrGenerator<'db, 'ink, 't> { .builder .build_load( struct_ptr_ptr, - &format!("{}_mem_ptr", hir_struct.name(self.db).to_string()), + &format!("{}_mem_ptr", hir_struct.name(self.db)), ) .into_pointer_value(); diff --git a/crates/mun_codegen/src/type_info.rs b/crates/mun_codegen/src/type_info.rs index ab2d56b73..c5232c757 100644 --- a/crates/mun_codegen/src/type_info.rs +++ b/crates/mun_codegen/src/type_info.rs @@ -91,7 +91,7 @@ impl TypeInfo { .ty(db) .guid_string(db) .expect("type should be convertible to a string"); - format!("{}: {}", f.name(db).to_string(), ty_string) + format!("{}: {}", f.name(db), ty_string) }) .collect(); diff --git a/crates/mun_hir/src/ty.rs b/crates/mun_hir/src/ty.rs index 8d38d8a80..4a1ffb215 100644 --- a/crates/mun_hir/src/ty.rs +++ b/crates/mun_hir/src/ty.rs @@ -206,7 +206,7 @@ impl Ty { .ty(db) .guid_string(db) .expect("type should be convertible to a string"); - format!("{}: {}", f.name(db).to_string(), ty_string) + format!("{}: {}", f.name(db), ty_string) }) .collect(); diff --git a/crates/mun_language_server/src/diagnostics.rs b/crates/mun_language_server/src/diagnostics.rs index 9b4b5886e..34d270fb5 100644 --- a/crates/mun_language_server/src/diagnostics.rs +++ b/crates/mun_language_server/src/diagnostics.rs @@ -34,7 +34,7 @@ pub(crate) fn diagnostics(db: &AnalysisDatabase, file_id: hir::FileId) -> Vec