diff options
author | 2021-11-11 14:22:47 +0100 | |
---|---|---|
committer | 2021-11-11 14:22:47 +0100 | |
commit | 6f2aa08910cbe7c41ae877bdbf6eb3dc3cad5f22 (patch) | |
tree | 1adb489563769d5e3bda7d698baac33d31d9b092 /macros/src/codegen/shared_resources_struct.rs | |
parent | 6466aec406ccb20bc9f7b2b31fa5ab9e2501c2e7 (diff) | |
download | rtic-6f2aa08910cbe7c41ae877bdbf6eb3dc3cad5f22.tar.gz rtic-6f2aa08910cbe7c41ae877bdbf6eb3dc3cad5f22.tar.zst rtic-6f2aa08910cbe7c41ae877bdbf6eb3dc3cad5f22.zip |
Better errors on when missing to lock shared resources
Diffstat (limited to 'macros/src/codegen/shared_resources_struct.rs')
-rw-r--r-- | macros/src/codegen/shared_resources_struct.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/macros/src/codegen/shared_resources_struct.rs b/macros/src/codegen/shared_resources_struct.rs index 9983aa4c..61226517 100644 --- a/macros/src/codegen/shared_resources_struct.rs +++ b/macros/src/codegen/shared_resources_struct.rs @@ -33,6 +33,7 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2, }; let ty = &res.ty; let mangled_name = util::static_shared_resource_ident(&name); + let shared_name = util::need_to_lock_ident(name); if !res.properties.lock_free { if access.is_shared() { @@ -48,12 +49,12 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2, fields.push(quote!( #(#cfgs)* - pub #name: shared_resources::#name<'a> + pub #name: shared_resources::#shared_name<'a> )); values.push(quote!( #(#cfgs)* - #name: shared_resources::#name::new(priority) + #name: shared_resources::#shared_name::new(priority) )); |