-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Removing todo const generics #7391
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
Conversation
CodSpeed Performance ReportMerging #7391 will not alter performanceComparing Summary
|
27cbf5a to
8282f12
Compare
ab94b9d to
b9ceaf4
Compare
sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs
Show resolved
Hide resolved
JoshuaBatty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the unwrap issue! can we remove the remaining unwraps i've pointed out as well? Thanks
I created another PR to better address these |
Suggestions will be implemented by another PR.
## Description This PR is a continuation of #7391. It also changes from `GenericArgument` to `GenericTypeArgument`. The rationale is that `GenericArgument` should only be used where we can have types and const generics. And it a lot of cases, we only accept types. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
## Description This PR continue #7391. First, it removes some easy `todo!()` around `ParsedDeclId`. It seems only `fn` or `struct` are using those. But I decided to implement them anyway to keep the code uniform. We may be able to simplify this, I think. Second, it implements coin analysis for const generics. Unfortunately, the analysis runs on the `fn` declaration and not on the materialised version. So even calling a function with `0` generates the error. ## Checklist - [x] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
Description
Continuation of #6860.
The summary of removed
todo!()are:1 - Some
todo!()are actually unreachable. In future PRs I will try to model the AST better and remove these match arms;2 - Some are trivial impls like spans;
3 - Some are trivial from traits like
PartialEqandPartialOrd.Others will be removed in future PRs.
Checklist
Breaking*orNew Featurelabels where relevant.