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

Fix compiler warning (const_item_mutation) #123

Closed
webmaster128 opened this issue Oct 14, 2020 · 0 comments · Fixed by #108
Closed

Fix compiler warning (const_item_mutation) #123

webmaster128 opened this issue Oct 14, 2020 · 0 comments · Fixed by #108

Comments

@webmaster128
Copy link
Member

This comes up when compiling with a newer compiler (cosmwasm/workspace-optimizer:0.10.3 -> cosmwasm/workspace-optimizer:0.10.4)

   Compiling cw3-fixed-multisig v0.3.0 (/code/contracts/cw3-fixed-multisig)
warning: taking a mutable reference to a `const` item
   --> contracts/cw3-fixed-multisig/src/contract.rs:169:5
    |
169 |     BALLOTS.update(
    |     ^^^^^^^
    |
    = note: `#[warn(const_item_mutation)]` on by default
    = note: each usage of a `const` item creates a new temporary
    = note: the mutable reference will refer to this temporary, not the original `const` item
note: `const` item defined here
   --> contracts/cw3-fixed-multisig/src/state.rs:63:1
    |
63  | pub const BALLOTS: Map<(U64Key, &[u8]), Ballot> = Map::new(b"votes");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: 1 warning emitted
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 a pull request may close this issue.

1 participant