@@ -2,6 +2,7 @@ use std::marker::PhantomData;
22
33use crate :: syntax:: { ast:: App , Context } ;
44use crate :: { analyze:: Analysis , codegen:: bindings:: interrupt_mod, codegen:: util} ;
5+ use proc_macro:: Span ;
56use proc_macro2:: TokenStream as TokenStream2 ;
67use quote:: quote;
78
@@ -195,8 +196,7 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 {
195196 let local_tasks_on_same_executor: Vec < _ > = app
196197 . software_tasks
197198 . iter ( )
198- //.filter(|(_, t)| t.args.is_local_task && t.args.priority == priority)
199- . map ( |( _, t) | t)
199+ . filter ( |( _, t) | t. args . is_local_task && t. args . priority == priority)
200200 . collect ( ) ;
201201
202202 if !local_tasks_on_same_executor. is_empty ( ) {
@@ -212,8 +212,9 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 {
212212 } ) ;
213213 let tasks = local_tasks_on_same_executor
214214 . iter ( )
215- . map ( |task| {
215+ . map ( |( ident , task) | {
216216 // Copied mostly from software_tasks.rs
217+ let internal_spawn_ident = util:: internal_task_ident ( ident, "spawn" ) ;
217218 let context = & task. context ;
218219 let attrs = & task. attrs ;
219220 let cfgs = & task. cfgs ;
@@ -233,7 +234,7 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 {
233234 #( #attrs) *
234235 #( #cfgs) *
235236 #[ allow( non_snake_case) ]
236- fn #name #generics( & self #( , #inputs) * ) {
237+ fn #ident #generics( & self #( , #inputs) * ) {
237238 // SAFETY: This is safe to call since this can only be called
238239 // from the same executor
239240 unsafe { #internal_spawn_ident( #( #input_vals, ) * ) } // <-- TODO strip the types
0 commit comments