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

Upgrade to the Rust 2021 edition #449

Merged
merged 4 commits into from
Nov 4, 2021

Conversation

olivereanderson
Copy link
Contributor

@olivereanderson olivereanderson commented Oct 22, 2021

Description of change

This change makes all our (Rust) crates opt in to the 2021 edition of Rust which entails bumping the minimum supported Rust version (MSRV) requirements to 1.56.1.

By opting in to the 2021 edition we get more precise closure captures and the behaviour regarding how the IntoIterator trait works for arrays will be more consistent with the rest of the language. The details of the 2021 edition are explained in detail here.

Furthermore by increasing the MSRV to 1.56.1 compile times are expected to be faster due to the use of LLVM13 and we may for instance refactor things like this

#![cfg_attr(docsrs, feature(doc_cfg, extended_key_value_attributes))]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = include_str!("../README.md")))]
#![cfg_attr(not(docsrs), doc = "")]

to simply become this:

#![doc = include_str!("README.md")]

See the official Rust release logs for more improvements that have made it into (stable) Rust since 1.51.0 (our last MSRV).

Type of change

Add an x to the boxes that are relevant to your changes.

  • Bug fix (a non-breaking change which fixes an issue)
  • [] Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

I followed the transitioning guide. It is worth mentioning that the first step $ cargo fix --edition from the aforementioned guide did not report any problems. I also built and ran all the tests after building with the 2021 edition set in all the Cargo.toml files.

Change checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@olivereanderson olivereanderson changed the title Upgrade to the Rust 20212 edition Upgrade to the Rust 2021 edition Oct 22, 2021
@olivereanderson olivereanderson force-pushed the epic/update-to-rust-2021-edition branch from 37ca1dd to 30b2b7a Compare November 4, 2021 15:47
@olivereanderson olivereanderson merged commit 8f90176 into dev Nov 4, 2021
@cycraig cycraig added Patch Change without affecting the API that requires a patch release. Part of "Patch" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. labels Dec 15, 2021
@eike-hass eike-hass deleted the epic/update-to-rust-2021-edition branch June 3, 2022 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Patch Change without affecting the API that requires a patch release. Part of "Patch" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants