about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-07-12 15:53:04 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-07-12 15:53:04 -0700
commitaf556238ebe72d58adbcf339bd2fa0aef4e3caf9 (patch)
treed24c987a814eb8fcf6d623dae846852b4099c3ce /src/test
parentadcae006d250e40d7369d9bee3ecd05915acb22d (diff)
downloadrust-af556238ebe72d58adbcf339bd2fa0aef4e3caf9.tar.gz
rust-af556238ebe72d58adbcf339bd2fa0aef4e3caf9.zip
syntax: Allow semi tokens after macro ty/path
This commit expands the follow set of the `ty` and `path` macro fragments to
include the semicolon token as well. A semicolon is already allowed after these
tokens, so it's currently a little too restrictive to not have a semicolon
allowed. For example:

    extern {
        fn foo() -> i32; // semicolon after type
    }

    fn main() {
        struct Foo;

        Foo; // semicolon after path
    }
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/semi-after-macro-ty.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/semi-after-macro-ty.rs b/src/test/run-pass/semi-after-macro-ty.rs
new file mode 100644
index 00000000000..2b4304252a1
--- /dev/null
+++ b/src/test/run-pass/semi-after-macro-ty.rs
@@ -0,0 +1,17 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+macro_rules! foo {
+    ($t:ty; $p:path;) => {}
+}
+
+fn main() {
+    foo!(i32; i32;);
+}