feat: replacing panic, unwrap & unimplemented error outs with syn::Error#4291
Open
Manudasari265 wants to merge 6 commits intosolana-foundation:masterfrom
Open
feat: replacing panic, unwrap & unimplemented error outs with syn::Error#4291Manudasari265 wants to merge 6 commits intosolana-foundation:masterfrom
syn::Error#4291Manudasari265 wants to merge 6 commits intosolana-foundation:masterfrom
Conversation
Signed-off-by: Manoj Dasari <dasarimanoj265@gmail.com>
|
@Manudasari265 is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
syn::Error
Author
|
hi @nutafrost PR is ready for review, audited and addressed all the proc-macro crates. kindly let me know if I have missed any or to address any |
jamie-osec
reviewed
Mar 9, 2026
| - uses: actions/checkout@v4 | ||
| - name: Check for panic paths in proc-macro crates | ||
| # Manually run locally via: bash scripts/check-proc-macro-panics.sh | ||
| run: bash scripts/check-proc-macro-panics.sh |
Collaborator
There was a problem hiding this comment.
Can we use https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods instead of grepping? This will help catch things locally (at least when people run Clippy)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Audited all relevant proc-macro crates and replaced reachable panic paths with syn::Error diagnostics that point at the offending token in the user's source. Intentionally kept safe internal invariants are marked with
// safe-unwrap:comments. Added CI lint script that fails the build on any unguarded panic path in proc-macro cratesAudit Fixes
anchor-derive-space (lang/derive/space)anchor-derive-accounts (lang/derive/accounts)anchor-derive-serde (lang/derive/serde)anchor-attribute-account (lang/attribute/account)anchor-attribute-access-control (lang/attribute/access-control)anchor-attribute-program (lang/attribute/program)CI Lintexempted via // safe-unwrap: inline comments
fixes #4280