From 108536113347b4fda26d72270a228b955ab91778 Mon Sep 17 00:00:00 2001 From: naveen28204280 Date: Sat, 22 Nov 2025 22:55:23 +0530 Subject: [PATCH 1/3] feat: throw compile time error for missing runtime --- quinn/Cargo.toml | 3 ++- quinn/src/runtime/mod.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/quinn/Cargo.toml b/quinn/Cargo.toml index 42a3d4917..a2a2431df 100644 --- a/quinn/Cargo.toml +++ b/quinn/Cargo.toml @@ -37,7 +37,8 @@ rustls-ring = ["dep:rustls", "ring", "proto/rustls-ring", "proto/ring"] ring = ["proto/ring"] runtime-tokio = ["tokio/time", "tokio/rt", "tokio/net"] runtime-smol = ["dep:async-io", "dep:smol"] - +# Allow users to declare a custom runtimne +custom-runtime = [] # Configure `tracing` to log events via `log` if no `tracing` subscriber exists. tracing-log = ["tracing/log", "proto/tracing-log", "udp/tracing-log"] # Enable rustls logging diff --git a/quinn/src/runtime/mod.rs b/quinn/src/runtime/mod.rs index 907b1992b..bb48e6451 100644 --- a/quinn/src/runtime/mod.rs +++ b/quinn/src/runtime/mod.rs @@ -12,6 +12,9 @@ use udp::{RecvMeta, Transmit}; use crate::Instant; +#[cfg(not(any(feature = "runtime-tokio", feature = "runtime-smol", feature = "custom-runtime")))] +compile_error!("no async runtime found. Please enable a runtimse such as runtime-tokio, runtime-smol or custom-runtime"); + /// Abstracts I/O and timer operations for runtime independence pub trait Runtime: Send + Sync + Debug + 'static { /// Construct a timer that will expire at `i` From 228ba79c19004cba0bab7053474035bc8b4f9a95 Mon Sep 17 00:00:00 2001 From: naveen28204280 Date: Mon, 24 Nov 2025 22:32:14 +0530 Subject: [PATCH 2/3] fix: typo in no-runtime-found compile error --- quinn/src/runtime/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quinn/src/runtime/mod.rs b/quinn/src/runtime/mod.rs index bb48e6451..6ae3d78d7 100644 --- a/quinn/src/runtime/mod.rs +++ b/quinn/src/runtime/mod.rs @@ -13,7 +13,7 @@ use udp::{RecvMeta, Transmit}; use crate::Instant; #[cfg(not(any(feature = "runtime-tokio", feature = "runtime-smol", feature = "custom-runtime")))] -compile_error!("no async runtime found. Please enable a runtimse such as runtime-tokio, runtime-smol or custom-runtime"); +compile_error!("no async runtime found. Please enable a runtime feature such as runtime-tokio, runtime-smol or custom-runtime"); /// Abstracts I/O and timer operations for runtime independence pub trait Runtime: Send + Sync + Debug + 'static { From adfbd9e1e24e62a22d2b0d956f4aed2eef09ea10 Mon Sep 17 00:00:00 2001 From: naveen28204280 Date: Tue, 25 Nov 2025 18:27:35 +0530 Subject: [PATCH 3/3] fix: edit job lint to add feature runtime-tokio --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 80f8a6141..4958bd12d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -171,7 +171,7 @@ jobs: components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - run: cargo fmt --all -- --check - - run: cargo check --locked --manifest-path quinn/Cargo.toml --all-targets --no-default-features + - run: cargo check --locked --manifest-path quinn/Cargo.toml --all-targets --no-default-features --features runtime-tokio - run: cargo clippy --locked --all-targets -- -D warnings - uses: dtolnay/rust-toolchain@stable with: