diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2019-02-23 22:38:10 +0100 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2019-02-26 23:22:34 +0100 |
| commit | 2fd6ae69d1c79635896b643b1094b3805d1ec6c2 (patch) | |
| tree | 20cf7c45228271ad474ff39d84f78a048bbdd671 | |
| parent | e167af01f02bfa0fbec8f51c54f1aee58ce1875d (diff) | |
`binds` can only appear once in the argument list
| -rw-r--r-- | macros/src/syntax.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/macros/src/syntax.rs b/macros/src/syntax.rs index ee03b2f..23981d9 100644 --- a/macros/src/syntax.rs +++ b/macros/src/syntax.rs @@ -973,6 +973,13 @@ fn parse_args( let ident_s = ident.to_string(); match &*ident_s { "binds" if accepts_binds => { + if binds.is_some() { + return Err(parse::Error::new( + ident.span(), + "argument appears more than once", + )); + } + // #ident let ident = content.parse()?; |
