Fix clippy 1.85.0#3576
Conversation
|
@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
lang/tests/generics_test.rs
Outdated
| } | ||
|
|
||
| #[account(zero_copy(unsafe))] | ||
| #[repr(C)] |
There was a problem hiding this comment.
I believe the only reason to use zero_copy(unsafe) is to be able to use repr(packed). Shouldn't use that here to be more representative of real world usage?
There was a problem hiding this comment.
That's correct, but zero_copy(unsafe) mostly exists for historical reasons (it was the initial impl and some older programs needed compatibility in newer versions) and you should generally avoid using repr(packed).
Additionally, this file doesn't represent real world usage, and in fact, it doesn't even work. This change was only aimed at fixing the clippy error in CI, so which repr(s) we use doesn't matter at all.
However, you're right; this may cause confusion, so I'll fix that. I initially wanted to avoid making codegen changes because those changes might delay the next release, but now that I think about this again, it's probably better to just change
to repr(Rust, packed) to also fix this lint for downstream users.
c869e11
into
solana-foundation:master
Problem
CI tests fail due to the new
clippylints coming from the latest stable Rust release (v1.85.0).Summary of changes
Fix
clippy::repr_packed_without_abi.