{"record":{"id":"ea6d2f63f7a5c632","repo":"tokio-rs/tokio","slug":"the-runtime-flavor-multi-thread-requires-the-rt","errorCode":null,"errorMessage":"The runtime flavor `multi_thread` requires the `rt-multi-thread` feature.","messagePattern":"The runtime flavor `multi_thread` requires the `rt-multi-thread` feature\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"tokio-macros/src/entry.rs","lineNumber":213,"sourceCode":"        let flavor = self.flavor.unwrap_or(self.default_flavor);\n\n        let worker_threads = match (flavor, self.worker_threads) {\n            (F::CurrentThread | F::Local, Some((_, worker_threads_span))) => {\n                let msg = format!(\n                    \"The `worker_threads` option requires the `multi_thread` runtime flavor. Use `#[{}(flavor = \\\"multi_thread\\\")]`\",\n                    self.macro_name(),\n                );\n                return Err(syn::Error::new(worker_threads_span, msg));\n            }\n            (F::CurrentThread | F::Local, None) => None,\n            (F::Threaded, worker_threads) if self.rt_multi_thread_available => {\n                worker_threads.map(|(val, _span)| val)\n            }\n            (F::Threaded, _) => {\n                let msg = if self.flavor.is_none() {\n                    \"The default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled.\"\n                } else {\n                    \"The runtime flavor `multi_thread` requires the `rt-multi-thread` feature.\"\n                };\n                return Err(syn::Error::new(Span::call_site(), msg));\n            }\n        };\n\n        let start_paused = match (flavor, self.start_paused) {\n            (F::Threaded, Some((_, start_paused_span))) => {\n                let msg = format!(\n                    \"The `start_paused` option requires the `current_thread` runtime flavor. Use `#[{}(flavor = \\\"current_thread\\\")]`\",\n                    self.macro_name(),\n                );\n                return Err(syn::Error::new(start_paused_span, msg));\n            }\n            (F::CurrentThread | F::Local, Some((start_paused, _))) => Some(start_paused),\n            (_, None) => None,\n        };\n\n        let unhandled_panic = match (flavor, self.unhandled_panic) {","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/tokio-rs/tokio/blob/625954f365727668cb02d04172b34f1149637728/tokio-macros/src/entry.rs#L195-L231","documentation":"Companion to error 15, this message (entry.rs:213) fires when the user *explicitly* set `flavor = \"multi_thread\"` but the `rt-multi-thread` feature is disabled. The flavor choice and the enabled feature must agree.","triggerScenarios":"Writing `#[tokio::main(flavor = \"multi_thread\")]` while `Cargo.toml` lists tokio without `rt-multi-thread`.","commonSituations":"Manually setting flavor to multi-thread on a dependency that was feature-gated down for size; CI using a minimal feature set.","solutions":["Add `rt-multi-thread` to tokio's features in `Cargo.toml`.","Or change the attribute to `flavor = \"current_thread\"` if multi-threading is not needed."],"exampleFix":"# before — Cargo.toml\ntokio = { version = \"1\", features = [\"macros\"] }\n// src/main.rs: #[tokio::main(flavor = \"multi_thread\")] async fn main() {}\n\n# after — Cargo.toml\ntokio = { version = \"1\", features = [\"rt-multi-thread\", \"macros\"] }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["`flavor = \"multi_thread\"` requires the `rt-multi-thread` feature.","Keep the macro flavor and `Cargo.toml` features in sync.","Use a shared, version-pinned tokio feature list across the workspace."],"tags":["tokio","macros","compile-error","cargo-features","config","flavor-mismatch"],"backgroundTag":null,"analyzedSha":"625954f365727668cb02d04172b34f1149637728","analyzedAt":"2026-08-11T17:46:45.378Z","contentChangedAt":"2026-08-11T17:46:45.378Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}