{"record":{"id":"d7053367f48b7241","repo":"tokio-rs/tokio","slug":"the-threaded-scheduler-runtime-flavor-has-been-r","errorCode":null,"errorMessage":"The `threaded_scheduler` runtime flavor has been renamed to `multi_thread`.","messagePattern":"The `threaded_scheduler` runtime flavor has been renamed to `multi_thread`\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"tokio-macros/src/entry.rs","lineNumber":24,"sourceCode":"// 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),\n            _ => Err(format!(\"No such unhandled panic behavior `{s}`. The unhandled panic behaviors are `ignore` and `shutdown_runtime`.\")),\n        }","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/tokio-rs/tokio/blob/625954f365727668cb02d04172b34f1149637728/tokio-macros/src/entry.rs#L6-L42","documentation":"`RuntimeFlavor::from_str` (entry.rs:24) keeps the pre-1.0 name `threaded_scheduler` only to redirect users. The current multi-threaded flavor is `multi_thread`.","triggerScenarios":"Using `#[tokio::main(flavor = \"threaded_scheduler\")]` from old tokio code.","commonSituations":"Migrating from tokio 0.x; stale Stack Overflow answers / blog posts.","solutions":["Replace `flavor = \"threaded_scheduler\"` with `flavor = \"multi_thread\"`.","Ensure the `rt-multi-thread` feature is enabled in `Cargo.toml` (required for the multi-thread flavor)."],"exampleFix":"// before (tokio 0.x)\n#[tokio::main(threaded_scheduler)]\nasync fn main() {}\n\n// after (tokio 1.x)\n#[tokio::main(flavor = \"multi_thread\")]\nasync fn main() {}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["On tokio 0.x → 1.x migration, replace `threaded_scheduler` with `multi_thread`.","Confirm `rt-multi-thread` is enabled in `Cargo.toml` for the multi-thread flavor.","Update any copied example code to current option names."],"tags":["tokio","macros","compile-error","config","migration","version-upgrade"],"backgroundTag":null,"analyzedSha":"625954f365727668cb02d04172b34f1149637728","analyzedAt":"2026-08-11T17:46:45.378Z","contentChangedAt":"2026-08-11T17:46:45.378Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}