From 2fd6ae69d1c79635896b643b1094b3805d1ec6c2 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 23 Feb 2019 22:38:10 +0100 Subject: [PATCH] `binds` can only appear once in the argument list --- macros/src/syntax.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/macros/src/syntax.rs b/macros/src/syntax.rs index ee03b2f5a3..23981d98d0 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()?;