Skip to content

Commit

Permalink
Step one for 'proper' pub condition: support pub keyword in form.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed May 6, 2013
1 parent 6e6a4be commit 1cbf0a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libcore/rt/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 15 additions & 0 deletions src/libsyntax/ext/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>) { }

Expand Down

5 comments on commit 1cbf0a8

@bors
Copy link
Contributor

@bors bors commented on 1cbf0a8 May 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from graydon
at pnkfelix@1cbf0a8

@bors
Copy link
Contributor

@bors bors commented on 1cbf0a8 May 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging pnkfelix/rust/issue6009-condition-pub-priv-variants = 1cbf0a8 into auto

@bors
Copy link
Contributor

@bors bors commented on 1cbf0a8 May 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnkfelix/rust/issue6009-condition-pub-priv-variants = 1cbf0a8 merged ok, testing candidate = 154f3b0

@bors
Copy link
Contributor

@bors bors commented on 1cbf0a8 May 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1cbf0a8 May 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 154f3b0

Please sign in to comment.