arkworks-rs / snark

Interfaces for Relations and SNARKs for these relations
https://www.arkworks.rs
Apache License 2.0
770 stars 207 forks source link

algebra-core fails to compile on nightly #303

Closed tsunrise closed 3 years ago

tsunrise commented 3 years ago

It seems that recent version of algebra-core cannot be compiled on nightly. error looks like this

error[E0277]: cannot multiply-assign `&&<P as quadratic_extension::QuadExtParameters>::BaseField` to `<P as quadratic_extension::QuadExtParameters>::BaseField`
Error:    --> /home/runner/.cargo/git/checkouts/zexe-f74c42809fa6cfe1/85cac17/algebra-core/src/fields/models/quadratic_extension.rs:135:28
    |
135 |         self.c0.mul_assign(&element);
    |                            ^^^^^^^^ no implementation for `<P as quadratic_extension::QuadExtParameters>::BaseField *= &&<P as quadratic_extension::QuadExtParameters>::BaseField`
    |
    = help: the trait `std::ops::MulAssign<&&<P as quadratic_extension::QuadExtParameters>::BaseField>` is not implemented for `<P as quadratic_extension::QuadExtParameters>::BaseField`
help: consider further restricting the associated type
    |
134 |     pub fn mul_assign_by_basefield(&mut self, element: &P::BaseField) where <P as quadratic_extension::QuadExtParameters>::BaseField: std::ops::MulAssign<&&<P as quadratic_extension::QuadExtParameters>::BaseField> {
    |                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

here's the error log if you have access to it

jon-chuang commented 3 years ago

nightly seems to be the problem as these type coercions are meant to be performed by rustc. We have some fixes in celo-org/zexe, but one can alternatively wait out the next nightly.

jgraef commented 3 years ago

I bisected it to commit 08e2d4616613716362b4b49980ff303f2b9ae654 which is this PR. Looks like this is intended and won't be reversed.