librustc: Fix cross-crate reexports. rs=blocking-servo
This commit is contained in:
parent
cb355bf7ad
commit
64305174c9
@ -16,15 +16,15 @@
|
||||
|
||||
use m_float = f64;
|
||||
|
||||
use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
|
||||
use f64::logarithm;
|
||||
use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
|
||||
use f64::{erf, erfc, exp, expm1, exp2, abs_sub};
|
||||
use f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp};
|
||||
use f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
|
||||
use f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
|
||||
use f64::signbit;
|
||||
use f64::{j0, j1, jn, y0, y1, yn};
|
||||
pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
|
||||
pub use f64::logarithm;
|
||||
pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
|
||||
pub use f64::{erf, erfc, exp, expm1, exp2, abs_sub};
|
||||
pub use f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp};
|
||||
pub use f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
|
||||
pub use f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
|
||||
pub use f64::signbit;
|
||||
pub use f64::{j0, j1, jn, y0, y1, yn};
|
||||
use cmp::{Eq, Ord};
|
||||
use num::from_int;
|
||||
|
||||
|
@ -1687,7 +1687,7 @@ impl Resolver {
|
||||
// avoid creating cycles in the
|
||||
// module graph.
|
||||
|
||||
let resolution = @ImportResolution(Private, dummy_sp());
|
||||
let resolution = @ImportResolution(Public, dummy_sp());
|
||||
resolution.outstanding_references = 0;
|
||||
|
||||
match existing_module.parent_link {
|
||||
@ -3199,23 +3199,26 @@ impl Resolver {
|
||||
fn add_exports_of_namebindings(exports2: &mut ~[Export2],
|
||||
ident: ident,
|
||||
namebindings: @NameBindings,
|
||||
ns: Namespace,
|
||||
reexport: bool) {
|
||||
for [ TypeNS, ValueNS ].each |ns| {
|
||||
match (namebindings.def_for_namespace(*ns),
|
||||
namebindings.privacy_for_namespace(*ns)) {
|
||||
(Some(d), Some(Public)) => {
|
||||
debug!("(computing exports) YES: %s '%s' \
|
||||
=> %?",
|
||||
if reexport { ~"reexport" } else { ~"export"},
|
||||
self.session.str_of(ident),
|
||||
def_id_of_def(d));
|
||||
exports2.push(Export2 {
|
||||
reexport: reexport,
|
||||
name: self.session.str_of(ident),
|
||||
def_id: def_id_of_def(d)
|
||||
});
|
||||
}
|
||||
_ => ()
|
||||
match (namebindings.def_for_namespace(ns),
|
||||
namebindings.privacy_for_namespace(ns)) {
|
||||
(Some(d), Some(Public)) => {
|
||||
debug!("(computing exports) YES: %s '%s' => %?",
|
||||
if reexport { ~"reexport" } else { ~"export"},
|
||||
self.session.str_of(ident),
|
||||
def_id_of_def(d));
|
||||
exports2.push(Export2 {
|
||||
reexport: reexport,
|
||||
name: self.session.str_of(ident),
|
||||
def_id: def_id_of_def(d)
|
||||
});
|
||||
}
|
||||
(Some(_), Some(privacy)) => {
|
||||
debug!("(computing reexports) NO: privacy %?", privacy);
|
||||
}
|
||||
(d_opt, p_opt) => {
|
||||
debug!("(computing reexports) NO: %?, %?", d_opt, p_opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3227,7 +3230,13 @@ impl Resolver {
|
||||
self.add_exports_of_namebindings(exports2,
|
||||
*ident,
|
||||
*namebindings,
|
||||
false)
|
||||
TypeNS,
|
||||
false);
|
||||
self.add_exports_of_namebindings(exports2,
|
||||
*ident,
|
||||
*namebindings,
|
||||
ValueNS,
|
||||
false);
|
||||
}
|
||||
|
||||
for module_.import_resolutions.each_ref |ident, importresolution| {
|
||||
@ -3244,6 +3253,7 @@ impl Resolver {
|
||||
self.add_exports_of_namebindings(exports2,
|
||||
*ident,
|
||||
target.bindings,
|
||||
*ns,
|
||||
true)
|
||||
}
|
||||
_ => ()
|
||||
|
11
src/test/auxiliary/pub_use_mods_xcrate.rs
Normal file
11
src/test/auxiliary/pub_use_mods_xcrate.rs
Normal file
@ -0,0 +1,11 @@
|
||||
pub mod a {
|
||||
pub mod b {
|
||||
pub mod c {
|
||||
fn f(){}
|
||||
fn g(){}
|
||||
}
|
||||
}
|
||||
|
||||
pub use b::c;
|
||||
}
|
||||
|
8
src/test/run-pass/pub_use_mods_xcrate_exe.rs
Normal file
8
src/test/run-pass/pub_use_mods_xcrate_exe.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// xfail-fast
|
||||
// aux-build:pub_use_mods_xcrate.rs
|
||||
|
||||
extern mod pub_use_mods_xcrate;
|
||||
use pub_use_mods_xcrate::a::c;
|
||||
|
||||
fn main(){}
|
||||
|
Loading…
x
Reference in New Issue
Block a user