diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2013-05-06 19:05:36 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2013-05-06 19:05:36 +0200 |
| commit | 1cbf0a84dc9d12d4c15379537a51ad75fcb1bdcf (patch) | |
| tree | 349872cf07ad006fb56754af8a77557d2743c4d3 /src | |
| parent | 6e6a4be19d8e6a2cedc66be6cc602db8a1e71acd (diff) | |
| download | rust-1cbf0a84dc9d12d4c15379537a51ad75fcb1bdcf.tar.gz rust-1cbf0a84dc9d12d4c15379537a51ad75fcb1bdcf.zip | |
Step one for 'proper' pub condition: support pub keyword in form.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/rt/io/mod.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/libcore/rt/io/mod.rs b/src/libcore/rt/io/mod.rs index 97b3ee3e30e..fea32bc5b75 100644 --- a/src/libcore/rt/io/mod.rs +++ b/src/libcore/rt/io/mod.rs @@ -337,7 +337,8 @@ pub enum IoErrorKind { // XXX: Can't put doc comments on macros // Raised by `I/O` operations on error. condition! { - io_error: super::IoError -> (); + // FIXME (#6009): uncomment `pub` after expansion support lands. + /*pub*/ io_error: super::IoError -> (); } pub trait Reader { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 02721a02fbd..b1267ee7578 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -485,8 +485,23 @@ pub fn core_macros() -> ~str { macro_rules! condition ( + { pub $c:ident: $in:ty -> $out:ty; } => { + + pub mod $c { + fn key(_x: @::core::condition::Handler<$in,$out>) { } + + pub static cond : + ::core::condition::Condition<'static,$in,$out> = + ::core::condition::Condition { + name: stringify!($c), + key: key + }; + } + }; + { $c:ident: $in:ty -> $out:ty; } => { + // FIXME (#6009): remove mod's `pub` below once variant above lands. pub mod $c { fn key(_x: @::core::condition::Handler<$in,$out>) { } |
