diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c831ee0..885b3de 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,9 +54,8 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2022-08-22 components: rustfmt - name: Setup Node.js @@ -94,9 +93,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2022-08-22 + uses: dtolnay/rust-toolchain@stable - name: Cache cargo registry uses: actions/cache@v4 @@ -120,9 +117,8 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2022-08-22 components: llvm-tools-preview - name: Cache cargo registry @@ -157,9 +153,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2022-08-22 + uses: dtolnay/rust-toolchain@stable - name: Cache cargo registry uses: actions/cache@v4 @@ -227,9 +221,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2022-08-22 + uses: dtolnay/rust-toolchain@stable - name: Setup Node.js uses: actions/setup-node@v4 @@ -314,9 +306,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2022-08-22 + uses: dtolnay/rust-toolchain@stable - name: Setup Node.js uses: actions/setup-node@v4 diff --git a/changelog.d/20251228_053006_migrate_to_stable_rust.md b/changelog.d/20251228_053006_migrate_to_stable_rust.md new file mode 100644 index 0000000..a3d9307 --- /dev/null +++ b/changelog.d/20251228_053006_migrate_to_stable_rust.md @@ -0,0 +1,16 @@ +--- +bump: minor +--- + +### Changed +- Migrated from nightly Rust (nightly-2022-08-22) to stable Rust toolchain +- Updated Rust edition from 2018 to 2021 +- Updated `num-traits` dependency from 0.2.14 to 0.2.19 +- Set minimum Rust version (MSRV) to 1.70 + +### Removed +- **BREAKING**: Removed `Step` trait bound from `LinkType` trait + - The `std::iter::Step` trait remains unstable in Rust (tracking issue #42168) + - Types implementing `LinkType` no longer need to implement `Step` + - This is required for stable Rust compatibility +- Removed `#![feature(step_trait)]` and `#![feature(trait_alias)]` feature flags diff --git a/rust/Cargo.lock b/rust/Cargo.lock index e618171..f11f6d6 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -19,7 +19,7 @@ dependencies = [ [[package]] name = "platform-num" -version = "0.1.0" +version = "0.2.0" dependencies = [ "num-traits", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index d58f98d..979167c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "platform-num" -version = "0.1.0" -edition = "2018" +version = "0.2.0" +edition = "2021" +rust-version = "1.70" authors = ["uselesssgoddess", "Linksplatform Team "] license = "LGPL-3.0" repository = "https://github.com/linksplatform/Numbers" @@ -18,7 +19,7 @@ name = "platform_num" path = "src/lib.rs" [dependencies] -num-traits = "0.2.14" +num-traits = "0.2.19" [profile.release] lto = true diff --git a/rust/rust-toolchain.toml b/rust/rust-toolchain.toml index d7c5705..e8c2360 100644 --- a/rust/rust-toolchain.toml +++ b/rust/rust-toolchain.toml @@ -1,2 +1,3 @@ [toolchain] -channel = "nightly-2022-08-22" +channel = "stable" +components = ["rustfmt"] diff --git a/rust/src/imp.rs b/rust/src/imp.rs index 9c669f3..d3f33cc 100644 --- a/rust/src/imp.rs +++ b/rust/src/imp.rs @@ -1,6 +1,5 @@ use std::fmt::{Debug, Display}; use std::hash::Hash; -use std::iter::Step; use num_traits::{AsPrimitive, FromPrimitive, PrimInt, Signed, ToPrimitive, Unsigned}; @@ -74,7 +73,6 @@ max_value_impl!(usize); pub trait LinkType: Num + Unsigned -+ Step + ToSigned + MaxValue + FromPrimitive @@ -89,7 +87,6 @@ Num impl< All: Num + Unsigned - + Step + ToSigned + MaxValue + FromPrimitive diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 66dbe9d..6f429d1 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,6 +1,3 @@ -#![feature(step_trait)] -#![feature(trait_alias)] - mod imp; pub use imp::{LinkType, MaxValue, Num, SignNum, ToSigned};