Upgrade the MSRV to 1.83

Our current MSRV is rust 1.77.

When increasing this MSRV, we won't require any Rust version released in the last six months. (That is, we'll only require Rust versions released at least six months ago.)

On March 5th, it will be 6 months since the release of rust 1.81 (Sept 5th).

We will not increase MSRV on PATCH releases, though our dependencies might.

We would need to remember to do an arti MINOR release.

We won't increase MSRV just because we can: we'll only do so when we have a reason. (We don't guarantee that you'll agree with our reasoning; only that it will exist.)

We currently have dependency versions in our Cargo.lock file which do not build on our MSRV of rust 1.77. They are currently:

  • native-tls
  • zerofrom
  • litemap
  • tinystr

The highest version required by the above libraries is rust 1.81.

For example:

error: package `litemap v0.7.5` cannot be built because it requires rustc 1.81 or newer, while the currently active rustc version is 1.77.2

Users using older (<1.81) rust releases can always manually downgrade these dependencies to versions with lower MSRVs, but it's not a great experience. By upgrading our MSRV to rust 1.81, this issue goes away (for now at least).

By upgrading our MSRV, we also gain support for some new rust features such as:

  • lint reasons
  • lint "expect" (#1757)
  • LazyCell and LazyLock (allows us to reduce, or maybe eliminate, our use of once_cell)
  • exclusive ranges in patterns
  • inline const expressions
  • std::num::NonZero<T> (TODO in crates/tor-memquota/src/memory_cost_derive.rs)
  • lots of other things and new stabilized APIs

There are a bunch of TODOs that could be fixed with a higher MSRV.

Upgrading the MSRV past rust 1.77 means that we also lose support for Windows <10.

(Edit: Reminder to myself to also fix the TODO at https://gitlab.torproject.org/tpo/core/arti/-/blob/1917296fd81ffbc1b9a8ea8342dc04dc6c2e117f/crates/tor-basic-utils/src/n_key_list.rs#L395)

Edited by opara