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

Use Integer::div_floor explicitly #694

Merged
merged 3 commits into from
Sep 15, 2021
Merged

Conversation

JesseWright
Copy link
Contributor

Motivation and Context

rust-lang/rust#88581 adds several new integer methods as inherent impls. These new methods are a breaking change accepted as a minor change. They already cause build failures with nightly and will eventually cause build failures with stable as well, unless rust-lang changes course.

Description

This uses Integer::div_floor explicitly to avoid accidentally calling the new nightly methods, same as done for rust-num/num-bigint#218.

Testing

Tested smithy-types on stable, beta, and nightly using the following toolchains:

    stable-x86_64-pc-windows-msvc unchanged - rustc 1.54.0 (a178d0322 2021-07-26)
        beta-x86_64-pc-windows-msvc updated - rustc 1.55.0-beta.10 (e72143457 2021-09-04) (from rustc 1.55.0-beta.7 (bf16ca353 2021-08-21))
     nightly-x86_64-pc-windows-msvc updated - rustc 1.57.0-nightly (5d2a410ff 2021-09-04) (from rustc 1.56.0-nightly (b03ccace5 2021-08-24))

Checklist

  • I have updated CHANGELOG.md
  • I have updated aws/SDK_CHANGELOG.md if applicable

I don't think updates to aws/SDK_CHANGELOG.md are applicable. I'm not sure if this merits updates to CHANGELOG.md either; please let me know if it does.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

rust-lang/rust#88581 adds several new integer methods as inherent impls. These new methods are a breaking change accepted as a minor change. They already cause build failures with nightly and will eventually cause build failures with stable as well, unless rust-lang changes course. This uses `Integer::div_floor` explicitly to avoid accidentally calling the new nightly methods, same as done for rust-num/num-bigint#218.
Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@rcoh rcoh enabled auto-merge (squash) September 8, 2021 13:44
Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

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

LGTM! Can you run cargo fmt? Then CI will pass and we can merge.

@rcoh
Copy link
Collaborator

rcoh commented Sep 15, 2021

Fixes #700

@rcoh rcoh merged commit 58461ea into smithy-lang:main Sep 15, 2021
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