fixup ci: unsafe usage on nightly and bump ed25519's MSRV (#753)

* ed25519-dalek: bump MSRV to 1.81

base64ct now requires rustc 1.81

* nightly and stable disagree on usage of unsafe

```
error: unnecessary `unsafe` block
492
   --> curve25519-dalek/src/backend/vector/avx2/field.rs:479:28
493
    |
494
479 |         let c9_19: u32x8 = unsafe {
495
    |                            ^^^^^^ unnecessary `unsafe` block
```

This would only happen on nightly.
This commit is contained in:
Arthur Gautier 2025-05-08 18:37:08 +00:00 committed by GitHub
parent fbf1fb5339
commit 773a0646ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 18 additions and 11 deletions

View file

@ -20,7 +20,7 @@ env:
jobs:
msrv:
name: Current MSRV is 1.60.0
name: Current MSRV is 1.81.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -29,5 +29,5 @@ jobs:
- run: cargo update -Z minimal-versions
# Now check that `cargo build` works with respect to the oldest possible
# deps and the stated MSRV
- uses: dtolnay/rust-toolchain@1.60.0
- uses: dtolnay/rust-toolchain@1.81.0
- run: cargo build

View file

@ -85,7 +85,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.81.0
with:
components: clippy
- run: cargo clippy --target x86_64-unknown-linux-gnu --all-features

View file

@ -81,14 +81,7 @@ to build out more elaborate abstractions it starts to become painful to use.
This crate exposes an `#[unsafe_target_feature]` macro which works just like `#[target_feature]` except
it moves the `unsafe` from the function prototype into the macro name, and can be used on safe functions.
```rust,compile_fail
// ERROR: `#[target_feature(..)]` can only be applied to `unsafe` functions
#[target_feature(enable = "avx2")]
fn func() {}
```
```rust
// It works, but must be `unsafe`
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[target_feature(enable = "avx2")]
unsafe fn func() {}

View file

@ -9,6 +9,11 @@
// - isis agora lovecruft <isis@patternsinthevoid.net>
// - Henry de Valence <hdevalence@hdevalence.ca>
// Nightly and stable currently disagree on the requirement of unsafe blocks when `unsafe_target_feature`
// gets used.
// See: https://github.com/rust-lang/rust/issues/132856
#![allow(unused_unsafe)]
//! An implementation of 4-way vectorized 32bit field arithmetic using
//! AVX2.
//!

View file

@ -9,6 +9,10 @@
// - isis agora lovecruft <isis@patternsinthevoid.net>
// - Henry de Valence <hdevalence@hdevalence.ca>
// Nightly and stable currently disagree on the requirement of unsafe blocks when `unsafe_target_feature`
// gets used.
// See: https://github.com/rust-lang/rust/issues/132856
#![allow(unused_unsafe)]
#![allow(non_snake_case)]
use crate::backend::vector::packed_simd::u64x4;

View file

@ -3,6 +3,11 @@
// This file is part of curve25519-dalek.
// See LICENSE for licensing information.
// Nightly and stable currently disagree on the requirement of unsafe blocks when `unsafe_target_feature`
// gets used.
// See: https://github.com/rust-lang/rust/issues/132856
#![allow(unused_unsafe)]
//! This module defines wrappers over platform-specific SIMD types to make them
//! more convenient to use.
//!

View file

@ -16,7 +16,7 @@ keywords = ["cryptography", "ed25519", "curve25519", "signature", "ECC"]
categories = ["cryptography", "no-std"]
description = "Fast and efficient ed25519 EdDSA key generations, signing, and verification in pure Rust."
exclude = [ ".gitignore", "TESTVECTORS", "VALIDATIONVECTORS", "res/*" ]
rust-version = "1.60"
rust-version = "1.81"
[package.metadata.docs.rs]
rustdoc-args = [