{"record":{"id":"663f63760bcd6aa3","repo":"tokio-rs/tokio","slug":"the-single-threaded-runtime-flavor-is-called-curr","errorCode":null,"errorMessage":"The single threaded runtime flavor is called `current_thread`.","messagePattern":"The single threaded runtime flavor is called `current_thread`\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"tokio-macros/src/entry.rs","lineNumber":22,"sourceCode":"use syn::{braced, Attribute, Ident, Path, Signature, Visibility};\n\n// syn::AttributeArgs does not implement syn::Parse\ntype 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),","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/tokio-rs/tokio/blob/625954f365727668cb02d04172b34f1149637728/tokio-macros/src/entry.rs#L4-L40","documentation":"`RuntimeFlavor::from_str` (entry.rs:18) maps the legacy spelling `single_thread` to an explicit guidance error rather than silently failing. The only correct single-threaded flavor is `current_thread`; this message points the user directly at it.","triggerScenarios":"Writing `#[tokio::main(flavor = \"single_thread\")]` — a value that looks reasonable but is not a valid flavor.","commonSituations":"Porting from other async runtimes (e.g. smol/async-std terminology); guessing the flavor name; outdated tutorials.","solutions":["Replace `flavor = \"single_thread\"` with `flavor = \"current_thread\"`."],"exampleFix":"// before\n#[tokio::main(flavor = \"single_thread\")]\nasync fn main() {}\n\n// after\n#[tokio::main(flavor = \"current_thread\")]\nasync fn main() {}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Memorize the three valid flavors: `current_thread`, `local`, `multi_thread`.","For single-threaded, always write `current_thread`.","Cross-check against the tokio docs when unsure of an option name."],"tags":["tokio","macros","compile-error","config","naming","migration"],"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"}