From e4b108c6b73fdf2415df65a214643f7ad9f29372 Mon Sep 17 00:00:00 2001 From: Serge Barral Date: Mon, 6 May 2024 16:38:29 +0200 Subject: [PATCH] Satisfy newest clippy --- .github/workflows/ci.yml | 2 +- asynchronix/Cargo.toml | 2 +- asynchronix/build.rs | 3 +++ asynchronix/src/executor/task/cancel_token.rs | 6 +++--- asynchronix/src/executor/task/promise.rs | 4 ++-- asynchronix/src/executor/task/runnable.rs | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c952a0..b0b9912 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: matrix: rust: - stable - - 1.75.0 + - 1.77.0 steps: - name: Checkout sources uses: actions/checkout@v3 diff --git a/asynchronix/Cargo.toml b/asynchronix/Cargo.toml index 079c113..981ce35 100644 --- a/asynchronix/Cargo.toml +++ b/asynchronix/Cargo.toml @@ -9,7 +9,7 @@ name = "asynchronix" authors = ["Serge Barral "] version = "0.2.2" edition = "2021" -rust-version = "1.75" +rust-version = "1.77.0" license = "MIT OR Apache-2.0" repository = "https://github.com/asynchronics/asynchronix" readme = "../README.md" diff --git a/asynchronix/build.rs b/asynchronix/build.rs index ce89ca8..fb7492c 100644 --- a/asynchronix/build.rs +++ b/asynchronix/build.rs @@ -1,4 +1,7 @@ fn main() -> Result<(), Box> { + // Prevent warnings when checking for flag `asynchronix_loom`. + println!("cargo::rustc-check-cfg=cfg(asynchronix_loom)"); + #[cfg(feature = "rpc-codegen")] let builder = tonic_build::configure() .build_client(false) diff --git a/asynchronix/src/executor/task/cancel_token.rs b/asynchronix/src/executor/task/cancel_token.rs index 2bc2b13..6d1511f 100644 --- a/asynchronix/src/executor/task/cancel_token.rs +++ b/asynchronix/src/executor/task/cancel_token.rs @@ -25,7 +25,7 @@ struct VTable { /// but not currently scheduled (no `Runnable` exist) then the future is /// dropped immediately. Otherwise, the future will be dropped at a later /// time by the scheduled `Runnable` once it runs. -unsafe fn cancel(ptr: *const ()) +unsafe fn cancel(ptr: *const ()) where F: Future + Send + 'static, F::Output: Send + 'static, @@ -123,7 +123,7 @@ where } /// Drops the token without cancelling the task. -unsafe fn drop(ptr: *const ()) +unsafe fn drop(ptr: *const ()) where F: Future + Send + 'static, F::Output: Send + 'static, @@ -180,7 +180,7 @@ impl CancelToken { /// allocator, /// - the reference count has been incremented to account for this new task /// reference. - pub(super) unsafe fn new_unchecked(task: *const Task) -> Self + pub(super) unsafe fn new_unchecked(task: *const Task) -> Self where F: Future + Send + 'static, F::Output: Send + 'static, diff --git a/asynchronix/src/executor/task/promise.rs b/asynchronix/src/executor/task/promise.rs index 7504d26..47d56f9 100644 --- a/asynchronix/src/executor/task/promise.rs +++ b/asynchronix/src/executor/task/promise.rs @@ -20,7 +20,7 @@ struct VTable { } /// Retrieves the output of the task if ready. -unsafe fn poll(ptr: *const ()) -> Stage +unsafe fn poll(ptr: *const ()) -> Stage where F: Future + Send + 'static, F::Output: Send + 'static, @@ -62,7 +62,7 @@ where } /// Drops the promise. -unsafe fn drop(ptr: *const ()) +unsafe fn drop(ptr: *const ()) where F: Future + Send + 'static, F::Output: Send + 'static, diff --git a/asynchronix/src/executor/task/runnable.rs b/asynchronix/src/executor/task/runnable.rs index 792af3b..d5162c6 100644 --- a/asynchronix/src/executor/task/runnable.rs +++ b/asynchronix/src/executor/task/runnable.rs @@ -22,7 +22,7 @@ struct VTable { } /// Polls the inner future. -unsafe fn run(ptr: *const ()) +unsafe fn run(ptr: *const ()) where F: Future + Send + 'static, F::Output: Send + 'static,