Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge #67
Browse files Browse the repository at this point in the history
67: Update dependencies of riscv-rt-macros r=almindor a=Disasm



Co-authored-by: Vadim Kaushan <[email protected]>
  • Loading branch information
bors[bot] and Disasm authored Aug 2, 2020
2 parents 8e78dd5 + dfc0709 commit 47ece5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
9 changes: 5 additions & 4 deletions macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ version = "0.1.6"
proc-macro = true

[dependencies]
quote = "0.6.8"
proc-macro2 = "0.4.20"
quote = "1.0"
proc-macro2 = "1.0"

[dependencies.syn]
version = "1.0"
features = ["extra-traits", "full"]
version = "0.15.13"

[dependencies.rand]
version = "0.5.5"
version = "0.7.3"
default-features = false
features = ["small_rng"]
36 changes: 19 additions & 17 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
let f = parse_macro_input!(input as ItemFn);

// check the function signature
let valid_signature = f.constness.is_none()
let valid_signature = f.sig.constness.is_none()
&& f.sig.asyncness.is_none()
&& f.vis == Visibility::Inherited
&& f.abi.is_none()
&& f.decl.inputs.is_empty()
&& f.decl.generics.params.is_empty()
&& f.decl.generics.where_clause.is_none()
&& f.decl.variadic.is_none()
&& match f.decl.output {
&& f.sig.abi.is_none()
&& f.sig.inputs.is_empty()
&& f.sig.generics.params.is_empty()
&& f.sig.generics.where_clause.is_none()
&& f.sig.variadic.is_none()
&& match f.sig.output {
ReturnType::Default => false,
ReturnType::Type(_, ref ty) => match **ty {
Type::Never(_) => true,
Expand All @@ -90,7 +91,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {

// XXX should we blacklist other attributes?
let attrs = f.attrs;
let unsafety = f.unsafety;
let unsafety = f.sig.unsafety;
let hash = random_ident();
let stmts = f.block.stmts;

Expand Down Expand Up @@ -133,15 +134,16 @@ pub fn pre_init(args: TokenStream, input: TokenStream) -> TokenStream {
let f = parse_macro_input!(input as ItemFn);

// check the function signature
let valid_signature = f.constness.is_none()
let valid_signature = f.sig.constness.is_none()
&& f.sig.asyncness.is_none()
&& f.vis == Visibility::Inherited
&& f.unsafety.is_some()
&& f.abi.is_none()
&& f.decl.inputs.is_empty()
&& f.decl.generics.params.is_empty()
&& f.decl.generics.where_clause.is_none()
&& f.decl.variadic.is_none()
&& match f.decl.output {
&& f.sig.unsafety.is_some()
&& f.sig.abi.is_none()
&& f.sig.inputs.is_empty()
&& f.sig.generics.params.is_empty()
&& f.sig.generics.where_clause.is_none()
&& f.sig.variadic.is_none()
&& match f.sig.output {
ReturnType::Default => true,
ReturnType::Type(_, ref ty) => match **ty {
Type::Tuple(ref tuple) => tuple.elems.is_empty(),
Expand All @@ -166,7 +168,7 @@ pub fn pre_init(args: TokenStream, input: TokenStream) -> TokenStream {

// XXX should we blacklist other attributes?
let attrs = f.attrs;
let ident = f.ident;
let ident = f.sig.ident;
let block = f.block;

quote!(
Expand Down

0 comments on commit 47ece5f

Please sign in to comment.