{"record":{"id":"a22a665a2380c180","repo":"tokio-rs/tokio","slug":"no-such-runtime-flavor-s-the-runtime-flavors","errorCode":null,"errorMessage":"No such runtime flavor `{s}`. The runtime flavors are `current_thread`, `local`, and `multi_thread`.","messagePattern":"No such runtime flavor `(.+?)`\\. The runtime flavors are `current_thread`, `local`, and `multi_thread`\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"tokio-macros/src/entry.rs","lineNumber":25,"sourceCode":"type AttributeArgs = syn::punctuated::Punctuated<syn::Meta, syn::Token![,]>;\n\n#[derive(Clone, Copy, PartialEq)]\nenum RuntimeFlavor {\n    CurrentThread,\n    Threaded,\n    Local,\n}\n\nimpl RuntimeFlavor {\n    fn from_str(s: &str) -> Result<RuntimeFlavor, String> {\n        match s {\n            \"current_thread\" => Ok(RuntimeFlavor::CurrentThread),\n            \"multi_thread\" => Ok(RuntimeFlavor::Threaded),\n            \"local\" => Ok(RuntimeFlavor::Local),\n            \"single_thread\" => Err(\"The single threaded runtime flavor is called `current_thread`.\".to_string()),\n            \"basic_scheduler\" => Err(\"The `basic_scheduler` runtime flavor has been renamed to `current_thread`.\".to_string()),\n            \"threaded_scheduler\" => Err(\"The `threaded_scheduler` runtime flavor has been renamed to `multi_thread`.\".to_string()),\n            _ => Err(format!(\"No such runtime flavor `{s}`. The runtime flavors are `current_thread`, `local`, and `multi_thread`.\")),\n        }\n    }\n}\n\n#[derive(Clone, Copy, PartialEq)]\nenum UnhandledPanic {\n    Ignore,\n    ShutdownRuntime,\n}\n\nimpl UnhandledPanic {\n    fn from_str(s: &str) -> Result<UnhandledPanic, String> {\n        match s {\n            \"ignore\" => Ok(UnhandledPanic::Ignore),\n            \"shutdown_runtime\" => Ok(UnhandledPanic::ShutdownRuntime),\n            _ => Err(format!(\"No such unhandled panic behavior `{s}`. The unhandled panic behaviors are `ignore` and `shutdown_runtime`.\")),\n        }\n    }","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/tokio-rs/tokio/blob/625954f365727668cb02d04172b34f1149637728/tokio-macros/src/entry.rs#L7-L43","documentation":"`RuntimeFlavor::from_str` (entry.rs:25) is the catch-all for any `flavor` value that is not one of `current_thread`, `local`, or `multi_thread` and is not a recognized legacy alias. It formats the offending value into the message.","triggerScenarios":"Typing an arbitrary/misspelled flavor such as `#[tokio::main(flavor = \"multithread\")]`, `flavor = \"single\"`, or an unsupported runtime name.","commonSituations":"Typos; wrong-case (`Multi_Thread`); assuming a flavor that doesn't exist; mixing in names from other runtimes.","solutions":["Use one of the supported flavors: `current_thread`, `local`, or `multi_thread`.","If you wanted the single-threaded runtime, use `current_thread`.","Remove the `flavor` option entirely to accept the documented default (`multi_thread` when `rt-multi-thread` is on, else `current_thread`)."],"exampleFix":"// before\n#[tokio::main(flavor = \"multithread\")]\nasync fn main() {}\n\n// after\n#[tokio::main(flavor = \"multi_thread\")]\nasync fn main() {}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only `current_thread`, `local`, or `multi_thread`.","Match exact spelling and case (lowercase, underscores).","Omit `flavor` to take the default rather than guessing."],"tags":["tokio","macros","compile-error","config","invalid-value"],"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"}