Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove DefCollectorErrorKind::MacroError #6174

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions compiler/noirc_frontend/src/hir/def_collector/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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<String>,
pub span: Option<Span>,
}

impl DefCollectorErrorKind {
pub fn into_file_diagnostic(&self, file: fm::FileId) -> FileDiagnostic {
Diagnostic::from(self).in_file(file)
Expand Down Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion compiler/noirc_frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Loading