about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-03-26 16:14:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-03-28 16:37:45 -0700
commitc6bbb95ce26e75214003190b643f5098e39b6428 (patch)
treeddeebe963d1c6ded3112ddbb6625ed02eb28e884 /src/libstd/io
parentcbfc0a5e33eb3d97a2995d120536b8dadc0cc0a2 (diff)
downloadrust-c6bbb95ce26e75214003190b643f5098e39b6428.tar.gz
rust-c6bbb95ce26e75214003190b643f5098e39b6428.zip
syntax: Accept meta matchers in macros
This removes the `attr` matcher and adds a `meta` matcher. The previous `attr`
matcher is now ambiguous because it doesn't disambiguate whether it means inner
attribute or outer attribute.

The new behavior can still be achieved by taking an argument of the form
`#[$foo:meta]` (the brackets are part of the macro pattern).

Closes #13067
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/test.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/io/test.rs b/src/libstd/io/test.rs
index 9eeaf4635a4..6e987869238 100644
--- a/src/libstd/io/test.rs
+++ b/src/libstd/io/test.rs
@@ -19,7 +19,7 @@ use std::io::net::ip::*;
 use sync::atomics::{AtomicUint, INIT_ATOMIC_UINT, Relaxed};
 
 macro_rules! iotest (
-    { fn $name:ident() $b:block $($a:attr)* } => (
+    { fn $name:ident() $b:block $(#[$a:meta])* } => (
         mod $name {
             #[allow(unused_imports)];
 
@@ -43,8 +43,8 @@ macro_rules! iotest (
 
             fn f() $b
 
-            $($a)* #[test] fn green() { f() }
-            $($a)* #[test] fn native() {
+            $(#[$a])* #[test] fn green() { f() }
+            $(#[$a])* #[test] fn native() {
                 use native;
                 let (tx, rx) = channel();
                 native::task::spawn(proc() { tx.send(f()) });