Skip to content
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

New clippy lints in solana-sbf-rust-invoke #4479

Closed
brooksprumo opened this issue Jan 15, 2025 · 5 comments
Closed

New clippy lints in solana-sbf-rust-invoke #4479

brooksprumo opened this issue Jan 15, 2025 · 5 comments

Comments

@brooksprumo
Copy link

brooksprumo commented Jan 15, 2025

There are new clippy lints when upgrade nightly rust to 2024-11-22 (1.84.0), which causes CI to fail:

error: large array defined as const
    --> rust/invoke/src/lib.rs:1440:13
     |
1440 |             const ZEROS: [u8; 256 * 1024] = [0; 256 * 1024];
     |             -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |             |
     |             help: make this a static item: `static`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_const_arrays
     = note: `-D clippy::large-const-arrays` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::large_const_arrays)]`

error: could not compile `solana-sbf-rust-invoke` (lib test) due to 1 previous error

I used this cmd to reproduce locally, from within programs/sbf/:

cargo +nightly-2024-11-22 clippy --workspace --all-targets --features dummy-for-ci-check,frozen-abi --keep-going -- --deny=warnings --deny=clippy::default_trait_access --deny=clippy::arithmetic_side_effects --deny=clippy::manual_let_else --deny=clippy::used_underscore_binding

Should this array be static? Or a slice? Or add a clippy-allow? Or change how the assert is checked (e.g. use an iter that always returns 0s)?

Child of #4380

@brooksprumo
Copy link
Author

@pgarg66 Here's another one. I'm not sure what the right fix is, so it would be helpful to have someone on your team handle this correctly. Thanks in advance!

@pgarg66
Copy link

pgarg66 commented Jan 15, 2025

@pgarg66 Here's another one. I'm not sure what the right fix is, so it would be helpful to have someone on your team handle this correctly. Thanks in advance!

@LucasSte could you help take a look?

@LucasSte
Copy link

I'll have a look!

@LucasSte
Copy link

LucasSte commented Jan 16, 2025

I simply switched to static in #4503. I explained the reason in the PR's summary. Let's wait for the CI to turn green now 🤞

@LucasSte
Copy link

Closing the issue, since #4503 was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants