diff options
author | 2020-10-22 16:48:56 +0000 | |
---|---|---|
committer | 2020-10-22 16:48:56 +0000 | |
commit | 9fb5a223cb8adb01381650b66eab28ea5abc98ed (patch) | |
tree | 357983fd15ba52ea221f20b5cb14b96783d07d51 /macros/src/codegen/util.rs | |
parent | 6de4f1a797c81aec6c24f47872e5d3968344684c (diff) | |
parent | 17e976ab495234f9f53f56e6693850af077cf701 (diff) | |
download | rtic-9fb5a223cb8adb01381650b66eab28ea5abc98ed.tar.gz rtic-9fb5a223cb8adb01381650b66eab28ea5abc98ed.tar.zst rtic-9fb5a223cb8adb01381650b66eab28ea5abc98ed.zip |
Merge #396
396: Fix namespaces r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r-- | macros/src/codegen/util.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index bc8bfb8d..0625e49d 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -53,7 +53,7 @@ pub fn impl_mutex( type T = #ty; #[inline(always)] - fn lock<R>(&mut self, f: impl FnOnce(&mut #ty) -> R) -> R { + fn lock<RTIC_INTERNAL_R>(&mut self, f: impl FnOnce(&mut #ty) -> RTIC_INTERNAL_R) -> RTIC_INTERNAL_R { /// Priority ceiling const CEILING: u8 = #ceiling; @@ -111,6 +111,14 @@ pub fn late_resources_ident(init: &Ident) -> Ident { ) } +/// Mangle an ident +pub fn mangle_ident(ident: &Ident) -> Ident { + Ident::new( + &format!("__rtic_internal_{}", ident.to_string()), + Span::call_site(), + ) +} + fn link_section_index() -> usize { static INDEX: AtomicUsize = AtomicUsize::new(0); |