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

cargo check failed when the rust version less than 1.49.0, add rust-t… #215

Closed
wants to merge 3 commits into from

Conversation

mengsuenyan
Copy link

cargo check failed when the rust version less than 1.49.0. may be can add rust-toolchain to specify the rust version;

when using the rust 1.48.0, the following error occurs:

    Checking zeroize v1.2.0
error[E0308]: mismatched types
   --> /home/lzj/.cargo/git/checkouts/algebra-7e23afa68841b66e/a3a1ab2/ff/src/fields/models/quadratic_extension.rs:272:24
    |
272 |             self.c0 *= v0;
    |                        ^^
    |                        |
    |                        expected reference, found associated type
    |                        help: consider borrowing here: `&v0`
    |
    = note:    expected reference `&<P as quadratic_extension::QuadExtParameters>::BaseField`
            found associated type `<P as quadratic_extension::QuadExtParameters>::BaseField`
    = help: consider constraining the associated type `<P as quadratic_extension::QuadExtParameters>::BaseField` to `&<P as quadratic_extension::QuadExtParameters>::BaseField`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0308]: mismatched types
   --> /home/lzj/.cargo/git/checkouts/algebra-7e23afa68841b66e/a3a1ab2/ff/src/fields/models/quadratic_extension.rs:275:24
    |
275 |             self.c1 *= c0_copy;
    |                        ^^^^^^^
    |                        |
    |                        expected reference, found associated type
    |                        help: consider borrowing here: `&c0_copy`
    |
    = note:    expected reference `&<P as quadratic_extension::QuadExtParameters>::BaseField`
            found associated type `<P as quadratic_extension::QuadExtParameters>::BaseField`
    = help: consider constraining the associated type `<P as quadratic_extension::QuadExtParameters>::BaseField` to `&<P as quadratic_extension::QuadExtParameters>::BaseField`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
error: could not compile `ark-ff`

@jon-chuang
Copy link
Contributor

jon-chuang commented Feb 8, 2021

This was a bug in stable rust making type coercion fail, and I think only affects 1.48.

@Pratyush
Copy link
Member

Thanks for the PR! I agree that this is valuable. Is the value specified in rust-toolchain respected when algebra crates are used as dependencies?

@ValarDragon ValarDragon mentioned this pull request Mar 30, 2021
6 tasks
@huitseeker
Copy link
Contributor

Is the value specified in rust-toolchain respected when algebra crates are used as dependencies?

I'm afraid not.

Besides, rust-toolchain files do not have the functionality of a MSRV, but rather work as a Rust version selector. We might be interested in a check such as the one in
98b7258
instead.

@weikengchen
Copy link
Member

Given that the main repo now requires 1.51, and this bug likely no longer applies to these newer versions of Rust, I closed this PR.

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.

6 participants