Skip to content

Commit c2dfaf7

Browse files
authored
Merge pull request #126 from linksplatform/issue-125-f599b5d2205c
Migrate Rust code to latest stable toolchain
2 parents f38a611 + aa87f80 commit c2dfaf7

File tree

7 files changed

+29
-27
lines changed

7 files changed

+29
-27
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ jobs:
5454
- uses: actions/checkout@v4
5555

5656
- name: Install Rust toolchain
57-
uses: dtolnay/rust-toolchain@master
57+
uses: dtolnay/rust-toolchain@stable
5858
with:
59-
toolchain: nightly-2022-08-22
6059
components: rustfmt
6160

6261
- name: Setup Node.js
@@ -94,9 +93,7 @@ jobs:
9493
- uses: actions/checkout@v4
9594

9695
- name: Install Rust toolchain
97-
uses: dtolnay/rust-toolchain@master
98-
with:
99-
toolchain: nightly-2022-08-22
96+
uses: dtolnay/rust-toolchain@stable
10097

10198
- name: Cache cargo registry
10299
uses: actions/cache@v4
@@ -120,9 +117,8 @@ jobs:
120117
- uses: actions/checkout@v4
121118

122119
- name: Install Rust toolchain
123-
uses: dtolnay/rust-toolchain@master
120+
uses: dtolnay/rust-toolchain@stable
124121
with:
125-
toolchain: nightly-2022-08-22
126122
components: llvm-tools-preview
127123

128124
- name: Cache cargo registry
@@ -157,9 +153,7 @@ jobs:
157153
- uses: actions/checkout@v4
158154

159155
- name: Install Rust toolchain
160-
uses: dtolnay/rust-toolchain@master
161-
with:
162-
toolchain: nightly-2022-08-22
156+
uses: dtolnay/rust-toolchain@stable
163157

164158
- name: Cache cargo registry
165159
uses: actions/cache@v4
@@ -227,9 +221,7 @@ jobs:
227221
token: ${{ secrets.GITHUB_TOKEN }}
228222

229223
- name: Install Rust toolchain
230-
uses: dtolnay/rust-toolchain@master
231-
with:
232-
toolchain: nightly-2022-08-22
224+
uses: dtolnay/rust-toolchain@stable
233225

234226
- name: Setup Node.js
235227
uses: actions/setup-node@v4
@@ -314,9 +306,7 @@ jobs:
314306
token: ${{ secrets.GITHUB_TOKEN }}
315307

316308
- name: Install Rust toolchain
317-
uses: dtolnay/rust-toolchain@master
318-
with:
319-
toolchain: nightly-2022-08-22
309+
uses: dtolnay/rust-toolchain@stable
320310

321311
- name: Setup Node.js
322312
uses: actions/setup-node@v4
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
bump: minor
3+
---
4+
5+
### Changed
6+
- Migrated from nightly Rust (nightly-2022-08-22) to stable Rust toolchain
7+
- Updated Rust edition from 2018 to 2021
8+
- Updated `num-traits` dependency from 0.2.14 to 0.2.19
9+
- Set minimum Rust version (MSRV) to 1.70
10+
11+
### Removed
12+
- **BREAKING**: Removed `Step` trait bound from `LinkType` trait
13+
- The `std::iter::Step` trait remains unstable in Rust (tracking issue #42168)
14+
- Types implementing `LinkType` no longer need to implement `Step`
15+
- This is required for stable Rust compatibility
16+
- Removed `#![feature(step_trait)]` and `#![feature(trait_alias)]` feature flags

rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
22
name = "platform-num"
3-
version = "0.1.0"
4-
edition = "2018"
3+
version = "0.2.0"
4+
edition = "2021"
5+
rust-version = "1.70"
56
authors = ["uselesssgoddess", "Linksplatform Team <[email protected]>"]
67
license = "LGPL-3.0"
78
repository = "https://github.com/linksplatform/Numbers"
@@ -18,7 +19,7 @@ name = "platform_num"
1819
path = "src/lib.rs"
1920

2021
[dependencies]
21-
num-traits = "0.2.14"
22+
num-traits = "0.2.19"
2223

2324
[profile.release]
2425
lto = true

rust/rust-toolchain.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2022-08-22"
2+
channel = "stable"
3+
components = ["rustfmt"]

rust/src/imp.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::fmt::{Debug, Display};
22
use std::hash::Hash;
3-
use std::iter::Step;
43

54
use num_traits::{AsPrimitive, FromPrimitive, PrimInt, Signed, ToPrimitive, Unsigned};
65

@@ -74,7 +73,6 @@ max_value_impl!(usize);
7473
pub trait LinkType:
7574
Num
7675
+ Unsigned
77-
+ Step
7876
+ ToSigned
7977
+ MaxValue
8078
+ FromPrimitive
@@ -89,7 +87,6 @@ Num
8987
impl<
9088
All: Num
9189
+ Unsigned
92-
+ Step
9390
+ ToSigned
9491
+ MaxValue
9592
+ FromPrimitive

rust/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(step_trait)]
2-
#![feature(trait_alias)]
3-
41
mod imp;
52

63
pub use imp::{LinkType, MaxValue, Num, SignNum, ToSigned};

0 commit comments

Comments
 (0)