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

syn: Fix Hash::new_from_array warning in non-bpf targets #2693

Conversation

acheroncrypto
Copy link
Collaborator

@acheroncrypto acheroncrypto commented Nov 3, 2023

Problem

Compiling anchor-lang in non-bpf targets e.g. anchor-cli results in #[warn(dead_code)] warning after #2682

warning: associated function `new_from_array` is never used
  --> /~/anchor/lang/syn/src/hash.rs:82:18
   |
76 | impl Hash {
   | --------- associated function in this implementation
...
82 |     pub const fn new_from_array(hash_array: [u8; HASH_BYTES]) -> Self {
   |                  ^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: `anchor-syn` (lib) generated 1 warning

Summary of changes

Only include Hash::new_from_array function when target_arch = "bpf".

Copy link

vercel bot commented Nov 3, 2023

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto merged commit 167c8ec into coral-xyz:master Nov 3, 2023
47 checks passed
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

Successfully merging this pull request may close these issues.

1 participant