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: update MSRV references and clippy lints #1671

Merged
merged 7 commits into from
Mar 21, 2023

Conversation

jmayclin
Copy link
Contributor

@jmayclin jmayclin commented Mar 21, 2023

  • Cargo.toml msrv specifications should match rust-toolchain
  • update .clippy.toml to match the MSRV
  • update the README to match the MSRV
  • update netbench MSRV to 1.63
  • remove deprecated openssl builder function
  • remove unnecessary allowance of not-inlined format args
  • remove manually implemented Default traits for enums

Description of changes:

This PR is primarily cut to fix clippys warnings (that are transformed into an error by -D warnings) in our CI run of clippy.

the hash_xor_partial_equal lint was renamed to derived_hash_with_manual_eq. Note that allowing derived_hash_with_manual_eq is a backwards incompatible change for clippy. E.g. you will no longer be able to run clippy on the MSRV version. The alternative is switching our CI clippy runs to either use the MSRV or no longer treat all warnings as errors.

Clippy also introduced a new complaint in stable (1.68) which is the manually derived Default on enums. This PR updates code to comply with that lint.

It also updates netbench MSRV to 1.62. Since netbench consumes quic and quic has an MSRV of 1.63, it couldn't actually be built with 1.62 anyways.

Call-outs:

We specify a patch version dependency for OpenSSL in netbench because the build function was deprecated in 010.46, but the build2 function didn't exist before 0.10.46. So if we use the build function, then we require at least 0.10.46 to build.

It does not fix the derived_hash_with_manual_eq naming error, because that lint wasn't available until 1.68. Ideally the clippy MSRV configuration would take care of that for us, but that does not appear to be the case.

Testing:

CI run should pass successfully.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jmayclin jmayclin changed the title fix: update MSRV references and clippy lints fix: update MSRV references and openssl builder Mar 21, 2023
* Cargo.toml msrv specifications should match rust toolchain
* derive_hash clippy lint naming update
* fix deprecated openssl builder function
@jmayclin jmayclin changed the title fix: update MSRV references and openssl builder fix: update MSRV references and clippy lints Mar 21, 2023
@jmayclin jmayclin marked this pull request as ready for review March 21, 2023 18:39
toidiu
toidiu previously approved these changes Mar 21, 2023
@@ -18,7 +18,7 @@ pub const LEN: usize = 128 / 8;
// The implemented PartialEq will have the same results as
// a derived version, except it is constant-time. Therefore
// Hash can still be derived.
#[allow(clippy::derive_hash_xor_eq)]
Copy link
Contributor

@WesleyRosenblum WesleyRosenblum Mar 21, 2023

Choose a reason for hiding this comment

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

What if you did something like:

#[allow(unknown_lints, clippy::derive_hash_xor_eq, clippy::derived_hash_with_manual_eq)]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tested it and that does allow us to continue using clippy 1.63. It's not super pretty, but probably better than making backwards incompatible clippy changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I'm not sure what I missed when testing locally, but clippy still warns about the old name, (because it does recognize it) and then we error out on that.

Copy link
Contributor

@WesleyRosenblum WesleyRosenblum Mar 21, 2023

Choose a reason for hiding this comment

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

seems that trick used to work:

// clippy changed its lint name so use both for backwards compatibility
#[allow(
clippy::unknown_clippy_lints,
clippy::useless_conversion,
clippy::identity_conversion
)]

but they deprecated clippy::unknown_clippy_lints so I guess no longer

@jmayclin jmayclin merged commit 3d5a46c into aws:main Mar 21, 2023
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.

3 participants