Skip to content

nightly-2024-09-05: feat: warn on unused functions (#5892)

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 05 Sep 02:25
· 795 commits to master since this release
af3db4b
# Description

## Problem

Now that we warn on unused imports, doing that for functions too is
relatively straight-forward.

## Summary

Now unused private or `pub(crate)` functions will be reported as unused.

## Additional Context

I'd like to try this on some Aztec-Packages projects, but for that it
would be nice to merge #5895 first so I could get all warnings/errors
for a package inside VS Code.

We can eventually do the same thing with globals, traits, etc., once we
track their visibility.

I also think we could warn on unused `pub` functions in a "bin" or
"contract" package, not sure... but if we decide to do that, it could be
a separate PR.

## 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.