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

rust: Deal with new Rust 1.66 warnings #977

Merged
merged 4 commits into from
Jan 16, 2023

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Jan 14, 2023

I noticed that both "stable" and "1.51" builds are failing with new warnings from Clippy 1.66. That's weird. Turns out the "1.51" build was actually testing the latest stable Rust. Way to go. And RustThemis actually does not work with 1.51, the minimum version that works is 1.56.

After that is dealt with, clean up some things that Clippy 1.66 complains about. Suppress some others (#971).

Checklist

  • Change is covered by automated tests
  • The coding guidelines are followed
  • Example projects and code samples are up-to-date
  • Changelog is updated

Not only install the toolchain specified by the matrix, but also make
it the default one, since the build system uses the default toolchain.

Currently, our "1.51" build actually uses "stable" because of this.

:facepalm:
Guess what? CI was lying. RustThemis does not compile with 1.51 because
we use Rust 2021 edition which was not stabilized until 1.56. Bump it.
New stable Clippy points out the following:

     error: casting to the same type is unnecessary (`usize` -> `usize`)
       --> src/wrappers/themis/rust/src/keygen.rs:108:29
        |
    108 |         private_key.set_len(private_key_len as usize);
        |                             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `private_key_len`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
        = note: `-D clippy::unnecessary-cast` implied by `-D warnings`
Previously this was suppressed in the main Themis code, but seems like
the new Clippy learned about the existence of benchmarks. Suppress this
warning there as well.
@ilammy ilammy added this to the 0.15.0 milestone Jan 14, 2023
Copy link
Contributor

@vixentael vixentael left a comment

Choose a reason for hiding this comment

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

thank you! this should unblock other PRs

@ilammy ilammy merged commit c9dd60e into cossacklabs:master Jan 16, 2023
@ilammy ilammy deleted the obey-the-metallic-overlord branch January 16, 2023 13:59
radetsky pushed a commit that referenced this pull request Jan 25, 2023
* CI: Correct Rust toolchain installation

Not only install the toolchain specified by the matrix, but also make
it the default one, since the build system uses the default toolchain.

Currently, our "1.51" build actually uses "stable" because of this.

:facepalm:

* rust: Minimum supported version is now 1.56

Guess what? CI was lying. RustThemis does not compile with 1.51 because
we use Rust 2021 edition which was not stabilized until 1.56. Bump it.

* rust: Drop unnecessary casts

New stable Clippy points out the following:

     error: casting to the same type is unnecessary (`usize` -> `usize`)
       --> src/wrappers/themis/rust/src/keygen.rs:108:29
        |
    108 |         private_key.set_len(private_key_len as usize);
        |                             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `private_key_len`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
        = note: `-D clippy::unnecessary-cast` implied by `-D warnings`

* rust: Suppress more warnings

Previously this was suppressed in the main Themis code, but seems like
the new Clippy learned about the existence of benchmarks. Suppress this
warning there as well.
ilammy added a commit to ilammy/themis that referenced this pull request Feb 5, 2023
This reverts commit 890536c.

Well, most of it, keeping only the changes in CI, but rolling back
source code to the state it was in 0.14.0.
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.

2 participants