File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,7 @@ impl RuntimeFlavor {
18
18
match s {
19
19
"current_thread" => Ok ( RuntimeFlavor :: CurrentThread ) ,
20
20
"multi_thread" => Ok ( RuntimeFlavor :: Threaded ) ,
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
- }
21
+ "local" => Ok ( RuntimeFlavor :: Local ) ,
26
22
"single_thread" => Err ( "The single threaded runtime flavor is called `current_thread`." . to_string ( ) ) ,
27
23
"basic_scheduler" => Err ( "The `basic_scheduler` runtime flavor has been renamed to `current_thread`." . to_string ( ) ) ,
28
24
"threaded_scheduler" => Err ( "The `threaded_scheduler` runtime flavor has been renamed to `multi_thread`." . to_string ( ) ) ,
@@ -183,6 +179,13 @@ impl Configuration {
183
179
use RuntimeFlavor as F ;
184
180
185
181
let flavor = self . flavor . unwrap_or ( self . default_flavor ) ;
182
+
183
+ if flavor == F :: Local && !cfg ! ( tokio_unstable) {
184
+ let msg = "The local runtime flavor is only available when `tokio_unstable` is set."
185
+ . to_string ( ) ;
186
+ return Err ( syn:: Error :: new ( Span :: call_site ( ) , msg) ) ;
187
+ }
188
+
186
189
let worker_threads = match ( flavor, self . worker_threads ) {
187
190
( F :: CurrentThread | F :: Local , Some ( ( _, worker_threads_span) ) ) => {
188
191
let msg = format ! (
You can’t perform that action at this time.
0 commit comments