diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-10-02 14:43:15 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-10-02 14:43:15 +1000 |
| commit | 8284df9e7c3b26897d65935eaa7acee1a956a450 (patch) | |
| tree | 394c978dc2b603cf2b28879b67ce405f528c1e17 /src/libsyntax/ext/deriving/cmp | |
| parent | bbbafc4e466e8026d30b9c47d1f104fd44815bef (diff) | |
syntax: indicate an error when a macro ignores trailing tokens.
That is, only a single expression or item gets parsed, so if there are
any extra tokens (e.g. the start of another item/expression) the user
should be told, rather than silently dropping them.
An example:
macro_rules! foo {
() => {
println("hi");
println("bye);
}
}
would expand to just `println("hi")`, which is almost certainly not
what the programmer wanted.
Fixes #8012.
Diffstat (limited to 'src/libsyntax/ext/deriving/cmp')
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/eq.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/ext/deriving/cmp/eq.rs b/src/libsyntax/ext/deriving/cmp/eq.rs index d147875d5e1..468e3e5e7f2 100644 --- a/src/libsyntax/ext/deriving/cmp/eq.rs +++ b/src/libsyntax/ext/deriving/cmp/eq.rs @@ -39,7 +39,7 @@ pub fn expand_deriving_eq(cx: @ExtCtxt, ret_ty: Literal(Path::new(~["bool"])), const_nonmatching: true, combine_substructure: $f - }, + } } ); |
