]> khamidou — GitHub mirrors - safetensors.git/commit
Restore compatibility with Rust 1.74 (#563)
authorChristian Heimes <christian@python.org>
Tue, 4 Feb 2025 08:25:26 +0000 (09:25 +0100)
committerGitHub <noreply@github.com>
Tue, 4 Feb 2025 08:25:26 +0000 (09:25 +0100)
commit581f43bf212a32aaf00021efbea7fca49620811b
tree3cb17d03ac3b0dbd44bcbf2cc665b189add8ee59
parentee109c6098d4cb2573adcb334a36516703eb4d8c
Restore compatibility with Rust 1.74 (#563)

* Restore compatibility with Rust 1.74

PR #544 added support for `no_std` feature. The PR changed
`std::error::Error` to `core::error::Error`. The `core::error` trait was
stabilized in Rust 1.81, so the change bumped MSRV to 1.81. Before the
Python package built with Rust 1.66 and the `safetensors` create with
all features built with 1.74.

This commit restores compatibility with Rust 1.74 for `std` builds:

- `mixed_integer_ops` feature requires 1.66
- `half v2.4.1` requires 1.70
- `clap_lex v0.7.4` requires 1.74

I'm also adding `rust-version` to `Cargo.toml`, so cargo creates a
backwards compatible `Cargo.lock`. By default, Cargo >= 1.83 creates a
`v4` lock file, which is not compatible with Cargo < 1.78.

Signed-off-by: Christian Heimes <christian@python.org>
* Merging the test matrix.

---------

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
.github/workflows/rust.yml
bindings/python/Cargo.toml
safetensors/Cargo.toml
safetensors/src/tensor.rs