From ce2423dc8dc5a9f67e7f28e070670debac36fa69 Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 25 Jul 2024 21:20:53 +0900 Subject: [PATCH 1/7] chore: fix ci failures --- tokio/src/runtime/tests/queue.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tokio/src/runtime/tests/queue.rs b/tokio/src/runtime/tests/queue.rs index f463355f0d3..c4d4a1b8642 100644 --- a/tokio/src/runtime/tests/queue.rs +++ b/tokio/src/runtime/tests/queue.rs @@ -273,6 +273,7 @@ fn stress2() { } } +#[allow(dead_code)] struct Runtime; impl Schedule for Runtime { From 5aaca4b4e9b9ca886279d5935c66a52721378354 Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 25 Jul 2024 21:52:40 +0900 Subject: [PATCH 2/7] add a lint field to the Cargo.toml --- examples/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index d1a70dbc774..f9077c2eb28 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -27,6 +27,9 @@ rand = "0.8.3" [target.'cfg(windows)'.dev-dependencies.windows-sys] version = "0.52" +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)', 'cfg(tokio_taskdump)'] } + [[example]] name = "chat" path = "chat.rs" From 2297f07a2dbd5bd38ad30bb6bc1be9899c13cbe2 Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 25 Jul 2024 22:07:30 +0900 Subject: [PATCH 3/7] Revert "add a lint field to the Cargo.toml" This reverts commit 5aaca4b4e9b9ca886279d5935c66a52721378354. --- examples/Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index f9077c2eb28..d1a70dbc774 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -27,9 +27,6 @@ rand = "0.8.3" [target.'cfg(windows)'.dev-dependencies.windows-sys] version = "0.52" -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)', 'cfg(tokio_taskdump)'] } - [[example]] name = "chat" path = "chat.rs" From 11b3a6661d90826c0e7591a81d446da0bebd1be6 Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 25 Jul 2024 22:08:55 +0900 Subject: [PATCH 4/7] add `#![allow(unknown_lints, unexpected_cfgs)]` --- examples/dump.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/dump.rs b/examples/dump.rs index c7ece458ff8..6f744713f7c 100644 --- a/examples/dump.rs +++ b/examples/dump.rs @@ -1,3 +1,5 @@ +#![allow(unknown_lints, unexpected_cfgs)] + //! This example demonstrates tokio's experimental task dumping functionality. //! This application deadlocks. Input CTRL+C to display traces of each task, or //! input CTRL+C twice within 1 second to quit. From f92d06552a72e96f57438ea02f199e5484eb4502 Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 25 Jul 2024 22:28:03 +0900 Subject: [PATCH 5/7] ignore some doc tests --- tokio-macros/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index b5d31c7f6dc..d3cfe57fedb 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -210,7 +210,7 @@ use proc_macro::TokenStream; /// /// This option is only compatible with the `current_thread` runtime. /// -/// ```no_run +/// ```ignore /// #[cfg(tokio_unstable)] /// #[tokio::main(flavor = "current_thread", unhandled_panic = "shutdown_runtime")] /// async fn main() { @@ -224,7 +224,7 @@ use proc_macro::TokenStream; /// /// Equivalent code not using `#[tokio::main]` /// -/// ```no_run +/// ```ignore /// #[cfg(tokio_unstable)] /// fn main() { /// tokio::runtime::Builder::new_current_thread() @@ -491,7 +491,7 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream { /// /// Equivalent code not using `#[tokio::test]` /// -/// ```no_run +/// ```ignore /// #[cfg(tokio_unstable)] /// #[test] /// fn my_test() { From 580440bdca8a8c339679feb12c03f044098d2ca6 Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 25 Jul 2024 22:50:36 +0900 Subject: [PATCH 6/7] Revert "ignore some doc tests" This reverts commit f92d06552a72e96f57438ea02f199e5484eb4502. --- tokio-macros/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index d3cfe57fedb..b5d31c7f6dc 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -210,7 +210,7 @@ use proc_macro::TokenStream; /// /// This option is only compatible with the `current_thread` runtime. /// -/// ```ignore +/// ```no_run /// #[cfg(tokio_unstable)] /// #[tokio::main(flavor = "current_thread", unhandled_panic = "shutdown_runtime")] /// async fn main() { @@ -224,7 +224,7 @@ use proc_macro::TokenStream; /// /// Equivalent code not using `#[tokio::main]` /// -/// ```ignore +/// ```no_run /// #[cfg(tokio_unstable)] /// fn main() { /// tokio::runtime::Builder::new_current_thread() @@ -491,7 +491,7 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream { /// /// Equivalent code not using `#[tokio::test]` /// -/// ```ignore +/// ```no_run /// #[cfg(tokio_unstable)] /// #[test] /// fn my_test() { From 3938c58666fd6c9f69f7960033b7a320dd8b5c0b Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 25 Jul 2024 22:56:09 +0900 Subject: [PATCH 7/7] add `#![allow(unknown_lints, unexpected_cfgs)]` in doc --- tokio-macros/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index b5d31c7f6dc..29ea2867cff 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -211,6 +211,7 @@ use proc_macro::TokenStream; /// This option is only compatible with the `current_thread` runtime. /// /// ```no_run +/// # #![allow(unknown_lints, unexpected_cfgs)] /// #[cfg(tokio_unstable)] /// #[tokio::main(flavor = "current_thread", unhandled_panic = "shutdown_runtime")] /// async fn main() { @@ -225,6 +226,7 @@ use proc_macro::TokenStream; /// Equivalent code not using `#[tokio::main]` /// /// ```no_run +/// # #![allow(unknown_lints, unexpected_cfgs)] /// #[cfg(tokio_unstable)] /// fn main() { /// tokio::runtime::Builder::new_current_thread() @@ -478,6 +480,7 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream { /// This option is only compatible with the `current_thread` runtime. /// /// ```no_run +/// # #![allow(unknown_lints, unexpected_cfgs)] /// #[cfg(tokio_unstable)] /// #[tokio::test(flavor = "current_thread", unhandled_panic = "shutdown_runtime")] /// async fn my_test() { @@ -492,6 +495,7 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream { /// Equivalent code not using `#[tokio::test]` /// /// ```no_run +/// # #![allow(unknown_lints, unexpected_cfgs)] /// #[cfg(tokio_unstable)] /// #[test] /// fn my_test() {