Skip to content

Commit

Permalink
chore: Remove unknown annotation warning (#5531)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

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

## 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.
  • Loading branch information
jfecher authored Jul 17, 2024
1 parent 30cb65a commit e318f45
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/noirc_frontend/src/elaborator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e318f45

Please sign in to comment.