diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2020-12-10 20:33:13 +0100 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2020-12-10 20:33:13 +0100 |
| commit | 97a48983d2859740983cbf342e1287182426ed44 (patch) | |
| tree | 77c9fb55d1ad9cd3fa2e9343397c56ba47928684 /macros/src/codegen/assertions.rs | |
| parent | b23bb1192c8dc1f2e8f157db2147b1737abc1033 (diff) | |
More work
Diffstat (limited to 'macros/src/codegen/assertions.rs')
| -rw-r--r-- | macros/src/codegen/assertions.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/macros/src/codegen/assertions.rs b/macros/src/codegen/assertions.rs index 4d9aae4..a8a4491 100644 --- a/macros/src/codegen/assertions.rs +++ b/macros/src/codegen/assertions.rs @@ -2,9 +2,10 @@ use proc_macro2::TokenStream as TokenStream2; use quote::quote; use crate::analyze::Analysis; +use rtic_syntax::ast::App; /// Generates compile-time assertions that check that types implement the `Send` / `Sync` traits -pub fn codegen(analysis: &Analysis) -> Vec<TokenStream2> { +pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> { let mut stmts = vec![]; for ty in &analysis.send_types { @@ -15,5 +16,10 @@ pub fn codegen(analysis: &Analysis) -> Vec<TokenStream2> { stmts.push(quote!(rtic::export::assert_sync::<#ty>();)); } + for (_, monotonic) in &app.monotonics { + let ty = &monotonic.ty; + stmts.push(quote!(rtic::export::assert_monotonic::<#ty>();)); + } + stmts } |
