Skip to content

Commit 1cbf0a8

Browse files
committed
Step one for 'proper' pub condition: support pub keyword in form.
1 parent 6e6a4be commit 1cbf0a8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/libcore/rt/io/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ pub enum IoErrorKind {
337337
// XXX: Can't put doc comments on macros
338338
// Raised by `I/O` operations on error.
339339
condition! {
340-
io_error: super::IoError -> ();
340+
// FIXME (#6009): uncomment `pub` after expansion support lands.
341+
/*pub*/ io_error: super::IoError -> ();
341342
}
342343

343344
pub trait Reader {

src/libsyntax/ext/expand.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,23 @@ pub fn core_macros() -> ~str {
485485

486486
macro_rules! condition (
487487

488+
{ pub $c:ident: $in:ty -> $out:ty; } => {
489+
490+
pub mod $c {
491+
fn key(_x: @::core::condition::Handler<$in,$out>) { }
492+
493+
pub static cond :
494+
::core::condition::Condition<'static,$in,$out> =
495+
::core::condition::Condition {
496+
name: stringify!($c),
497+
key: key
498+
};
499+
}
500+
};
501+
488502
{ $c:ident: $in:ty -> $out:ty; } => {
489503

504+
// FIXME (#6009): remove mod's `pub` below once variant above lands.
490505
pub mod $c {
491506
fn key(_x: @::core::condition::Handler<$in,$out>) { }
492507

0 commit comments

Comments
 (0)