{"record":{"id":"094e5629f69e5749","repo":"tokio-rs/tokio","slug":"the-basic-scheduler-runtime-flavor-has-been-rena","errorCode":null,"errorMessage":"The `basic_scheduler` runtime flavor has been renamed to `current_thread`.","messagePattern":"The `basic_scheduler` runtime flavor has been renamed to `current_thread`\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"tokio-macros/src/entry.rs","lineNumber":23,"sourceCode":"\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),\n            _ => Err(format!(\"No such unhandled panic behavior `{s}`. The unhandled panic behaviors are `ignore` and `shutdown_runtime`.\")),","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/tokio-rs/tokio/blob/625954f365727668cb02d04172b34f1149637728/tokio-macros/src/entry.rs#L5-L41","documentation":"`RuntimeFlavor::from_str` (entry.rs:23) recognizes the old tokio pre-1.0 name `basic_scheduler` only to emit this rename notice. It is no longer a valid flavor; the replacement is `current_thread`.","triggerScenarios":"Using `#[tokio::main(flavor = \"basic_scheduler\")]` carried over from an old tokio version (0.x).","commonSituations":"Upgrading a crate from tokio 0.2/0.3 to 1.x without updating macro options; copy-pasting from pre-1.0 docs/examples.","solutions":["Replace `flavor = \"basic_scheduler\"` with `flavor = \"current_thread\"`.","Audit the whole crate for other legacy names (`threaded_scheduler` → `multi_thread`) when migrating from 0.x."],"exampleFix":"// before (tokio 0.x)\n#[tokio::main(basic_scheduler)]\nasync fn main() {}\n\n// after (tokio 1.x)\n#[tokio::main(flavor = \"current_thread\")]\nasync fn main() {}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["When upgrading tokio from 0.x, search the codebase for `basic_scheduler` and `threaded_scheduler` and rename them.","Pin to the current major version's docs for macro option names.","Run `cargo check` immediately after a tokio version bump to catch renamed options."],"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"}