diff options
Diffstat (limited to 'tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs')
-rw-r--r-- | tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs index fdf16442d..05c65fe86 100644 --- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs +++ b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs @@ -5,24 +5,17 @@ // `round` = Left hand side round brackets macro_rules! curly__no_rhs_dollar__round { - ( $( $i:ident ),* ) => { ${ count(i) } }; + ( $( $i:ident ),* ) => { ${ count($i) } }; } macro_rules! curly__no_rhs_dollar__no_round { - ( $i:ident ) => { ${ count(i) } }; + ( $i:ident ) => { ${ count($i) } }; //~^ ERROR `count` can not be placed inside the inner-most repetition } -macro_rules! curly__rhs_dollar__round { - ( $( $i:ident ),* ) => { ${ count($i) } }; - //~^ ERROR expected identifier, found `$` - //~| ERROR expected expression, found `$` -} - macro_rules! curly__rhs_dollar__no_round { ( $i:ident ) => { ${ count($i) } }; - //~^ ERROR expected identifier, found `$` - //~| ERROR expected expression, found `$` + //~^ ERROR `count` can not be placed inside the inner-most repetition } macro_rules! no_curly__no_rhs_dollar__round { @@ -60,16 +53,16 @@ macro_rules! extra_garbage_after_metavar { ${count() a b c} //~^ ERROR unexpected token: a //~| ERROR expected expression, found `$` - ${count(i a b c)} + ${count($i a b c)} //~^ ERROR unexpected token: a - ${count(i, 1 a b c)} + ${count($i, 1 a b c)} //~^ ERROR unexpected token: a - ${count(i) a b c} + ${count($i) a b c} //~^ ERROR unexpected token: a - ${ignore(i) a b c} + ${ignore($i) a b c} //~^ ERROR unexpected token: a - ${ignore(i a b c)} + ${ignore($i a b c)} //~^ ERROR unexpected token: a ${index() a b c} @@ -100,8 +93,8 @@ macro_rules! metavar_in_the_lhs { macro_rules! metavar_token_without_ident { ( $( $i:ident ),* ) => { ${ ignore() } }; - //~^ ERROR expected identifier - //~| ERROR expected expression, found `$` + //~^ ERROR meta-variable expressions must be referenced using a dollar sign + //~| ERROR expected expression } macro_rules! metavar_with_literal_suffix { @@ -125,14 +118,16 @@ macro_rules! open_brackets_without_tokens { macro_rules! unknown_count_ident { ( $( $i:ident )* ) => { ${count(foo)} - //~^ ERROR variable `foo` is not recognized in meta-variable expression + //~^ ERROR meta-variable expressions must be referenced using a dollar sign + //~| ERROR expected expression }; } macro_rules! unknown_ignore_ident { ( $( $i:ident )* ) => { ${ignore(bar)} - //~^ ERROR variable `bar` is not recognized in meta-variable expression + //~^ ERROR meta-variable expressions must be referenced using a dollar sign + //~| ERROR expected expression }; } @@ -145,7 +140,6 @@ macro_rules! unknown_metavar { fn main() { curly__no_rhs_dollar__round!(a, b, c); curly__no_rhs_dollar__no_round!(a); - curly__rhs_dollar__round!(a, b, c); curly__rhs_dollar__no_round!(a); no_curly__no_rhs_dollar__round!(a, b, c); no_curly__no_rhs_dollar__no_round!(a); |