Skip to content

Commit 7bb3088

Browse files
committed
Fix a lot of errors
1 parent 2d5cb2f commit 7bb3088

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

rtic-macros/src/codegen/module.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 {
198198
.collect();
199199

200200
if !local_tasks_on_same_executor.is_empty() {
201+
let local_spawner = util::internal_task_ident(ident, "LocalSpawner");
201202
fields.push(quote! {
202203
/// Used to spawn tasks on the same executor
203204
///
@@ -206,7 +207,7 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 {
206207
/// NOTE: This only works with tasks marked `is_local_task = true`
207208
/// and which have the same priority and thus will run on the
208209
/// same executor.
209-
pub local_spawner: LocalSpawner
210+
pub local_spawner: #local_spawner
210211
});
211212
let tasks = local_tasks_on_same_executor
212213
.iter()
@@ -226,21 +227,21 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 {
226227
#(#attrs)*
227228
#(#cfgs)*
228229
#[allow(non_snake_case)]
229-
fn #ident #generics(&self #(,#inputs)*) {
230+
pub(super) fn #ident #generics(&self #(,#inputs)*) {
230231
// SAFETY: This is safe to call since this can only be called
231232
// from the same executor
232-
unsafe { #internal_spawn_ident(#(#input_vals,)*) }
233+
unsafe { super::#internal_spawn_ident(#(#input_vals,)*) }
233234
}
234235
}
235236
})
236237
.collect::<Vec<_>>();
237-
values.push(quote!(local_spawner: LocalSpawner { _p: PhantomData }));
238-
module_items.push(quote! {
239-
struct LocalSpawner {
240-
_p: PhantomData<*mut ()>,
238+
values.push(quote!(local_spawner: #t::LocalSpawner { _p: core::marker::PhantomData }));
239+
items.push(quote! {
240+
struct #local_spawner {
241+
_p: core::marker::PhantomData<*mut ()>,
241242
}
242243

243-
impl LocalSpawner {
244+
impl #local_spawner {
244245
#(#tasks)*
245246
}
246247
});

0 commit comments

Comments
 (0)