From 5b6d540484220cb41bf2845ba6b6880ff73dc2c9 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Sep 2024 12:40:55 +0100 Subject: [PATCH] chore: remove `DefCollectorErrorKind::MacroError` --- .../noirc_frontend/src/hir/def_collector/errors.rs | 13 ------------- compiler/noirc_frontend/src/lib.rs | 1 - 2 files changed, 14 deletions(-) diff --git a/compiler/noirc_frontend/src/hir/def_collector/errors.rs b/compiler/noirc_frontend/src/hir/def_collector/errors.rs index f931a7cdf41..2f47505db94 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/errors.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/errors.rs @@ -71,8 +71,6 @@ pub enum DefCollectorErrorKind { "Either the type or the trait must be from the same crate as the trait implementation" )] TraitImplOrphaned { span: Span }, - #[error("macro error : {0:?}")] - MacroError(MacroError), #[error("The only supported types of numeric generics are integers, fields, and booleans")] UnsupportedNumericGenericType { ident: Ident, typ: UnresolvedTypeData }, #[error("impl has stricter requirements than trait")] @@ -86,14 +84,6 @@ pub enum DefCollectorErrorKind { }, } -/// An error struct that macro processors can return. -#[derive(Debug, Clone)] -pub struct MacroError { - pub primary_message: String, - pub secondary_message: Option, - pub span: Option, -} - impl DefCollectorErrorKind { pub fn into_file_diagnostic(&self, file: fm::FileId) -> FileDiagnostic { Diagnostic::from(self).in_file(file) @@ -276,9 +266,6 @@ impl<'a> From<&'a DefCollectorErrorKind> for Diagnostic { "Either the type or the trait must be from the same crate as the trait implementation".into(), *span, ), - DefCollectorErrorKind::MacroError(macro_error) => { - Diagnostic::simple_error(macro_error.primary_message.clone(), macro_error.secondary_message.clone().unwrap_or_default(), macro_error.span.unwrap_or_default()) - }, DefCollectorErrorKind::UnsupportedNumericGenericType { ident, typ } => { let name = &ident.0.contents; diff --git a/compiler/noirc_frontend/src/lib.rs b/compiler/noirc_frontend/src/lib.rs index b2d7c297b8c..4391c760701 100644 --- a/compiler/noirc_frontend/src/lib.rs +++ b/compiler/noirc_frontend/src/lib.rs @@ -45,7 +45,6 @@ pub mod macros_api { pub use noirc_errors::Span; pub use crate::graph::CrateId; - pub use crate::hir::def_collector::errors::MacroError; pub use crate::hir_def::expr::{HirExpression, HirLiteral}; pub use crate::hir_def::stmt::HirStatement; pub use crate::node_interner::{NodeInterner, StructId};