-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Resolve arguments to attributes (#5649)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* Changes the design for attributes a bit: - Previously all arguments must be `Quoted`, now arguments are not quoted by default and you need an explicit `quote { .. }`. - Arguments of type `TraitDefinition` are automatically resolved as trait definitions instead of expressions. We can expand this check to more built in types in the future. - Use a new `#[varargs]` attribute to determine whether an attribute is varargs instead of just checking if the last argument is a slice. The old check doesn't work anymore since attributes can accept slices as normal arguments now. - Arguments to attributes are elaborated in the scope of the caller like normal arguments. The scope of the caller will be the global module scope in this case. ## Additional Context Most of the changes in this PR are me moving functions from `elaborator/mod.rs` to the more appropriate file `elaborator/comptime.rs` This lets us `derive` from other modules without the trait and function name needing to be visible in derive's module. I've updated the derive test to show this. Looks like there's a new error I didn't know about when adding derive to the stdlib, so that is still blocked.. ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [x] **[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
Showing
22 changed files
with
990 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.