Skip to content

Step one for 'proper' pub condition: support pub keyword in form. #6271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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