Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore compatibility with Rust 1.74 #563

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tiran
Copy link

@tiran tiran commented Jan 24, 2025

What does this PR do?

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.

PR huggingface#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant