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

spl: Fix compilation error and warnings #2647

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

acheroncrypto
Copy link
Collaborator

Problem

anchor-spl with metadata feature has a compile error and a few warnings after the recent upgrade(#2632).

warning: unused variable: `name`
   --> src/metadata.rs:113:9
    |
113 |         name,
    |         ^^^^ help: try ignoring the field: `name: _`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `symbol`
   --> src/metadata.rs:114:9
    |
114 |         symbol,
    |         ^^^^^^ help: try ignoring the field: `symbol: _`

warning: unused variable: `uri`
   --> src/metadata.rs:115:9
    |
115 |         uri,
    |         ^^^ help: try ignoring the field: `uri: _`

warning: unused variable: `creators`
   --> src/metadata.rs:116:9
    |
116 |         creators,
    |         ^^^^^^^^ help: try ignoring the field: `creators: _`

warning: unused variable: `seller_fee_basis_points`
   --> src/metadata.rs:117:9
    |
117 |         seller_fee_basis_points,
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: try ignoring the field: `seller_fee_basis_points: _`

warning: unused variable: `collection`
   --> src/metadata.rs:118:9
    |
118 |         collection,
    |         ^^^^^^^^^^ help: try ignoring the field: `collection: _`

warning: unused variable: `uses`
   --> src/metadata.rs:119:9
    |
119 |         uses,
    |         ^^^^ help: try ignoring the field: `uses: _`

warning: unused variable: `update_authority_is_signer`
   --> src/metadata.rs:109:5
    |
109 |     update_authority_is_signer: bool,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_update_authority_is_signer`

warning: unused variable: `use_authority_record_pda`
   --> src/metadata.rs:471:5
    |
471 |     use_authority_record_pda: Option<Pubkey>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_use_authority_record_pda`

error[E0382]: use of partially moved value: `data`
   --> src/metadata.rs:133:13
    |
119 |         uses,
    |         ---- value partially moved here
...
133 |             data,
    |             ^^^^ value used here after partial move
    |
    = note: partial move occurs because `data.uses` has type `Option<Uses>`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
    |
119 |         ref uses,
    |         +++

For more information about this error, try `rustc --explain E0382`.
warning: `anchor-spl` (lib) generated 9 warnings
error: could not compile `anchor-spl` due to previous error; 9 warnings emitted

Summary of changes

  • Fix the compile error and warnings
  • Add a test case to build anchor-spl with metadata feature enabled

@vercel
Copy link

vercel bot commented Oct 4, 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 added spl compile error Issues related to compile errors labels Oct 4, 2023
Copy link
Collaborator Author

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@febo Small issues with the recent upgrade, could you please take a look?

spl/src/metadata.rs Show resolved Hide resolved
spl/src/metadata.rs Show resolved Hide resolved
@acheroncrypto acheroncrypto merged commit 51578bc into coral-xyz:master Oct 5, 2023
47 checks passed
@febo
Copy link
Contributor

febo commented Oct 6, 2023

@febo Small issues with the recent upgrade, could you please take a look?

@acheroncrypto Thanks for looking into this. I need to address these issues on the Rust client, likely I will need to publish a patch/minor version. I will create a PR on anchor once I have done the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile error Issues related to compile errors spl tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants