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

cannot use constants which depend on generic parameters in types #260

Closed
nbgl opened this issue Sep 21, 2021 · 1 comment
Closed

cannot use constants which depend on generic parameters in types #260

nbgl opened this issue Sep 21, 2021 · 1 comment

Comments

@nbgl
Copy link
Contributor

nbgl commented Sep 21, 2021

This compiler warning pops up a bunch of times. It seems to only affect things that call Poseidon.

warning: cannot use constants which depend on generic parameters in types
  --> src/field/field_types.rs:19:47
   |
19 | pub trait RichField: PrimeField + GMiMC<12> + Poseidon<12> {}
   |                                               ^^^^^^^^^^^^
   |
   = note: `#[warn(const_evaluatable_unchecked)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
warning: cannot use constants which depend on generic parameters in types
  --> src/hash/hashing.rs:83:26
   |
83 |             state = self.permute(state);
   |                          ^^^^^^^
warning: cannot use constants which depend on generic parameters in types
   --> src/hash/hashing.rs:142:33
    |
142 |         HashFamily::Poseidon => F::poseidon(inputs),
    |                                 ^^^^^^^^^^^

The Rust tracking issue is rust-lang/rust#76200.

@unzvfu
Copy link
Contributor

unzvfu commented Nov 12, 2021

These warnings are suppressed by #![allow(const_evaluatable_unchecked)] which has been included in #353. This hides the problem which is arguably not a good idea, but the issue should be addressed by #326 so I reckon hiding the warning is okay.

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