Skip to content

Commit

Permalink
chore: remove DefCollectorErrorKind::MacroError (#6174)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

This PR follows up on #6087 by removing the error variant which is
provided for `aztec_macros` to return.


## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
TomAFrench authored Sep 30, 2024
1 parent eec3a61 commit 3fc62cd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
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

0 comments on commit 3fc62cd

Please sign in to comment.