Skip to content

Commit a0ca77e

Browse files
committed
tokio-macros: hard error if flavor = "local" and not tokio_unstable
1 parent bc425d8 commit a0ca77e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tokio-macros/src/entry.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ impl RuntimeFlavor {
1818
match s {
1919
"current_thread" => Ok(RuntimeFlavor::CurrentThread),
2020
"multi_thread" => Ok(RuntimeFlavor::Threaded),
21-
"local" => Ok(RuntimeFlavor::Local),
21+
"local" => if cfg!(tokio_unstable) {
22+
Ok(RuntimeFlavor::Local)
23+
} else {
24+
Err("The local runtime flavor is only available when `tokio_unstable` is set.".to_string())
25+
}
2226
"single_thread" => Err("The single threaded runtime flavor is called `current_thread`.".to_string()),
2327
"basic_scheduler" => Err("The `basic_scheduler` runtime flavor has been renamed to `current_thread`.".to_string()),
2428
"threaded_scheduler" => Err("The `threaded_scheduler` runtime flavor has been renamed to `multi_thread`.".to_string()),

0 commit comments

Comments
 (0)