diff options
author | 2018-08-31 22:13:06 +0200 | |
---|---|---|
committer | 2018-08-31 22:13:06 +0200 | |
commit | 48c1af844ef99772446850eb0288bef61d663afb (patch) | |
tree | 5fdbf30f1d5ff8a5e7564f5f159b0ead58b1bcf5 /cortex-m-rt/macros/src/lib.rs | |
parent | 8773ca1f5a03654de29e6716f1dfe6cc704bdec2 (diff) | |
download | cortex-m-48c1af844ef99772446850eb0288bef61d663afb.tar.gz cortex-m-48c1af844ef99772446850eb0288bef61d663afb.tar.zst cortex-m-48c1af844ef99772446850eb0288bef61d663afb.zip |
remove dead code
Diffstat (limited to 'cortex-m-rt/macros/src/lib.rs')
-rw-r--r-- | cortex-m-rt/macros/src/lib.rs | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/cortex-m-rt/macros/src/lib.rs b/cortex-m-rt/macros/src/lib.rs index 5cba510..82457f1 100644 --- a/cortex-m-rt/macros/src/lib.rs +++ b/cortex-m-rt/macros/src/lib.rs @@ -1,19 +1,15 @@ -// #![deny(warnings)] -#![allow(warnings)] +#![deny(warnings)] extern crate proc_macro; extern crate rand; #[macro_use] extern crate quote; -#[macro_use] -extern crate syn; extern crate proc_macro2; +extern crate syn; use proc_macro2::Span; use rand::Rng; -use syn::synom::Synom; -use syn::token::{Colon, Comma, Eq, Static}; -use syn::{Expr, FnArg, Ident, Item, ItemFn, ReturnType, Stmt, Type, Visibility}; +use syn::{FnArg, Ident, Item, ItemFn, ReturnType, Stmt, Type, Visibility}; use proc_macro::TokenStream; @@ -82,44 +78,6 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream { ).into() } -struct ExceptionArgs { - first: Ident, - second: Option<State>, -} - -impl Synom for ExceptionArgs { - named!(parse -> Self, do_parse!( - first: syn!(Ident) >> - second: option!(syn!(State)) >> ( - ExceptionArgs { first, second } - ) - )); -} - -struct State { - _comma: Comma, - _static: Static, - ident: Ident, - _colon: Colon, - ty: Type, - _eq: Eq, - expr: Expr, -} - -impl Synom for State { - named!(parse -> Self, do_parse!( - _comma: punct!(,) >> - _static: syn!(Static) >> - ident: syn!(Ident) >> - _colon: punct!(:) >> - ty: syn!(Type) >> - _eq: punct!(=) >> - expr: syn!(Expr) >> ( - State { _comma, _static, ident, _colon, ty, _eq, expr } - ) - )); -} - /// Attribute to declare an exception handler /// /// **NOTE** This macro must be invoked from an accessible module, ideally from the root of the |