Skip to content

Commit

Permalink
Raise the MSRV from 1.65 to 1.70 (June 1, 2023)
Browse files Browse the repository at this point in the history
`[email protected]` requires Rust 1.70.0 or later.
  • Loading branch information
tatsuya6502 committed Jan 1, 2025
1 parent 64a5202 commit d6342c2
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 35 deletions.
6 changes: 0 additions & 6 deletions .ci_extras/pin-crate-vers-msrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@
set -eux

# Pin some dependencies to specific versions for the MSRV.
# cargo update -p <crate> --precise <version>
cargo update -p actix-rt --precise 2.9.0
cargo update -p cc --precise 1.0.105
cargo update -p tokio-util --precise 0.7.11
cargo update -p tokio --precise 1.38.1
cargo update -p url --precise 2.5.2
cargo update -p quanta --precise 0.12.2
2 changes: 1 addition & 1 deletion .ci_extras/remove-examples-msrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ EOF
}

# `OnceLock` was introduced in 1.70.0.
disable_example_sync reinsert_expired_entries_sync
# disable_example_sync reinsert_expired_entries_sync
2 changes: 1 addition & 1 deletion .devcontainer/ensure-rust-toolchains-installed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -eu

rustup toolchain install stable -c clippy,rust-analysis,rust-src,rustfmt
rustup toolchain install beta -c clippy
rustup toolchain install 1.65.0
rustup toolchain install 1.70.0
rustup default stable
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
rust:
- stable
- beta
- 1.65.0 # MSRV
- 1.70.0 # MSRV
- nightly # For checking minimum version dependencies.

steps:
Expand Down Expand Up @@ -68,11 +68,11 @@ jobs:
run: ./.ci_extras/pin-crate-vers-nightly.sh

- name: Pin some dependencies to specific versions (MSRV only)
if: ${{ matrix.rust == '1.65.0' }}
if: ${{ matrix.rust == '1.70.0' }}
run: ./.ci_extras/pin-crate-vers-msrv.sh

- name: Remove some examples (MSRV only)
if: ${{ matrix.rust == '1.65.0' }}
if: ${{ matrix.rust == '1.70.0' }}
run: ./.ci_extras/remove-examples-msrv.sh

- name: Show cargo tree
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CIQuantaDisabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
rust:
- stable
- beta
- 1.65.0 # MSRV
- 1.70.0 # MSRV
- nightly # For checking minimum version dependencies.

steps:
Expand All @@ -60,11 +60,11 @@ jobs:
run: ./.ci_extras/pin-crate-vers-nightly.sh

- name: Pin some dependencies to specific versions (MSRV only)
if: ${{ matrix.rust == '1.65.0' }}
if: ${{ matrix.rust == '1.70.0' }}
run: ./.ci_extras/pin-crate-vers-msrv.sh

- name: Remove some examples (MSRV only)
if: ${{ matrix.rust == '1.65.0' }}
if: ${{ matrix.rust == '1.70.0' }}
run: ./.ci_extras/remove-examples-msrv.sh

- name: Run tests (debug, but no quanta feature)
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "moka"
version = "0.12.8"
edition = "2021"
# Rust 1.65 was released on Nov 3, 2022.
rust-version = "1.65"
# Rust 1.70 was released on June 1, 2023.
rust-version = "1.70"
description = "A fast and concurrent cache library inspired by Java Caffeine"
license = "MIT OR Apache-2.0"
# homepage = "https://"
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,20 @@ section ([`sync::Cache`][doc-sync-cache-expiration],

Moka's minimum supported Rust versions (MSRV) are the followings:

| Feature | MSRV |
|:-----------------|:-------------------------:|
| default features | Rust 1.65.0 (Nov 3, 2022) |
| `future` | Rust 1.65.0 (Nov 3, 2022) |
| Feature | MSRV |
|:---------|:--------------------------:|
| `future` | Rust 1.70.0 (June 3, 2022) |
| `sync` | Rust 1.70.0 (June 3, 2022) |

It will keep a rolling MSRV policy of at least 6 months. If only the default features
are enabled, MSRV will be updated conservatively. When using other features, like
`future`, MSRV might be updated more frequently, up to the latest stable. In both
cases, increasing MSRV is _not_ considered a semver-breaking change.
It will keep a rolling MSRV policy of at least 6 months. If the default features with
a mondatory features (`future` or `sync`) are enabled, MSRV will be updated
conservatively. When using other features, MSRV might be updated more frequently, up
to the latest stable.

In both cases, increasing MSRV is _not_ considered a semver-breaking change.

<!--
- quanta v0.11.0 requires 1.60.
- quanta v0.12.4 requires 1.70.0.
-->


Expand Down
21 changes: 11 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,17 @@
//!
//! This crate's minimum supported Rust versions (MSRV) are the followings:
//!
//! | Feature | MSRV |
//! |:-----------------|:-------------------------:|
//! | default features | Rust 1.65.0 (Nov 3, 2022) |
//! | `future` | Rust 1.65.0 (Nov 3, 2022) |
//!
//! It will keep a rolling MSRV policy of at least 6 months. If only the default
//! features are enabled, MSRV will be updated conservatively. When using other
//! features, like `future`, MSRV might be updated more frequently, up to the latest
//! stable. In both cases, increasing MSRV is _not_ considered a semver-breaking
//! change.
//! | Feature | MSRV |
//! |:---------|:--------------------------:|
//! | `future` | Rust 1.70.0 (June 3, 2022) |
//! | `sync` | Rust 1.70.0 (June 3, 2022) |
//!
//! It will keep a rolling MSRV policy of at least 6 months. If the default features
//! with a mondatory features (`future` or `sync`) are enabled, MSRV will be updated
//! conservatively. When using other features, MSRV might be updated more frequently,
//! up to the latest stable.
//!
//! In both cases, increasing MSRV is _not_ considered a semver-breaking change.
#[cfg(not(any(feature = "sync", feature = "future")))]
compile_error!(
Expand Down

0 comments on commit d6342c2

Please sign in to comment.