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 compilation issues of OpenSSL tests on 32-bit architectures #290

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Fix compilation issues of OpenSSL tests on 32-bit architectures #290

merged 1 commit into from
Sep 19, 2024

Conversation

decathorpe
Copy link
Contributor

We discovered this as a build failure on i686 when packaging this crate for Fedora Linux.

It looks like openssl::asn1::Asn1Time::from_unix takes a 64-bit number on 64-bit platforms only, and a 32-bit number on 32-bit platforms.

This PR adds the suggestion that's made by rustc - add .try_into().unwrap() to explicitly convert to an u32 (and fail if the number is out of range).

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@decathorpe
Copy link
Contributor Author

It seems like clippy needs to be told somehow that this conversion is, indeed, not useless when considering different architectures? Should I add something like #[allow(clippy::useless_conversion)] to the statement with a comment?

@djc
Copy link
Member

djc commented Sep 19, 2024

It seems like clippy needs to be told somehow that this conversion is, indeed, not useless when considering different architectures? Should I add something like #[allow(clippy::useless_conversion)] to the statement with a comment?

Yup, that seems fine.

Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

Thanks!

@cpu cpu enabled auto-merge September 19, 2024 21:28
@cpu
Copy link
Member

cpu commented Sep 19, 2024

cpu enabled auto-merge now

Trivial fix in test-only code, seems fair to merge without blocking for further reviews.

@cpu cpu added this pull request to the merge queue Sep 19, 2024
Merged via the queue into rustls:main with commit e784a4e Sep 19, 2024
14 of 15 checks passed
@decathorpe
Copy link
Contributor Author

Thanks!

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