Skip to content

Fixes #8881 -- condition! imports parent's pub identifiers #8963

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

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 8 additions & 8 deletions src/librustpkg/conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ pub use std::path::Path;
pub use package_id::PkgId;

condition! {
bad_path: (super::Path, ~str) -> super::Path;
bad_path: (Path, ~str) -> Path;
}

condition! {
nonexistent_package: (super::PkgId, ~str) -> super::Path;
nonexistent_package: (PkgId, ~str) -> Path;
}

condition! {
copy_failed: (super::Path, super::Path) -> ();
copy_failed: (Path, Path) -> ();
}

condition! {
missing_pkg_files: (super::PkgId) -> ();
missing_pkg_files: (PkgId) -> ();
}

condition! {
bad_pkg_id: (super::Path, ~str) -> super::PkgId;
bad_pkg_id: (Path, ~str) -> PkgId;
}

condition! {
no_rust_path: (~str) -> super::Path;
no_rust_path: (~str) -> Path;
}

condition! {
not_a_workspace: (~str) -> super::Path;
not_a_workspace: (~str) -> Path;
}

condition! {
failed_to_create_temp_dir: (~str) -> super::Path;
failed_to_create_temp_dir: (~str) -> Path;
}
2 changes: 2 additions & 0 deletions src/libstd/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub enum NullByteResolution {

condition! {
// this should be &[u8] but there's a lifetime issue
// NOTE: this super::NullByteResolution should be NullByteResolution
// Change this next time the snapshot it updated.
null_byte: (~[u8]) -> super::NullByteResolution;
}

Expand Down
4 changes: 4 additions & 0 deletions src/libstd/rt/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,17 @@ impl ToStr for IoErrorKind {
// Raised by `I/O` operations on error.
condition! {
// FIXME (#6009): uncomment `pub` after expansion support lands.
// NOTE: this super::IoError should be IoError
// Change this next time the snapshot it updated.
/*pub*/ io_error: super::IoError -> ();
}

// XXX: Can't put doc comments on macros
// Raised by `read` on error
condition! {
// FIXME (#6009): uncomment `pub` after expansion support lands.
// NOTE: this super::IoError should be IoError
// Change this next time the snapshot it updated.
/*pub*/ read_error: super::IoError -> ();
}

Expand Down
8 changes: 8 additions & 0 deletions src/libsyntax/ext/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,11 @@ pub fn std_macros() -> @str {
{ pub $c:ident: $input:ty -> $out:ty; } => {

pub mod $c {
#[allow(unused_imports)];
#[allow(non_uppercase_statics)];

use super::*;

static key: ::std::local_data::Key<
@::std::condition::Handler<$input, $out>> =
&::std::local_data::Key;
Expand All @@ -907,7 +911,11 @@ pub fn std_macros() -> @str {

// FIXME (#6009): remove mod's `pub` below once variant above lands.
pub mod $c {
#[allow(unused_imports)];
#[allow(non_uppercase_statics)];

use super::*;

static key: ::std::local_data::Key<
@::std::condition::Handler<$input, $out>> =
&::std::local_data::Key;
Expand Down
3 changes: 1 addition & 2 deletions src/test/auxiliary/xc_conditions_4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub enum Color {
}

condition! {
pub oops: (int,float,~str) -> ::Color;
pub oops: (int,float,~str) -> Color;
}

pub trait Thunk<T> {
Expand All @@ -26,4 +26,3 @@ pub trait Thunk<T> {
pub fn callback<T,TH:Thunk<T>>(t:TH) -> T {
t.call()
}