From e318f45e77ef5c6108574945a9b6fb20e63a0c4f Mon Sep 17 00:00:00 2001 From: jfecher Date: Wed, 17 Jul 2024 12:34:57 -0500 Subject: [PATCH] chore: Remove unknown annotation warning (#5531) # Description ## Problem\* Resolves ## Summary\* Removes the "Unknown attribute warning" since it is now spamming aztec-nr use cases. ## Additional Context We'll want to re-add this warning eventually but we'd need some way to known when users want to call attributes as a function versus when they are just annotations picked up from elsewhere. It's possible this later use case may disappear once `macro_processors` is removed though. ## 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. --- compiler/noirc_frontend/src/elaborator/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index f573947ffb2..e2e2e5fa1d5 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -1311,9 +1311,10 @@ impl<'context> Elaborator<'context> { let (function_name, mut arguments) = Self::parse_attribute(attribute, location) .unwrap_or_else(|| (attribute.to_string(), Vec::new())); - let id = self - .lookup_global(Path::from_single(function_name, span)) - .map_err(|_| (ResolverError::UnknownAnnotation { span }.into(), self.file))?; + let Ok(id) = self.lookup_global(Path::from_single(function_name, span)) else { + // Do not issue an error if the attribute is unknown + return Ok(()); + }; let definition = self.interner.definition(id); let DefinitionKind::Function(function) = definition.kind else {