diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-09-21 18:10:45 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-09-21 18:11:43 -0700 |
| commit | dffe188991325b4e803fdd0da7c1563ce0fa27f4 (patch) | |
| tree | e8f65929b804a38550dc9fdcf24021e6a7920304 | |
| parent | 60443d48881bfbc7a305e807390e74b327f100b8 (diff) | |
| download | rust-dffe188991325b4e803fdd0da7c1563ce0fa27f4.tar.gz rust-dffe188991325b4e803fdd0da7c1563ce0fa27f4.zip | |
Install new pub/priv/export rules as defaults, old rules accessible under #[legacy_exports];
277 files changed, 1174 insertions, 120 deletions
diff --git a/doc/rust.md b/doc/rust.md index 43e81860776..fa9e160f73d 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -875,7 +875,8 @@ declaration replaces the default export with the export specified. An example of an export: ~~~~~~~~ -mod foo { +pub mod foo { + #[legacy_exports]; export primary; fn primary() { diff --git a/doc/tutorial-ffi.md b/doc/tutorial-ffi.md index c51d12aff8d..42c5908b049 100644 --- a/doc/tutorial-ffi.md +++ b/doc/tutorial-ffi.md @@ -123,7 +123,9 @@ null pointers. The `sha1` function is the most obscure part of the program. ~~~~ -# mod crypto { fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } } +# pub mod crypto { +# pub fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } +# } # fn as_hex(data: ~[u8]) -> ~str { ~"hi" } fn sha1(data: ~str) -> ~str { unsafe { @@ -166,7 +168,9 @@ Rust's safety mechanisms. Let's look at our `sha1` function again. ~~~~ -# mod crypto { fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } } +# pub mod crypto { +# pub fn SHA1(src: *u8, sz: uint, out: *u8) -> *u8 { out } +# } # fn as_hex(data: ~[u8]) -> ~str { ~"hi" } # fn x(data: ~str) -> ~str { # unsafe { diff --git a/doc/tutorial.md b/doc/tutorial.md index 051d9e22893..6e89f661cf3 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1820,6 +1820,7 @@ explicitly import it, you must refer to it by its long name, `farm::chicken`. ~~~~ +#[legacy_exports] mod farm { fn chicken() -> ~str { ~"cluck cluck" } fn cow() -> ~str { ~"mooo" } @@ -2004,6 +2005,7 @@ Rust uses three different namespaces: one for modules, one for types, and one for values. This means that this code is valid: ~~~~ +#[legacy_exports] mod buffalo { type buffalo = int; fn buffalo<buffalo>(+buffalo: buffalo) -> buffalo { buffalo } diff --git a/src/cargo/cargo.rc b/src/cargo/cargo.rc index 1d65373206d..79803ffa529 100644 --- a/src/cargo/cargo.rc +++ b/src/cargo/cargo.rc @@ -17,6 +17,7 @@ #[crate_type = "bin"]; #[no_core]; +#[legacy_exports]; #[allow(vecs_implicitly_copyable, non_implicitly_copyable_typarams)]; @@ -29,4 +30,5 @@ extern mod syntax(vers = "0.4"); use core::*; +#[legacy_exports] mod pgp; diff --git a/src/cargo/cargo.rs b/src/cargo/cargo.rs index e648e6120ce..d17ebeda6a7 100644 --- a/src/cargo/cargo.rs +++ b/src/cargo/cargo.rs @@ -1,5 +1,7 @@ // cargo.rs - Rust package manager +#[legacy_exports]; + use syntax::{ast, codemap, parse, visit, attr}; use syntax::diagnostic::span_handler; use codemap::span; diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc index 11479f7ba1c..ce11245dba5 100644 --- a/src/compiletest/compiletest.rc +++ b/src/compiletest/compiletest.rc @@ -1,6 +1,7 @@ #[crate_type = "bin"]; #[no_core]; +#[legacy_exports]; #[allow(vecs_implicitly_copyable)]; #[allow(non_camel_case_types)]; @@ -10,11 +11,17 @@ extern mod std(vers = "0.4"); use core::*; +#[legacy_exports] mod procsrv; +#[legacy_exports] mod util; +#[legacy_exports] mod header; +#[legacy_exports] mod runtest; +#[legacy_exports] mod common; +#[legacy_exports] mod errors; // Local Variables: diff --git a/src/fuzzer/fuzzer.rc b/src/fuzzer/fuzzer.rc index 82c18f6976f..073335fbc72 100644 --- a/src/fuzzer/fuzzer.rc +++ b/src/fuzzer/fuzzer.rc @@ -5,6 +5,7 @@ #[no_core]; #[legacy_modes]; +#[legacy_exports]; #[allow(vecs_implicitly_copyable)]; #[allow(non_camel_case_types)]; diff --git a/src/fuzzer/fuzzer.rs b/src/fuzzer/fuzzer.rs index cb7e16df6dc..987e79a2b80 100644 --- a/src/fuzzer/fuzzer.rs +++ b/src/fuzzer/fuzzer.rs @@ -1,3 +1,5 @@ +#[legacy_exports]; + use io::WriterUtil; use syntax::{ast, ast_util, fold, visit, codemap}; diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs index bc0f4c62af7..7864983bde2 100644 --- a/src/libcore/at_vec.rs +++ b/src/libcore/at_vec.rs @@ -15,6 +15,7 @@ export traits; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn vec_reserve_shared_actual(++t: *sys::TypeDesc, ++v: **vec::raw::VecRepr, ++n: libc::size_t); @@ -22,6 +23,7 @@ extern mod rustrt { #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn move_val_init<T>(&dst: T, -src: T); } @@ -135,6 +137,7 @@ pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] { #[cfg(notest)] mod traits { + #[legacy_exports]; #[cfg(stage0)] impl<T: Copy> @[T]: Add<&[const T],@[T]> { #[inline(always)] @@ -153,9 +156,11 @@ mod traits { } #[cfg(test)] -mod traits {} +mod traits { + #[legacy_exports];} mod raw { + #[legacy_exports]; type VecRepr = vec::raw::VecRepr; type SliceRepr = vec::raw::SliceRepr; diff --git a/src/libcore/box.rs b/src/libcore/box.rs index fe1e10af715..f7db82864e6 100644 --- a/src/libcore/box.rs +++ b/src/libcore/box.rs @@ -10,6 +10,7 @@ use intrinsic::TyDesc; export ptr_eq, raw; mod raw { + #[legacy_exports]; struct BoxHeaderRepr { ref_count: uint, diff --git a/src/libcore/cast.rs b/src/libcore/cast.rs index 1f811b0fc05..93467404868 100644 --- a/src/libcore/cast.rs +++ b/src/libcore/cast.rs @@ -8,6 +8,7 @@ export copy_lifetime, copy_lifetime_vec; #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn forget<T>(-x: T); fn reinterpret_cast<T, U>(e: T) -> U; } @@ -97,6 +98,7 @@ unsafe fn copy_lifetime_vec<S,T>(_ptr: &a/[S], ptr: &T) -> &a/T { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_reinterpret_cast() { diff --git a/src/libcore/cleanup.rs b/src/libcore/cleanup.rs index 3435e933ea2..64276df6dfe 100644 --- a/src/libcore/cleanup.rs +++ b/src/libcore/cleanup.rs @@ -121,6 +121,7 @@ pub unsafe fn annihilate() { /// Bindings to the runtime extern mod rustrt { + #[legacy_exports]; #[rust_stack] /*priv*/ fn rust_get_task() -> *c_void; } diff --git a/src/libcore/cmath.rs b/src/libcore/cmath.rs index 881dd959e8a..c04d4915ba2 100644 --- a/src/libcore/cmath.rs +++ b/src/libcore/cmath.rs @@ -23,6 +23,7 @@ use libc::c_double; #[link_name = "m"] #[abi = "cdecl"] extern mod c_double { + #[legacy_exports]; // Alpabetically sorted by link_name @@ -98,6 +99,7 @@ extern mod c_double { #[link_name = "m"] #[abi = "cdecl"] extern mod c_float { + #[legacy_exports]; // Alpabetically sorted by link_name @@ -166,6 +168,7 @@ extern mod c_float { // FIXME obtain machine float/math constants automatically (Issue #1986) mod c_float_targ_consts { + #[legacy_exports]; const radix: uint = 2u; const mantissa_digits: uint = 24u; const digits: uint = 6u; @@ -181,6 +184,7 @@ mod c_float_targ_consts { } mod c_double_targ_consts { + #[legacy_exports]; const radix: uint = 2u; const mantissa_digits: uint = 53u; const digits: uint = 15u; @@ -200,6 +204,7 @@ mod c_double_targ_consts { FIXME use these once they can be parsed (see Issue #1433) mod c_float_math_consts { + #[legacy_exports]; const pi: c_float = 0x1.921fb6p+1_f32; const div_1_pi: c_float = 0x1.45f306p-2_f32; const div_2_pi: c_float = 0x1.45f306p-1_f32; @@ -216,6 +221,7 @@ mod c_float_math_consts { } mod c_double_math_consts { + #[legacy_exports]; const pi: c_double = 0x1.921fb54442d18p+1_f64; const div_1_pi: c_double = 0x1.45f306dc9c883p-2_f64; const div_2_pi: c_double = 0x1.45f306dc9c883p-1_f64; @@ -232,6 +238,7 @@ mod c_double_math_consts { } mod c_float_targ_consts { + #[legacy_exports]; const radix: uint = 2u; const mantissa_digits: uint = 24u; const digits: uint = 6u; @@ -245,6 +252,7 @@ mod c_float_targ_consts { } mod c_double_targ_consts { + #[legacy_exports]; const radix: uint = 2u; const mantissa_digits: uint = 53u; const digits: uint = 15u; diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 35c3dcc71ab..362062e945d 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -24,6 +24,7 @@ export Eq; // Awful hack to work around duplicate lang items in core test. #[cfg(notest)] mod nounittest { + #[legacy_exports]; /** * Trait for values that can be compared for a sort-order. * @@ -75,10 +76,12 @@ mod nounittest { } #[cfg(test)] -mod nounittest {} +mod nounittest { + #[legacy_exports];} #[cfg(test)] mod unittest { + #[legacy_exports]; #[cfg(stage0)] trait Ord { pure fn lt(&&other: self) -> bool; @@ -111,7 +114,8 @@ mod unittest { } #[cfg(notest)] -mod unittest {} +mod unittest { + #[legacy_exports];} #[cfg(stage0)] pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool { diff --git a/src/libcore/comm.rs b/src/libcore/comm.rs index cdf5224a071..b99eec8bb5b 100644 --- a/src/libcore/comm.rs +++ b/src/libcore/comm.rs @@ -275,6 +275,7 @@ type port_id = int; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn rust_port_id_send(target_port: port_id, data: *()) -> libc::uintptr_t; fn new_port(unit_sz: libc::size_t) -> *rust_port; @@ -297,6 +298,7 @@ extern mod rustrt { #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn init<T>() -> T; } diff --git a/src/libcore/core.rc b/src/libcore/core.rc index f6701dfbf03..d6424106868 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -85,43 +85,54 @@ export private; /// Operations and constants for `int` #[path = "int-template"] mod int { + #[legacy_exports]; use inst::{ pow }; export pow; #[path = "int.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `i8` #[path = "int-template"] mod i8 { + #[legacy_exports]; #[path = "i8.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `i16` #[path = "int-template"] mod i16 { + #[legacy_exports]; #[path = "i16.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `i32` #[path = "int-template"] mod i32 { + #[legacy_exports]; #[path = "i32.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `i64` #[path = "int-template"] mod i64 { + #[legacy_exports]; #[path = "i64.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `uint` #[path = "uint-template"] mod uint { + #[legacy_exports]; use inst::{ div_ceil, div_round, div_floor, iterate, next_power_of_two @@ -130,135 +141,208 @@ mod uint { next_power_of_two; #[path = "uint.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `u8` #[path = "uint-template"] mod u8 { + #[legacy_exports]; use inst::is_ascii; export is_ascii; #[path = "u8.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `u16` #[path = "uint-template"] mod u16 { + #[legacy_exports]; #[path = "u16.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `u32` #[path = "uint-template"] mod u32 { + #[legacy_exports]; #[path = "u32.rs"] + #[legacy_exports] mod inst; } /// Operations and constants for `u64` #[path = "uint-template"] mod u64 { + #[legacy_exports]; #[path = "u64.rs"] + #[legacy_exports] mod inst; } +#[legacy_exports] mod box; +#[legacy_exports] mod char; +#[legacy_exports] mod float; +#[legacy_exports] mod f32; +#[legacy_exports] mod f64; +#[legacy_exports] mod str; +#[legacy_exports] mod ptr; +#[legacy_exports] mod vec; +#[legacy_exports] mod at_vec; +#[legacy_exports] mod bool; +#[legacy_exports] mod tuple; +#[legacy_exports] mod unit; +#[legacy_exports] mod uniq; // Ubiquitous-utility-type modules #[cfg(notest)] +#[legacy_exports] mod ops; +#[legacy_exports] mod cmp; +#[legacy_exports] mod num; +#[legacy_exports] mod hash; +#[legacy_exports] mod either; +#[legacy_exports] mod iter; +#[legacy_exports] mod logging; +#[legacy_exports] mod option; #[path="iter-trait"] mod option_iter { + #[legacy_exports]; #[path = "option.rs"] + #[legacy_exports] mod inst; } +#[legacy_exports] mod result; +#[legacy_exports] mod to_str; +#[legacy_exports] mod to_bytes; +#[legacy_exports] mod from_str; +#[legacy_exports] mod util; // Data structure modules +#[legacy_exports] mod dvec; #[path="iter-trait"] mod dvec_iter { + #[legacy_exports]; #[path = "dvec.rs"] + #[legacy_exports] mod inst; } +#[legacy_exports] mod dlist; #[path="iter-trait"] mod dlist_iter { + #[legacy_exports]; #[path ="dlist.rs"] + #[legacy_exports] mod inst; } +#[legacy_exports] mod send_map; // Concurrency +#[legacy_exports] mod comm; +#[legacy_exports] mod task { + #[legacy_exports]; + #[legacy_exports] mod local_data; + #[legacy_exports] mod local_data_priv; + #[legacy_exports] mod spawn; + #[legacy_exports] mod rt; } +#[legacy_exports] mod future; +#[legacy_exports] mod pipes; // Runtime and language-primitive support +#[legacy_exports] mod gc; +#[legacy_exports] mod io; +#[legacy_exports] mod libc; +#[legacy_exports] mod os; +#[legacy_exports] mod path; +#[legacy_exports] mod rand; +#[legacy_exports] mod run; +#[legacy_exports] mod sys; +#[legacy_exports] mod cast; +#[legacy_exports] mod mutable; +#[legacy_exports] mod flate; +#[legacy_exports] mod repr; +#[legacy_exports] mod cleanup; +#[legacy_exports] mod reflect; // Modules supporting compiler-generated code // Exported but not part of the public interface +#[legacy_exports] mod extfmt; // The test harness links against core, so don't include runtime in tests. #[cfg(notest)] +#[legacy_exports] mod rt; // For internal use, not exported +#[legacy_exports] mod unicode; +#[legacy_exports] mod private; +#[legacy_exports] mod cmath; +#[legacy_exports] mod stackwalk; // Local Variables: diff --git a/src/libcore/core.rs b/src/libcore/core.rs index a7c3c2555ac..8806131c9fb 100644 --- a/src/libcore/core.rs +++ b/src/libcore/core.rs @@ -2,6 +2,8 @@ // Export various ubiquitous types, constructors, methods. +#[legacy_exports]; + use option::{Some, None}; use Option = option::Option; use result::{Result, Ok, Err}; @@ -84,6 +86,7 @@ const debug : u32 = 3_u32; // can be resolved within libcore. #[doc(hidden)] // FIXME #3538 mod core { + #[legacy_exports]; const error : u32 = 0_u32; const warn : u32 = 1_u32; const info : u32 = 2_u32; @@ -93,6 +96,7 @@ mod core { // Similar to above. Some magic to make core testable. #[cfg(test)] mod std { + #[legacy_exports]; extern mod std(vers = "0.4"); use std::test; } diff --git a/src/libcore/dlist.rs b/src/libcore/dlist.rs index 7f4a42db641..5383eaa0d05 100644 --- a/src/libcore/dlist.rs +++ b/src/libcore/dlist.rs @@ -452,6 +452,7 @@ impl<T: Copy> DList<T> { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_dlist_concat() { let a = from_vec(~[1,2]); diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs index 574014ff4b9..244fc637aa2 100644 --- a/src/libcore/extfmt.rs +++ b/src/libcore/extfmt.rs @@ -42,6 +42,7 @@ use option::{Some, None}; // Functions used by the fmt extension at compile time mod ct { + #[legacy_exports]; enum Signedness { Signed, Unsigned, } enum Caseness { CaseUpper, CaseLower, } enum Ty { @@ -273,6 +274,7 @@ mod ct { // conditions can be evaluated at compile-time. For now though it's cleaner to // implement it 0this way, I think. mod rt { + #[legacy_exports]; const flag_none : u32 = 0u32; const flag_left_justify : u32 = 0b00000000000000000000000000000001u32; const flag_left_zero_pad : u32 = 0b00000000000000000000000000000010u32; @@ -479,6 +481,7 @@ mod rt { // XXX remove after snapshots mod rt2 { + #[legacy_exports]; const flag_none : u32 = 0u32; const flag_left_justify : u32 = 0b00000000000000000000000000000001u32; const flag_left_zero_pad : u32 = 0b00000000000000000000000000000010u32; @@ -685,6 +688,7 @@ mod rt2 { #[cfg(test)] mod test { + #[legacy_exports]; #[test] fn fmt_slice() { let s = "abc"; diff --git a/src/libcore/f32.rs b/src/libcore/f32.rs index f7376ab5df4..a8ca15f6afc 100644 --- a/src/libcore/f32.rs +++ b/src/libcore/f32.rs @@ -105,6 +105,7 @@ pure fn is_finite(x: f32) -> bool { /* Module: consts */ mod consts { + #[legacy_exports]; // FIXME (requires Issue #1433 to fix): replace with mathematical // constants from cmath. diff --git a/src/libcore/f64.rs b/src/libcore/f64.rs index 33b228ba345..0be0a059132 100644 --- a/src/libcore/f64.rs +++ b/src/libcore/f64.rs @@ -132,6 +132,7 @@ pure fn is_finite(x: f64) -> bool { /* Module: consts */ mod consts { + #[legacy_exports]; // FIXME (requires Issue #1433 to fix): replace with mathematical // constants from cmath. diff --git a/src/libcore/flate.rs b/src/libcore/flate.rs index a14b2997f0b..b75894e0c1b 100644 --- a/src/libcore/flate.rs +++ b/src/libcore/flate.rs @@ -11,6 +11,7 @@ Simple compression use libc::{c_void, size_t, c_int}; extern mod rustrt { + #[legacy_exports]; fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void, src_buf_len: size_t, diff --git a/src/libcore/float.rs b/src/libcore/float.rs index 4877e12204a..df28426dc3a 100644 --- a/src/libcore/float.rs +++ b/src/libcore/float.rs @@ -52,6 +52,7 @@ const neg_infinity: float = -1.0/0.0; /* Module: consts */ mod consts { + #[legacy_exports]; // FIXME (requires Issue #1433 to fix): replace with mathematical // constants from cmath. diff --git a/src/libcore/future.rs b/src/libcore/future.rs index 5cd8dd237e0..35b3ffe040c 100644 --- a/src/libcore/future.rs +++ b/src/libcore/future.rs @@ -180,6 +180,7 @@ proto! future_pipe ( #[allow(non_implicitly_copyable_typarams)] mod test { + #[legacy_exports]; #[test] fn test_from_value() { let f = from_value(~"snail"); diff --git a/src/libcore/gc.rs b/src/libcore/gc.rs index c700a387ca8..959e13ac7e1 100644 --- a/src/libcore/gc.rs +++ b/src/libcore/gc.rs @@ -47,6 +47,7 @@ struct StackSegment { } extern mod rustrt { + #[legacy_exports]; fn rust_annihilate_box(ptr: *Word); #[rust_stack] diff --git a/src/libcore/io.rs b/src/libcore/io.rs index fab125c8d68..4ce9808dd94 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -17,6 +17,7 @@ type fd_t = c_int; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn rust_get_stdin() -> *libc::FILE; fn rust_get_stdout() -> *libc::FILE; fn rust_get_stderr() -> *libc::FILE; @@ -781,6 +782,7 @@ fn read_whole_file(file: &Path) -> Result<~[u8], ~str> { // fsync related mod fsync { + #[legacy_exports]; enum Level { // whatever fsync does on that platform @@ -863,6 +865,7 @@ mod fsync { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_simple() { diff --git a/src/libcore/libc.rs b/src/libcore/libc.rs index 491fe02ec31..f99bc455466 100644 --- a/src/libcore/libc.rs +++ b/src/libcore/libc.rs @@ -131,18 +131,22 @@ export access, chdir, close, dup, dup2, execv, execve, execvp, getcwd, mod types { + #[legacy_exports]; // Types tend to vary *per architecture* so we pull their definitions out // into this module. // Standard types that are opaque or common, so are not per-target. mod common { + #[legacy_exports]; mod c95 { + #[legacy_exports]; enum c_void {} enum FILE {} enum fpos_t {} } mod c99 { + #[legacy_exports]; type int8_t = i8; type int16_t = i16; type int32_t = i32; @@ -153,21 +157,28 @@ mod types { type uint64_t = u64; } mod posix88 { + #[legacy_exports]; enum DIR {} enum dirent {} } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } } // Standard types that are scalar but vary by OS and arch. #[cfg(target_os = "linux")] mod os { + #[legacy_exports]; #[cfg(target_arch = "x86")] mod arch { + #[legacy_exports]; mod c95 { + #[legacy_exports]; type c_char = i8; type c_schar = i8; type c_uchar = u8; @@ -186,12 +197,14 @@ mod types { type wchar_t = i32; } mod c99 { + #[legacy_exports]; type c_longlong = i64; type c_ulonglong = u64; type intptr_t = int; type uintptr_t = uint; } mod posix88 { + #[legacy_exports]; type off_t = i32; type dev_t = u64; type ino_t = u32; @@ -202,16 +215,22 @@ mod types { type mode_t = u32; type ssize_t = i32; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; } } #[cfg(target_arch = "x86_64")] mod arch { + #[legacy_exports]; mod c95 { + #[legacy_exports]; type c_char = i8; type c_schar = i8; type c_uchar = u8; @@ -230,12 +249,14 @@ mod types { type wchar_t = i32; } mod c99 { + #[legacy_exports]; type c_longlong = i64; type c_ulonglong = u64; type intptr_t = int; type uintptr_t = uint; } mod posix88 { + #[legacy_exports]; type off_t = i64; type dev_t = u64; type ino_t = u64; @@ -246,19 +267,26 @@ mod types { type mode_t = u32; type ssize_t = i64; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; } } } #[cfg(target_os = "freebsd")] mod os { + #[legacy_exports]; #[cfg(target_arch = "x86_64")] mod arch { + #[legacy_exports]; mod c95 { + #[legacy_exports]; type c_char = i8; type c_schar = i8; type c_uchar = u8; @@ -277,12 +305,14 @@ mod types { type wchar_t = i32; } mod c99 { + #[legacy_exports]; type c_longlong = i64; type c_ulonglong = u64; type intptr_t = int; type uintptr_t = uint; } mod posix88 { + #[legacy_exports]; type off_t = i64; type dev_t = u32; type ino_t = u32; @@ -293,19 +323,26 @@ mod types { type mode_t = u16; type ssize_t = i64; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; } } } #[cfg(target_os = "win32")] mod os { + #[legacy_exports]; #[cfg(target_arch = "x86")] mod arch { + #[legacy_exports]; mod c95 { + #[legacy_exports]; type c_char = i8; type c_schar = i8; type c_uchar = u8; @@ -324,12 +361,14 @@ mod types { type wchar_t = u16; } mod c99 { + #[legacy_exports]; type c_longlong = i64; type c_ulonglong = u64; type intptr_t = int; type uintptr_t = uint; } mod posix88 { + #[legacy_exports]; type off_t = i32; type dev_t = u32; type ino_t = i16; @@ -338,10 +377,14 @@ mod types { type mode_t = u16; type ssize_t = i32; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; type BOOL = c_int; type BYTE = u8; type CCHAR = c_char; @@ -377,9 +420,12 @@ mod types { #[cfg(target_os = "macos")] mod os { + #[legacy_exports]; #[cfg(target_arch = "x86")] mod arch { + #[legacy_exports]; mod c95 { + #[legacy_exports]; type c_char = i8; type c_schar = i8; type c_uchar = u8; @@ -398,12 +444,14 @@ mod types { type wchar_t = i32; } mod c99 { + #[legacy_exports]; type c_longlong = i64; type c_ulonglong = u64; type intptr_t = int; type uintptr_t = uint; } mod posix88 { + #[legacy_exports]; type off_t = i64; type dev_t = i32; type ino_t = u64; @@ -414,16 +462,22 @@ mod types { type mode_t = u16; type ssize_t = i32; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; } } #[cfg(target_arch = "x86_64")] mod arch { + #[legacy_exports]; mod c95 { + #[legacy_exports]; type c_char = i8; type c_schar = i8; type c_uchar = u8; @@ -442,12 +496,14 @@ mod types { type wchar_t = i32; } mod c99 { + #[legacy_exports]; type c_longlong = i64; type c_ulonglong = u64; type intptr_t = int; type uintptr_t = uint; } mod posix88 { + #[legacy_exports]; type off_t = i64; type dev_t = i32; type ino_t = u64; @@ -458,23 +514,30 @@ mod types { type mode_t = u16; type ssize_t = i64; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; } } } } mod consts { + #[legacy_exports]; // Consts tend to vary per OS so we pull their definitions out // into this module. #[cfg(target_os = "win32")] mod os { + #[legacy_exports]; mod c95 { + #[legacy_exports]; const EXIT_FAILURE : int = 1; const EXIT_SUCCESS : int = 0; const RAND_MAX : int = 32767; @@ -491,8 +554,10 @@ mod consts { const L_tmpnam : uint = 16_u; const TMP_MAX : uint = 32767_u; } - mod c99 { } + mod c99 { + #[legacy_exports]; } mod posix88 { + #[legacy_exports]; const O_RDONLY : int = 0; const O_WRONLY : int = 1; const O_RDWR : int = 2; @@ -521,10 +586,14 @@ mod consts { const STDOUT_FILENO : int = 1; const STDERR_FILENO : int = 2; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; const O_TEXT : int = 16384; const O_BINARY : int = 32768; const O_NOINHERIT: int = 128; @@ -537,7 +606,9 @@ mod consts { #[cfg(target_os = "linux")] mod os { + #[legacy_exports]; mod c95 { + #[legacy_exports]; const EXIT_FAILURE : int = 1; const EXIT_SUCCESS : int = 0; const RAND_MAX : int = 2147483647; @@ -554,8 +625,10 @@ mod consts { const L_tmpnam : uint = 20_u; const TMP_MAX : uint = 238328_u; } - mod c99 { } + mod c99 { + #[legacy_exports]; } mod posix88 { + #[legacy_exports]; const O_RDONLY : int = 0; const O_WRONLY : int = 1; const O_RDWR : int = 2; @@ -588,10 +661,14 @@ mod consts { const F_TLOCK : int = 2; const F_ULOCK : int = 0; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; const O_RSYNC : int = 1052672; const O_DSYNC : int = 4096; const O_SYNC : int = 1052672; @@ -600,7 +677,9 @@ mod consts { #[cfg(target_os = "freebsd")] mod os { + #[legacy_exports]; mod c95 { + #[legacy_exports]; const EXIT_FAILURE : int = 1; const EXIT_SUCCESS : int = 0; const RAND_MAX : int = 2147483647; @@ -617,8 +696,10 @@ mod consts { const L_tmpnam : uint = 1024_u; const TMP_MAX : uint = 308915776_u; } - mod c99 { } + mod c99 { + #[legacy_exports]; } mod posix88 { + #[legacy_exports]; const O_RDONLY : int = 0; const O_WRONLY : int = 1; const O_RDWR : int = 2; @@ -651,10 +732,14 @@ mod consts { const F_TLOCK : int = 2; const F_ULOCK : int = 0; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; const O_SYNC : int = 128; const CTL_KERN: int = 1; const KERN_PROC: int = 14; @@ -664,7 +749,9 @@ mod consts { #[cfg(target_os = "macos")] mod os { + #[legacy_exports]; mod c95 { + #[legacy_exports]; const EXIT_FAILURE : int = 1; const EXIT_SUCCESS : int = 0; const RAND_MAX : int = 2147483647; @@ -681,8 +768,10 @@ mod consts { const L_tmpnam : uint = 1024_u; const TMP_MAX : uint = 308915776_u; } - mod c99 { } + mod c99 { + #[legacy_exports]; } mod posix88 { + #[legacy_exports]; const O_RDONLY : int = 0; const O_WRONLY : int = 1; const O_RDWR : int = 2; @@ -715,10 +804,14 @@ mod consts { const F_TLOCK : int = 2; const F_ULOCK : int = 0; } - mod posix01 { } - mod posix08 { } - mod bsd44 { } + mod posix01 { + #[legacy_exports]; } + mod posix08 { + #[legacy_exports]; } + mod bsd44 { + #[legacy_exports]; } mod extra { + #[legacy_exports]; const O_DSYNC : int = 4194304; const O_SYNC : int = 128; const F_FULLFSYNC : int = 51; @@ -728,15 +821,18 @@ mod consts { mod funcs { + #[legacy_exports]; // Thankfull most of c95 is universally available and does not vary by OS // or anything. The same is not true of POSIX. mod c95 { + #[legacy_exports]; #[nolink] #[abi = "cdecl"] extern mod ctype { + #[legacy_exports]; fn isalnum(c: c_int) -> c_int; fn isalpha(c: c_int) -> c_int; fn iscntrl(c: c_int) -> c_int; @@ -755,6 +851,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod stdio { + #[legacy_exports]; fn fopen(filename: *c_char, mode: *c_char) -> *FILE; fn freopen(filename: *c_char, mode: *c_char, @@ -799,6 +896,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod stdlib { + #[legacy_exports]; fn abs(i: c_int) -> c_int; fn labs(i: c_long) -> c_long; // Omitted: div, ldiv (return type incomplete). @@ -824,6 +922,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod string { + #[legacy_exports]; fn strcpy(dst: *c_char, src: *c_char) -> *c_char; fn strncpy(dst: *c_char, src: *c_char, n: size_t) -> *c_char; @@ -858,10 +957,12 @@ mod funcs { #[cfg(target_os = "win32")] mod posix88 { + #[legacy_exports]; #[nolink] #[abi = "cdecl"] extern mod stat { + #[legacy_exports]; #[link_name = "_chmod"] fn chmod(path: *c_char, mode: c_int) -> c_int; @@ -872,6 +973,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod stdio { + #[legacy_exports]; #[link_name = "_popen"] fn popen(command: *c_char, mode: *c_char) -> *FILE; @@ -888,6 +990,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod fcntl { + #[legacy_exports]; #[link_name = "_open"] fn open(path: *c_char, oflag: c_int, mode: c_int) -> c_int; @@ -898,12 +1001,14 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod dirent { + #[legacy_exports]; // Not supplied at all. } #[nolink] #[abi = "cdecl"] extern mod unistd { + #[legacy_exports]; #[link_name = "_access"] fn access(path: *c_char, amode: c_int) -> c_int; @@ -968,10 +1073,12 @@ mod funcs { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] mod posix88 { + #[legacy_exports]; #[nolink] #[abi = "cdecl"] extern mod stat { + #[legacy_exports]; fn chmod(path: *c_char, mode: mode_t) -> c_int; fn fchmod(fd: c_int, mode: mode_t) -> c_int; fn mkdir(path: *c_char, mode: mode_t) -> c_int; @@ -981,6 +1088,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod stdio { + #[legacy_exports]; fn popen(command: *c_char, mode: *c_char) -> *FILE; fn pclose(stream: *FILE) -> c_int; fn fdopen(fd: c_int, mode: *c_char) -> *FILE; @@ -990,6 +1098,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod fcntl { + #[legacy_exports]; fn open(path: *c_char, oflag: c_int, mode: c_int) -> c_int; fn creat(path: *c_char, mode: mode_t) -> c_int; fn fcntl(fd: c_int, cmd: c_int) -> c_int; @@ -998,6 +1107,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod dirent { + #[legacy_exports]; fn opendir(dirname: *c_char) -> *DIR; fn closedir(dirp: *DIR) -> c_int; fn readdir(dirp: *DIR) -> *dirent; @@ -1009,6 +1119,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod unistd { + #[legacy_exports]; fn access(path: *c_char, amode: c_int) -> c_int; fn alarm(seconds: c_uint) -> c_uint; fn chdir(dir: *c_char) -> c_int; @@ -1058,10 +1169,12 @@ mod funcs { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] mod posix01 { + #[legacy_exports]; #[nolink] #[abi = "cdecl"] extern mod unistd { + #[legacy_exports]; fn readlink(path: *c_char, buf: *mut c_char, bufsz: size_t) -> ssize_t; @@ -1079,6 +1192,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod wait { + #[legacy_exports]; fn waitpid(pid: pid_t, status: *mut c_int, options: c_int) -> pid_t; } @@ -1086,8 +1200,10 @@ mod funcs { #[cfg(target_os = "win32")] mod posix01 { + #[legacy_exports]; #[nolink] - extern mod unistd { } + extern mod unistd { + #[legacy_exports]; } } @@ -1096,8 +1212,10 @@ mod funcs { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] mod posix08 { + #[legacy_exports]; #[nolink] - extern mod unistd { } + extern mod unistd { + #[legacy_exports]; } } @@ -1106,6 +1224,7 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod bsd44 { + #[legacy_exports]; fn sysctl(name: *c_int, namelen: c_uint, oldp: *mut c_void, oldlenp: *mut size_t, @@ -1123,6 +1242,7 @@ mod funcs { #[cfg(target_os = "linux")] #[cfg(target_os = "win32")] mod bsd44 { + #[legacy_exports]; } @@ -1130,23 +1250,28 @@ mod funcs { #[nolink] #[abi = "cdecl"] extern mod extra { + #[legacy_exports]; fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32) -> c_int; } #[cfg(target_os = "freebsd")] - mod extra { } + mod extra { + #[legacy_exports]; } #[cfg(target_os = "linux")] - mod extra { } + mod extra { + #[legacy_exports]; } #[cfg(target_os = "win32")] mod extra { + #[legacy_exports]; use types::os::arch::extra::*; #[abi = "stdcall"] extern mod kernel32 { + #[legacy_exports]; fn GetEnvironmentVariableW(n: LPCWSTR, v: LPWSTR, nsize: DWORD) -> DWORD; @@ -1171,6 +1296,7 @@ mod funcs { #[abi = "cdecl"] #[nolink] extern mod msvcrt { + #[legacy_exports]; #[link_name = "_commit"] fn commit(fd: c_int) -> c_int; } diff --git a/src/libcore/logging.rs b/src/libcore/logging.rs index bb951c76597..6086b2edd7e 100644 --- a/src/libcore/logging.rs +++ b/src/libcore/logging.rs @@ -8,6 +8,7 @@ export console_on, console_off; #[nolink] extern mod rustrt { + #[legacy_exports]; fn rust_log_console_on(); fn rust_log_console_off(); } diff --git a/src/libcore/os.rs b/src/libcore/os.rs index 21a6a06572a..5c8d478932a 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -44,6 +44,7 @@ export walk_dir; export as_c_charp, fill_charp_buf; extern mod rustrt { + #[legacy_exports]; fn rust_getcwd() -> ~str; fn rust_path_is_dir(path: *libc::c_char) -> c_int; fn rust_path_exists(path: *libc::c_char) -> c_int; @@ -78,6 +79,7 @@ fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool) #[cfg(windows)] mod win32 { + #[legacy_exports]; use dword = libc::types::os::arch::extra::DWORD; fn fill_utf16_buf_and_decode(f: fn(*mut u16, dword) -> dword) @@ -131,6 +133,7 @@ fn env() -> ~[(~str,~str)] { } mod global_env { + #[legacy_exports]; //! Internal module for serializing access to getenv/setenv export getenv; @@ -138,6 +141,7 @@ mod global_env { export env; extern mod rustrt { + #[legacy_exports]; fn rust_global_env_chan_ptr() -> *libc::uintptr_t; } @@ -204,7 +208,9 @@ mod global_env { } mod impl_ { + #[legacy_exports]; extern mod rustrt { + #[legacy_exports]; fn rust_env_pairs() -> ~[~str]; } @@ -791,6 +797,7 @@ fn family() -> ~str { ~"windows" } #[cfg(target_os = "macos")] mod consts { + #[legacy_exports]; fn sysname() -> ~str { ~"macos" } fn exe_suffix() -> ~str { ~"" } fn dll_suffix() -> ~str { ~".dylib" } @@ -798,6 +805,7 @@ mod consts { #[cfg(target_os = "freebsd")] mod consts { + #[legacy_exports]; fn sysname() -> ~str { ~"freebsd" } fn exe_suffix() -> ~str { ~"" } fn dll_suffix() -> ~str { ~".so" } @@ -805,6 +813,7 @@ mod consts { #[cfg(target_os = "linux")] mod consts { + #[legacy_exports]; fn sysname() -> ~str { ~"linux" } fn exe_suffix() -> ~str { ~"" } fn dll_suffix() -> ~str { ~".so" } @@ -812,6 +821,7 @@ mod consts { #[cfg(target_os = "win32")] mod consts { + #[legacy_exports]; fn sysname() -> ~str { ~"win32" } fn exe_suffix() -> ~str { ~".exe" } fn dll_suffix() -> ~str { ~".dll" } @@ -829,6 +839,7 @@ fn arch() -> str { ~"arm" } #[cfg(test)] #[allow(non_implicitly_copyable_typarams)] mod tests { + #[legacy_exports]; #[test] fn last_os_error() { diff --git a/src/libcore/path.rs b/src/libcore/path.rs index 331ff57116a..49909208d75 100644 --- a/src/libcore/path.rs +++ b/src/libcore/path.rs @@ -484,6 +484,7 @@ fn test_double_slash_collapsing() } mod posix { + #[legacy_exports]; #[cfg(test)] fn mk(s: &str) -> PosixPath { from_str::<PosixPath>(s) } @@ -574,6 +575,7 @@ mod posix { // Various windows helpers, and tests for the impl. mod windows { + #[legacy_exports]; #[inline(always)] pure fn is_sep(u: u8) -> bool { diff --git a/src/libcore/pipes.rs b/src/libcore/pipes.rs index 3d40358dcc1..5b977080573 100644 --- a/src/libcore/pipes.rs +++ b/src/libcore/pipes.rs @@ -268,6 +268,7 @@ fn entangle_buffer<T: Send, Tstart: Send>( #[abi = "rust-intrinsic"] #[doc(hidden)] extern mod rusti { + #[legacy_exports]; fn atomic_xchg(dst: &mut int, src: int) -> int; fn atomic_xchg_acq(dst: &mut int, src: int) -> int; fn atomic_xchg_rel(dst: &mut int, src: int) -> int; @@ -308,6 +309,7 @@ type rust_task = libc::c_void; #[doc(hidden)] extern mod rustrt { + #[legacy_exports]; #[rust_stack] fn rust_get_task() -> *rust_task; #[rust_stack] @@ -1224,6 +1226,7 @@ fn try_send_one<T: Send>(+chan: ChanOne<T>, +data: T) } mod rt { + #[legacy_exports]; // These are used to hide the option constructors from the // compiler because their names are changing fn make_some<T>(+val: T) -> Option<T> { Some(move val) } @@ -1232,6 +1235,7 @@ mod rt { #[cfg(test)] mod test { + #[legacy_exports]; #[test] fn test_select2() { let (c1, p1) = pipes::stream(); diff --git a/src/libcore/private.rs b/src/libcore/private.rs index a5db84a9b06..777aea7320c 100644 --- a/src/libcore/private.rs +++ b/src/libcore/private.rs @@ -16,6 +16,7 @@ use task::TaskBuilder; use task::atomically; extern mod rustrt { + #[legacy_exports]; fn rust_task_weaken(ch: rust_port_id); fn rust_task_unweaken(ch: rust_port_id); @@ -558,6 +559,7 @@ fn unwrap_exclusive<T: Send>(+arc: Exclusive<T>) -> T { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn exclusive_arc() { diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 65cf61ab2bd..47a9f60afa5 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -27,6 +27,7 @@ use libc::{c_void, size_t}; #[nolink] #[abi = "cdecl"] extern mod libc_ { + #[legacy_exports]; #[rust_stack] fn memcpy(dest: *mut c_void, src: *const c_void, n: libc::size_t) -> *c_void; @@ -42,6 +43,7 @@ extern mod libc_ { #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn addr_of<T>(val: T) -> *T; } diff --git a/src/libcore/rand.rs b/src/libcore/rand.rs index 52b5bdadc35..1b9aba6e391 100644 --- a/src/libcore/rand.rs +++ b/src/libcore/rand.rs @@ -8,6 +8,7 @@ enum rctx {} #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn rand_seed() -> ~[u8]; fn rand_new() -> *rctx; fn rand_new_seeded(seed: ~[u8]) -> *rctx; @@ -309,6 +310,7 @@ fn seeded_xorshift(x: u32, y: u32, z: u32, w: u32) -> Rng { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn rng_seeded() { diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 1b41c37273e..3396e3670c4 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -401,6 +401,7 @@ impl<T:Eq,U:Eq> Result<T,U> : Eq { #[cfg(test)] #[allow(non_implicitly_copyable_typarams)] mod tests { + #[legacy_exports]; fn op1() -> result::Result<int, ~str> { result::Ok(666) } fn op2(&&i: int) -> result::Result<uint, ~str> { diff --git a/src/libcore/rt.rs b/src/libcore/rt.rs index f303c22ab42..644edb69d56 100644 --- a/src/libcore/rt.rs +++ b/src/libcore/rt.rs @@ -14,6 +14,7 @@ use gc::{cleanup_stack_for_failure, gc, Word}; type rust_task = c_void; extern mod rustrt { + #[legacy_exports]; #[rust_stack] fn rust_upcall_fail(expr: *c_char, file: *c_char, line: size_t); diff --git a/src/libcore/run.rs b/src/libcore/run.rs index 2eda9d53659..2496ad51a41 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -16,6 +16,7 @@ export waitpid; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn rust_run_program(argv: **libc::c_char, envp: *c_void, dir: *libc::c_char, in_fd: c_int, out_fd: c_int, err_fd: c_int) @@ -401,6 +402,7 @@ fn waitpid(pid: pid_t) -> int { #[cfg(test)] mod tests { + #[legacy_exports]; use io::WriterUtil; diff --git a/src/libcore/send_map.rs b/src/libcore/send_map.rs index 5dfc1f64367..2a010ee4712 100644 --- a/src/libcore/send_map.rs +++ b/src/libcore/send_map.rs @@ -28,6 +28,7 @@ trait SendMap<K:Eq Hash, V: Copy> { /// Open addressing with linear probing. mod linear { + #[legacy_exports]; export LinearMap, linear_map, linear_map_with_capacity, public_methods; const initial_capacity: uint = 32u; // 2^5 @@ -362,6 +363,7 @@ mod linear { #[test] mod test { + #[legacy_exports]; use linear::LinearMap; diff --git a/src/libcore/stackwalk.rs b/src/libcore/stackwalk.rs index acea7f60eab..7c0a4ee8761 100644 --- a/src/libcore/stackwalk.rs +++ b/src/libcore/stackwalk.rs @@ -79,10 +79,12 @@ fn frame_address(f: fn(*u8)) { } extern mod rustrt { + #[legacy_exports]; fn rust_dbg_breakpoint(); } #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn frame_address(f: fn(*u8)); } diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 479776d7fd5..35c2fde36b4 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -2040,6 +2040,7 @@ pure fn escape_unicode(s: &str) -> ~str { /// Unsafe operations mod raw { + #[legacy_exports]; export from_buf, from_buf_len, @@ -2233,6 +2234,7 @@ impl ~str: UniqueStr { #[cfg(notest)] mod traits { + #[legacy_exports]; #[cfg(stage0)] impl ~str: Add<&str,~str> { #[inline(always)] @@ -2251,7 +2253,8 @@ mod traits { } #[cfg(test)] -mod traits {} +mod traits { + #[legacy_exports];} trait StrSlice { fn all(it: fn(char) -> bool) -> bool; @@ -2396,6 +2399,7 @@ impl &str: StrSlice { #[cfg(test)] mod tests { + #[legacy_exports]; use libc::c_char; diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs index a541e6de7c5..37403213ab2 100644 --- a/src/libcore/sys.rs +++ b/src/libcore/sys.rs @@ -38,6 +38,7 @@ struct Closure { #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn get_tydesc<T>() -> *(); fn size_of<T>() -> uint; fn pref_align_of<T>() -> uint; @@ -111,6 +112,7 @@ pure fn log_str<T>(t: &T) -> ~str { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn size_of_basic() { diff --git a/src/libcore/task.rs b/src/libcore/task.rs index 52775456d10..baabd711456 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -1178,6 +1178,7 @@ fn test_spawn_sched_childs_on_same_sched() { #[nolink] #[cfg(test)] extern mod testrt { + #[legacy_exports]; fn rust_dbg_lock_create() -> *libc::c_void; fn rust_dbg_lock_destroy(lock: *libc::c_void); fn rust_dbg_lock_lock(lock: *libc::c_void); diff --git a/src/libcore/to_str.rs b/src/libcore/to_str.rs index 65d9b0e4471..a9e7bd74b28 100644 --- a/src/libcore/to_str.rs +++ b/src/libcore/to_str.rs @@ -101,6 +101,7 @@ impl<A: ToStr> ~A: ToStr { #[cfg(test)] #[allow(non_implicitly_copyable_typarams)] mod tests { + #[legacy_exports]; #[test] fn test_simple_types() { assert 1.to_str() == ~"1"; diff --git a/src/libcore/unicode.rs b/src/libcore/unicode.rs index 2c115fcf444..ef26ae5d223 100644 --- a/src/libcore/unicode.rs +++ b/src/libcore/unicode.rs @@ -4,6 +4,7 @@ #[forbid(deprecated_pattern)]; mod general_category { + #[legacy_exports]; pure fn Cc(c: char) -> bool { return match c { '\x00' .. '\x1f' @@ -2564,6 +2565,7 @@ mod general_category { } mod derived_property { + #[legacy_exports]; /// Check if a character has the alphabetic unicode property pure fn Alphabetic(c: char) -> bool { return match c { diff --git a/src/libcore/util.rs b/src/libcore/util.rs index e9ca27407ea..8c38949f5df 100644 --- a/src/libcore/util.rs +++ b/src/libcore/util.rs @@ -93,6 +93,7 @@ fn unreachable() -> ! { } mod tests { + #[legacy_exports]; #[test] fn identity_crisis() { // Writing a test for the identity function. How did it come to this? diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index c9f69e6b21f..c4b78f9b95f 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -97,6 +97,7 @@ export traits; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn vec_reserve_shared(++t: *sys::TypeDesc, ++v: **raw::VecRepr, ++n: libc::size_t); @@ -104,6 +105,7 @@ extern mod rustrt { #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn move_val_init<T>(&dst: T, -src: T); } @@ -1535,6 +1537,7 @@ impl<T: Ord> @[T] : Ord { #[cfg(notest)] mod traits { + #[legacy_exports]; #[cfg(stage0)] impl<T: Copy> ~[T]: Add<&[const T],~[T]> { #[inline(always)] @@ -1570,7 +1573,8 @@ mod traits { } #[cfg(test)] -mod traits {} +mod traits { + #[legacy_exports];} trait ConstVector { pure fn is_empty() -> bool; @@ -1744,6 +1748,7 @@ impl<T: Copy> &[T]: ImmutableCopyableVector<T> { /// Unsafe operations mod raw { + #[legacy_exports]; // FIXME: This should have crate visibility (#1893 blocks that) /// The internal representation of a (boxed) vector @@ -1888,6 +1893,7 @@ mod raw { /// Operations on `[u8]` mod bytes { + #[legacy_exports]; export cmp; export lt, le, eq, ne, ge, gt; export memcpy, memmove; @@ -2017,6 +2023,7 @@ impl<A: Copy Ord> &[A]: iter::CopyableOrderedIter<A> { #[cfg(test)] mod tests { + #[legacy_exports]; fn square(n: uint) -> uint { return n * n; } diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 5c4e1097fe2..c5b1aafc020 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -444,6 +444,7 @@ impl<T: Const Send> &RWReadMode<T> { #[cfg(test)] mod tests { + #[legacy_exports]; use comm::*; #[test] diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index 10fdec44094..4af647aabf7 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -34,10 +34,12 @@ use libc::size_t; #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn move_val_init<T>(&dst: T, -src: T); fn needs_drop<T>() -> bool; } extern mod rustrt { + #[legacy_exports]; #[rust_stack] fn rust_call_tydesc_glue(root: *u8, tydesc: *TypeDesc, field: size_t); } diff --git a/src/libstd/base64.rs b/src/libstd/base64.rs index 00499895d56..d01aaab6723 100644 --- a/src/libstd/base64.rs +++ b/src/libstd/base64.rs @@ -137,6 +137,7 @@ impl ~str: FromBase64 { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_to_base64() { assert (~"").to_base64() == ~""; diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index 6aef0464830..21864ec0e7f 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -563,6 +563,7 @@ impl Bitv: ops::Index<uint,bool> { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_to_str() { let zerolen = Bitv(0u, false); diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs index c02fb9d75fc..fde9df858d7 100644 --- a/src/libstd/c_vec.rs +++ b/src/libstd/c_vec.rs @@ -138,6 +138,7 @@ unsafe fn ptr<T>(t: CVec<T>) -> *mut T { #[cfg(test)] mod tests { + #[legacy_exports]; use libc::*; fn malloc(n: size_t) -> CVec<u8> { diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index 8bf0b629f54..e2d4646d670 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -66,6 +66,7 @@ fn DuplexStream<T: Send, U: Send>() #[cfg(test)] mod test { + #[legacy_exports]; #[test] fn DuplexStream1() { let (left, right) = DuplexStream(); diff --git a/src/libstd/dbg.rs b/src/libstd/dbg.rs index 01136341571..2b9df33b2d4 100644 --- a/src/libstd/dbg.rs +++ b/src/libstd/dbg.rs @@ -14,6 +14,7 @@ export breakpoint; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn debug_tydesc(td: *sys::TypeDesc); fn debug_opaque(td: *sys::TypeDesc, x: *()); fn debug_box(td: *sys::TypeDesc, x: *()); diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 35b147e1940..9b34f455780 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -120,6 +120,7 @@ fn create<T: Copy>() -> Deque<T> { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_simple() { let d: deque::Deque<int> = deque::create::<int>(); diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index 4a071dea879..6f827be2b8a 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -496,6 +496,7 @@ impl FailType : Eq { #[cfg(test)] mod tests { + #[legacy_exports]; use opt = getopts; use result::{Err, Ok}; diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 79fee39a702..4d458db482b 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -858,6 +858,7 @@ impl Error: to_str::ToStr { #[cfg(test)] mod tests { + #[legacy_exports]; fn mk_dict(items: &[(~str, Json)]) -> Json { let d = map::HashMap(); diff --git a/src/libstd/list.rs b/src/libstd/list.rs index a9c5e1b0e77..26cc7764e7a 100644 --- a/src/libstd/list.rs +++ b/src/libstd/list.rs @@ -192,6 +192,7 @@ impl<T:Eq> List<T> : Eq { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_is_empty() { diff --git a/src/libstd/map.rs b/src/libstd/map.rs index 3fab62261fc..5373c1d336f 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -83,6 +83,7 @@ trait Map<K:Eq IterBytes Hash Copy, V: Copy> { } mod util { + #[legacy_exports]; type Rational = {num: int, den: int}; // : int::positive(*.den); pure fn rational_leq(x: Rational, y: Rational) -> bool { @@ -96,6 +97,7 @@ mod util { // FIXME (#2344): package this up and export it as a datatype usable for // external code that doesn't want to pay the cost of a box. mod chained { + #[legacy_exports]; export T, mk, HashMap; const initial_capacity: uint = 32u; // 2^5 @@ -518,6 +520,7 @@ impl<K: Eq IterBytes Hash Copy, V: Copy> @Mut<LinearMap<K, V>>: #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_simple() { diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs index c840d320375..c52255d60ca 100644 --- a/src/libstd/net_ip.rs +++ b/src/libstd/net_ip.rs @@ -118,6 +118,7 @@ fn get_addr(node: &str, iotask: iotask) } mod v4 { + #[legacy_exports]; /** * Convert a str to `ip_addr` * @@ -204,6 +205,7 @@ mod v4 { } } mod v6 { + #[legacy_exports]; /** * Convert a str to `ip_addr` * @@ -310,6 +312,7 @@ extern fn get_addr_cb(handle: *uv_getaddrinfo_t, status: libc::c_int, #[cfg(test)] mod test { + #[legacy_exports]; #[test] fn test_ip_ipv4_parse_and_format_ip() { let localhost_str = ~"127.0.0.1"; diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 8e72e92be99..a0a209eae52 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -26,6 +26,7 @@ export connect; #[nolink] extern mod rustrt { + #[legacy_exports]; fn rust_uv_current_kernel_malloc(size: libc::c_uint) -> *libc::c_void; fn rust_uv_current_kernel_free(mem: *libc::c_void); fn rust_uv_helper_uv_tcp_t_size() -> libc::c_uint; @@ -1222,13 +1223,16 @@ type TcpBufferedSocketData = { //#[cfg(test)] mod test { + #[legacy_exports]; // FIXME don't run on fbsd or linux 32 bit (#2064) #[cfg(target_os="win32")] #[cfg(target_os="darwin")] #[cfg(target_os="linux")] mod tcp_ipv4_server_and_client_test { + #[legacy_exports]; #[cfg(target_arch="x86_64")] mod impl64 { + #[legacy_exports]; #[test] fn test_gl_tcp_server_and_client_ipv4() unsafe { impl_gl_tcp_ipv4_server_and_client(); @@ -1253,6 +1257,7 @@ mod test { } #[cfg(target_arch="x86")] mod impl32 { + #[legacy_exports]; #[test] #[ignore(cfg(target_os = "linux"))] fn test_gl_tcp_server_and_client_ipv4() unsafe { diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index b56d8471fbf..22fe049d03b 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -786,6 +786,7 @@ impl Url: IterBytes { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_split_char_first() { let (u,v) = split_char_first(~"hello, sweet world", ','); diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs index 30698b8db67..d26d0a484b2 100644 --- a/src/libstd/rope.rs +++ b/src/libstd/rope.rs @@ -431,7 +431,9 @@ fn loop_leaves(rope: Rope, it: fn(node::Leaf) -> bool) -> bool{ } mod iterator { + #[legacy_exports]; mod leaf { + #[legacy_exports]; fn start(rope: Rope) -> node::leaf_iterator::T { match (rope) { node::Empty => return node::leaf_iterator::empty(), @@ -443,6 +445,7 @@ mod iterator { } } mod char { + #[legacy_exports]; fn start(rope: Rope) -> node::char_iterator::T { match (rope) { node::Empty => return node::char_iterator::empty(), @@ -535,6 +538,7 @@ fn char_at(rope: Rope, pos: uint) -> char { Section: Implementation */ mod node { + #[legacy_exports]; /// Implementation of type `rope` enum Root { @@ -1105,6 +1109,7 @@ mod node { } mod leaf_iterator { + #[legacy_exports]; type T = { stack: ~[mut @Node], mut stackpos: int @@ -1142,6 +1147,7 @@ mod node { } mod char_iterator { + #[legacy_exports]; type T = { leaf_iterator: leaf_iterator::T, mut leaf: Option<Leaf>, @@ -1219,6 +1225,7 @@ mod node { #[cfg(test)] mod tests { + #[legacy_exports]; //Utility function, used for sanity check fn rope_to_string(r: Rope) -> ~str { diff --git a/src/libstd/sha1.rs b/src/libstd/sha1.rs index c16e29f2770..40c9589a651 100644 --- a/src/libstd/sha1.rs +++ b/src/libstd/sha1.rs @@ -262,6 +262,7 @@ fn sha1() -> Sha1 { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test() unsafe { diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index c32f7413a92..afef3c5e5f9 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -171,6 +171,7 @@ impl<T: Copy Ord Eq> &[mut T] : Sort { #[cfg(test)] mod test_qsort3 { + #[legacy_exports]; fn check_sort(v1: &[mut int], v2: &[mut int]) { let len = vec::len::<int>(v1); quick_sort3::<int>(v1); @@ -210,6 +211,7 @@ mod test_qsort3 { #[cfg(test)] mod test_qsort { + #[legacy_exports]; fn check_sort(v1: &[mut int], v2: &[mut int]) { let len = vec::len::<int>(v1); pure fn leual(a: &int, b: &int) -> bool { *a <= *b } @@ -269,6 +271,7 @@ mod test_qsort { #[cfg(test)] mod tests { + #[legacy_exports]; fn check_sort(v1: &[int], v2: &[int]) { let len = vec::len::<int>(v1); diff --git a/src/libstd/std.rc b/src/libstd/std.rc index d089791bdc3..422ff81b9fe 100644 --- a/src/libstd/std.rc +++ b/src/libstd/std.rc @@ -19,6 +19,7 @@ not required in or otherwise suitable for the core library. #[no_core]; #[legacy_modes]; +#[legacy_exports]; #[allow(vecs_implicitly_copyable)]; #[deny(non_camel_case_types)]; @@ -41,66 +42,107 @@ export cell; // General io and system-services modules +#[legacy_exports] mod net; +#[legacy_exports] mod net_ip; +#[legacy_exports] mod net_tcp; +#[legacy_exports] mod net_url; // libuv modules +#[legacy_exports] mod uv; +#[legacy_exports] mod uv_ll; +#[legacy_exports] mod uv_iotask; +#[legacy_exports] mod uv_global_loop; // Utility modules +#[legacy_exports] mod c_vec; +#[legacy_exports] mod timer; +#[legacy_exports] mod cell; // Concurrency +#[legacy_exports] mod sync; +#[legacy_exports] mod arc; +#[legacy_exports] mod comm; // Collections +#[legacy_exports] mod bitv; +#[legacy_exports] mod deque; +#[legacy_exports] mod fun_treemap; +#[legacy_exports] mod list; +#[legacy_exports] mod map; +#[legacy_exports] mod rope; +#[legacy_exports] mod smallintmap; +#[legacy_exports] mod sort; +#[legacy_exports] mod treemap; +#[legacy_exports] // And ... other stuff +#[legacy_exports] mod ebml; +#[legacy_exports] mod dbg; +#[legacy_exports] mod getopts; +#[legacy_exports] mod json; +#[legacy_exports] mod sha1; +#[legacy_exports] mod md4; +#[legacy_exports] mod tempfile; +#[legacy_exports] mod term; +#[legacy_exports] mod time; +#[legacy_exports] mod prettyprint; +#[legacy_exports] mod arena; +#[legacy_exports] mod par; +#[legacy_exports] mod cmp; +#[legacy_exports] mod base64; #[cfg(unicode)] +#[legacy_exports] mod unicode; // Compiler support modules +#[legacy_exports] mod test; +#[legacy_exports] mod serialization; // Local Variables: diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index f5528f7a79c..b2e9def6d73 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -670,6 +670,7 @@ impl &RWlockReadMode { #[cfg(test)] mod tests { + #[legacy_exports]; /************************************************************************ * Semaphore tests ************************************************************************/ diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 29d97a8918d..d01991bfec1 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -29,6 +29,7 @@ export run_tests_console; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn rust_sched_threads() -> libc::size_t; } @@ -428,6 +429,7 @@ fn calc_result(test: &TestDesc, task_succeeded: bool) -> TestResult { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn do_not_run_ignored_tests() { diff --git a/src/libstd/time.rs b/src/libstd/time.rs index f984f1b733f..3dca5540b82 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -22,6 +22,7 @@ export #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn get_time(&sec: i64, &nsec: i32); fn precise_time_ns(&ns: u64); @@ -884,6 +885,7 @@ impl Tm { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_get_time() { diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index eca9a1fc8a8..1476d6bdf31 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -147,6 +147,7 @@ extern fn delayed_send_close_cb(handle: *uv::ll::uv_timer_t) unsafe { #[cfg(test)] mod test { + #[legacy_exports]; #[test] fn test_gl_timer_simple_sleep_test() { let hl_loop = uv::global_loop::get(); diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index a43821a0d37..598a680f706 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -87,6 +87,7 @@ fn traverse<K, V: Copy>(m: &const TreeEdge<K, V>, f: fn(K, V)) { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn init_treemap() { let _m = TreeMap::<int, int>(); } diff --git a/src/libstd/unicode.rs b/src/libstd/unicode.rs index 9136ad2708f..e76b8529730 100644 --- a/src/libstd/unicode.rs +++ b/src/libstd/unicode.rs @@ -2,6 +2,7 @@ #[forbid(deprecated_pattern)]; mod icu { + #[legacy_exports]; type UBool = u8; type UProperty = int; type UChar32 = char; @@ -151,6 +152,7 @@ mod icu { #[link_name = "icuuc"] #[abi = "cdecl"] extern mod libicu { + #[legacy_exports]; pure fn u_hasBinaryProperty(c: UChar32, which: UProperty) -> UBool; pure fn u_isdigit(c: UChar32) -> UBool; pure fn u_islower(c: UChar32) -> UBool; @@ -209,6 +211,7 @@ pure fn is_upper(c: char) -> bool { #[cfg(test)] mod tests { + #[legacy_exports]; #[test] fn test_is_digit() { diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs index 336d485cd01..cde88db031e 100644 --- a/src/libstd/uv_global_loop.rs +++ b/src/libstd/uv_global_loop.rs @@ -16,6 +16,7 @@ use task::TaskBuilder; use either::{Left, Right}; extern mod rustrt { + #[legacy_exports]; fn rust_uv_get_kernel_global_chan_ptr() -> *libc::uintptr_t; } @@ -112,6 +113,7 @@ fn spawn_loop() -> IoTask { #[cfg(test)] mod test { + #[legacy_exports]; extern fn simple_timer_close_cb(timer_ptr: *ll::uv_timer_t) unsafe { let exit_ch_ptr = ll::get_data_for_uv_handle( timer_ptr as *libc::c_void) as *comm::Chan<bool>; diff --git a/src/libstd/uv_iotask.rs b/src/libstd/uv_iotask.rs index adc3f89ec6e..2e008830558 100644 --- a/src/libstd/uv_iotask.rs +++ b/src/libstd/uv_iotask.rs @@ -171,6 +171,7 @@ extern fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe { #[cfg(test)] mod test { + #[legacy_exports]; extern fn async_close_cb(handle: *ll::uv_async_t) unsafe { log(debug, fmt!("async_close_cb handle %?", handle)); let exit_ch = (*(ll::get_data_for_uv_handle(handle) diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs index 09cded54977..6d212cd7e92 100644 --- a/src/libstd/uv_ll.rs +++ b/src/libstd/uv_ll.rs @@ -247,6 +247,7 @@ type sockaddr_in6 = { type addr_in = addr_in_impl::addr_in; #[cfg(unix)] mod addr_in_impl { + #[legacy_exports]; #[cfg(target_arch="x86_64")] type addr_in = { a0: *u8, a1: *u8, @@ -262,6 +263,7 @@ mod addr_in_impl { } #[cfg(windows)] mod addr_in_impl { + #[legacy_exports]; type addr_in = { a0: *u8, a1: *u8, a2: *u8, a3: *u8 @@ -272,6 +274,7 @@ mod addr_in_impl { type addrinfo = addrinfo_impl::addrinfo; #[cfg(target_os="linux")] mod addrinfo_impl { + #[legacy_exports]; #[cfg(target_arch="x86_64")] type addrinfo = { a00: *u8, a01: *u8, a02: *u8, a03: *u8, @@ -286,6 +289,7 @@ mod addrinfo_impl { #[cfg(target_os="macos")] #[cfg(target_os="freebsd")] mod addrinfo_impl { + #[legacy_exports]; type addrinfo = { a00: *u8, a01: *u8, a02: *u8, a03: *u8, a04: *u8, a05: *u8 @@ -293,6 +297,7 @@ mod addrinfo_impl { } #[cfg(windows)] mod addrinfo_impl { + #[legacy_exports]; type addrinfo = { a00: *u8, a01: *u8, a02: *u8, a03: *u8, a04: *u8, a05: *u8 @@ -306,6 +311,7 @@ type uv_getaddrinfo_t = { }; mod uv_ll_struct_stubgen { + #[legacy_exports]; fn gen_stub_uv_tcp_t() -> uv_tcp_t { return gen_stub_os(); #[cfg(target_os = "linux")] @@ -561,6 +567,7 @@ mod uv_ll_struct_stubgen { #[nolink] extern mod rustrt { + #[legacy_exports]; // libuv public API fn rust_uv_loop_new() -> *libc::c_void; fn rust_uv_loop_delete(lp: *libc::c_void); @@ -1002,6 +1009,7 @@ unsafe fn addrinfo_as_sockaddr_in6(input: *addrinfo) -> *sockaddr_in6 { #[cfg(test)] mod test { + #[legacy_exports]; enum tcp_read_data { tcp_read_eof, tcp_read_more(~[u8]), @@ -1503,8 +1511,10 @@ mod test { #[cfg(target_os="darwin")] #[cfg(target_os="linux")] mod tcp_and_server_client_test { + #[legacy_exports]; #[cfg(target_arch="x86_64")] mod impl64 { + #[legacy_exports]; #[test] fn test_uv_ll_tcp_server_and_request() unsafe { impl_uv_tcp_server_and_request(); @@ -1512,6 +1522,7 @@ mod test { } #[cfg(target_arch="x86")] mod impl32 { + #[legacy_exports]; #[test] #[ignore(cfg(target_os = "linux"))] fn test_uv_ll_tcp_server_and_request() unsafe { diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs index f4ad277b908..28d47087ccc 100644 --- a/src/libsyntax/ext/auto_serialize.rs +++ b/src/libsyntax/ext/auto_serialize.rs @@ -78,6 +78,7 @@ export expand; // Transitional reexports so qquote can find the paths it is looking for mod syntax { + #[legacy_exports]; pub use ext; pub use parse; } diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index a4512b7b098..01046dded26 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -10,6 +10,7 @@ use ext::base::mk_ctxt; // Transitional reexports so qquote can find the paths it is looking for mod syntax { + #[legacy_exports]; pub use ext; pub use parse; } diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index e2b08d089a7..913d69d391f 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -16,6 +16,7 @@ use ast_builder::{append_types, path, empty_span}; // Transitional reexports so qquote can find the paths it is looking for mod syntax { + #[legacy_exports]; pub use ext; pub use parse; } @@ -318,7 +319,7 @@ impl protocol: gen_init { } }; - cx.parse_item(fmt!("fn init%s() -> (client::%s, server::%s)\ + cx.parse_item(fmt!("pub fn init%s() -> (client::%s, server::%s)\ { use pipes::HasBuffer; %s }", start_state.ty_params.to_source(cx), start_state.to_ty(cx).to_source(cx), diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index d04a65fd2db..9bf612c588a 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -279,6 +279,7 @@ pure fn is_bar(t: token) -> bool { mod special_idents { + #[legacy_exports]; use ast::ident; const underscore : ident = 0u; const anon : ident = 1u; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index f41cdae7e03..561e2ecd0b4 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -127,7 +127,7 @@ fn fun_to_str(decl: ast::fn_decl, name: ast::ident, params: ~[ast::ty_param], intr: ident_interner) -> ~str { do io::with_str_writer |wr| { let s = rust_printer(wr, intr); - print_fn(s, decl, None, name, params, None); + print_fn(s, decl, None, name, params, None, ast::inherited); end(s); // Close the head box end(s); // Close the outer box eof(s.s); @@ -420,7 +420,8 @@ fn print_foreign_item(s: ps, item: @ast::foreign_item) { print_outer_attributes(s, item.attrs); match item.node { ast::foreign_item_fn(decl, purity, typarams) => { - print_fn(s, decl, Some(purity), item.ident, typarams, None); + print_fn(s, decl, Some(purity), item.ident, typarams, None, + ast::inherited); end(s); // end head-ibox word(s.s, ~";"); end(s); // end the outer fn box @@ -444,7 +445,7 @@ fn print_item(s: ps, &&item: @ast::item) { s.ann.pre(ann_node); match item.node { ast::item_const(ty, expr) => { - head(s, ~"const"); + head(s, visibility_qualified(item.vis, ~"const")); print_ident(s, item.ident); word_space(s, ~":"); print_type(s, ty); @@ -458,12 +459,13 @@ fn print_item(s: ps, &&item: @ast::item) { } ast::item_fn(decl, purity, typarams, body) => { - print_fn(s, decl, Some(purity), item.ident, typarams, None); + print_fn(s, decl, Some(purity), item.ident, typarams, None, + item.vis); word(s.s, ~" "); print_block_with_attrs(s, body, item.attrs); } ast::item_mod(_mod) => { - head(s, ~"mod"); + head(s, visibility_qualified(item.vis, ~"mod")); print_ident(s, item.ident); nbsp(s); bopen(s); @@ -471,7 +473,7 @@ fn print_item(s: ps, &&item: @ast::item) { bclose(s, item.span); } ast::item_foreign_mod(nmod) => { - head(s, ~"extern"); + head(s, visibility_qualified(item.vis, ~"extern")); match nmod.sort { ast::named => { word_nbsp(s, ~"mod"); @@ -614,6 +616,30 @@ fn print_variants(s: ps, variants: ~[ast::variant], span: ast::span) { bclose(s, span); } +fn visibility_to_str(vis: ast::visibility) -> ~str { + match vis { + ast::private => ~"priv", + ast::public => ~"pub", + ast::inherited => ~"" + } +} + +fn visibility_qualified(vis: ast::visibility, s: ~str) -> ~str { + match vis { + ast::private | ast::public => + visibility_to_str(vis) + " " + s, + ast::inherited => s + } +} + +fn print_visibility(s: ps, vis: ast::visibility) { + match vis { + ast::private | ast::public => + word_nbsp(s, visibility_to_str(vis)), + ast::inherited => () + } +} + fn print_struct(s: ps, struct_def: @ast::struct_def, tps: ~[ast::ty_param], ident: ast::ident, span: ast::span) { print_ident(s, ident); @@ -651,9 +677,7 @@ fn print_struct(s: ps, struct_def: @ast::struct_def, tps: ~[ast::ty_param], ast::named_field(ident, mutability, visibility) => { hardbreak_if_not_bol(s); maybe_print_comment(s, field.span.lo); - if visibility == ast::private { - word_nbsp(s, ~"priv"); - } + print_visibility(s, visibility); if mutability == ast::class_mutable { word_nbsp(s, ~"mut"); } @@ -710,6 +734,7 @@ fn print_tt(s: ps, tt: ast::token_tree) { } fn print_variant(s: ps, v: ast::variant) { + print_visibility(s, v.node.vis); match v.node.kind { ast::tuple_variant_kind(args) => { print_ident(s, v.node.name); @@ -762,7 +787,8 @@ fn print_method(s: ps, meth: @ast::method) { maybe_print_comment(s, meth.span.lo); print_outer_attributes(s, meth.attrs); print_fn(s, meth.decl, Some(meth.purity), - meth.ident, meth.tps, Some(meth.self_ty.node)); + meth.ident, meth.tps, Some(meth.self_ty.node), + meth.vis); word(s.s, ~" "); print_block_with_attrs(s, meth.body, meth.attrs); } @@ -1224,7 +1250,8 @@ fn print_expr(s: ps, &&expr: @ast::expr) { cbox(s, indent_unit); // head-box, will be closed by print-block at start ibox(s, 0u); - word(s.s, fn_header_info_to_str(None, None, Some(proto))); + word(s.s, fn_header_info_to_str(None, None, Some(proto), + ast::inherited)); print_fn_args_and_ret(s, decl, *cap_clause, None); space(s.s); print_block(s, body); @@ -1587,8 +1614,9 @@ fn print_self_ty(s: ps, self_ty: ast::self_ty_) -> bool { fn print_fn(s: ps, decl: ast::fn_decl, purity: Option<ast::purity>, name: ast::ident, typarams: ~[ast::ty_param], - opt_self_ty: Option<ast::self_ty_>) { - head(s, fn_header_info_to_str(opt_self_ty, purity, None)); + opt_self_ty: Option<ast::self_ty_>, + vis: ast::visibility) { + head(s, fn_header_info_to_str(opt_self_ty, purity, None, vis)); print_ident(s, name); print_type_params(s, typarams); print_fn_args_and_ret(s, decl, ~[], opt_self_ty); @@ -1758,6 +1786,7 @@ fn print_view_item(s: ps, item: @ast::view_item) { hardbreak_if_not_bol(s); maybe_print_comment(s, item.span.lo); print_outer_attributes(s, item.attrs); + print_visibility(s, item.vis); match item.node { ast::view_item_use(id, mta, _) => { head(s, ~"extern mod"); @@ -1827,7 +1856,8 @@ fn print_ty_fn(s: ps, opt_proto: Option<ast::proto>, purity: ast::purity, tps: Option<~[ast::ty_param]>, opt_self_ty: Option<ast::self_ty_>) { ibox(s, indent_unit); - word(s.s, fn_header_info_to_str(opt_self_ty, Some(purity), opt_proto)); + word(s.s, fn_header_info_to_str(opt_self_ty, Some(purity), opt_proto, + ast::inherited)); print_bounds(s, bounds); match id { Some(id) => { word(s.s, ~" "); print_ident(s, id); } _ => () } match tps { Some(tps) => print_type_params(s, tps), _ => () } @@ -2050,10 +2080,14 @@ fn next_comment(s: ps) -> Option<comments::cmnt> { fn fn_header_info_to_str(opt_sty: Option<ast::self_ty_>, opt_purity: Option<ast::purity>, - opt_p: Option<ast::proto>) -> ~str { - let mut s = match opt_sty { - Some(ast::sty_static) => ~"static ", - _ => ~ "" + opt_p: Option<ast::proto>, + vis: ast::visibility) -> ~str { + + let mut s = visibility_qualified(vis, ~""); + + match opt_sty { + Some(ast::sty_static) => str::push_str(s, ~"static "), + _ => () }; match opt_purity { diff --git a/src/libsyntax/syntax.rc b/src/libsyntax/syntax.rc index 6ce8ef11d91..c62ec28f359 100644 --- a/src/libsyntax/syntax.rc +++ b/src/libsyntax/syntax.rc @@ -9,6 +9,7 @@ #[no_core]; #[legacy_modes]; +#[legacy_exports]; #[allow(vecs_implicitly_copyable)]; #[allow(non_camel_case_types)]; @@ -18,19 +19,31 @@ extern mod std(vers = "0.4"); use core::*; +#[legacy_exports] mod attr; +#[legacy_exports] mod diagnostic; +#[legacy_exports] mod codemap; +#[legacy_exports] mod ast; +#[legacy_exports] mod ast_util; +#[legacy_exports] mod ast_map; +#[legacy_exports] mod visit; +#[legacy_exports] mod fold; +#[legacy_exports] mod util { + #[legacy_exports]; + #[legacy_exports] mod interner; } mod parse { + #[legacy_exports]; export parser; export common; export lexer; @@ -40,61 +53,100 @@ mod parse { export classify; export attr; + #[legacy_exports] mod eval; + #[legacy_exports] mod lexer; + #[legacy_exports] mod parser; + #[legacy_exports] mod token; + #[legacy_exports] mod comments; + #[legacy_exports] mod attr; + #[legacy_exports] /// Common routines shared by parser mods + #[legacy_exports] mod common; /// Functions dealing with operator precedence + #[legacy_exports] mod prec; /// Routines the parser uses to classify AST nodes + #[legacy_exports] mod classify; /// Reporting obsolete syntax + #[legacy_exports] mod obsolete; } mod print { + #[legacy_exports]; + #[legacy_exports] mod pp; + #[legacy_exports] mod pprust; } mod ext { + #[legacy_exports]; + #[legacy_exports] mod base; + #[legacy_exports] mod expand; + #[legacy_exports] mod qquote; + #[legacy_exports] mod build; mod tt { + #[legacy_exports]; + #[legacy_exports] mod transcribe; + #[legacy_exports] mod macro_parser; + #[legacy_exports] mod macro_rules; } + #[legacy_exports] mod simplext; + #[legacy_exports] mod fmt; + #[legacy_exports] mod env; + #[legacy_exports] mod concat_idents; + #[legacy_exports] mod ident_to_str; + #[legacy_exports] mod log_syntax; + #[legacy_exports] mod auto_serialize; + #[legacy_exports] mod source_util; mod pipes { + #[legacy_exports]; + #[legacy_exports] mod ast_builder; + #[legacy_exports] mod parse_proto; + #[legacy_exports] mod pipec; + #[legacy_exports] mod proto; + #[legacy_exports] mod check; + #[legacy_exports] mod liveness; } + #[legacy_exports] mod trace_macros; } diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index c52b2c661ab..1cfb322e39c 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -65,9 +65,11 @@ fn WriteOutputFile(sess:session, } mod jit { + #[legacy_exports]; #[nolink] #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn morestack_addr() -> *(); } @@ -99,6 +101,7 @@ mod jit { } mod write { + #[legacy_exports]; fn is_object_or_assembly_or_exe(ot: output_type) -> bool { if ot == output_type_assembly || ot == output_type_object || ot == output_type_exe { diff --git a/src/rustc/back/rpath.rs b/src/rustc/back/rpath.rs index f115827b136..207a8f3fc94 100644 --- a/src/rustc/back/rpath.rs +++ b/src/rustc/back/rpath.rs @@ -181,6 +181,7 @@ fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] { #[cfg(unix)] mod test { + #[legacy_exports]; #[test] fn test_rpaths_to_flags() { let flags = rpaths_to_flags(~[Path("path1"), diff --git a/src/rustc/driver/driver.rs b/src/rustc/driver/driver.rs index ebdc8bc848c..f08a067d0ef 100644 --- a/src/rustc/driver/driver.rs +++ b/src/rustc/driver/driver.rs @@ -745,6 +745,7 @@ fn list_metadata(sess: session, path: &Path, out: io::Writer) { #[cfg(test)] mod test { + #[legacy_exports]; // When the user supplies --test we should implicitly supply --cfg test #[test] diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs index 8c085e6391d..2e8cddf2095 100644 --- a/src/rustc/driver/session.rs +++ b/src/rustc/driver/session.rs @@ -338,6 +338,7 @@ fn sess_os_to_meta_os(os: os) -> metadata::loader::os { #[cfg(test)] mod test { + #[legacy_exports]; use syntax::ast_util; fn make_crate_type_attr(t: ~str) -> ast::attribute { diff --git a/src/rustc/front/intrinsic.rs b/src/rustc/front/intrinsic.rs index 33de068fad0..7c9b1e690af 100644 --- a/src/rustc/front/intrinsic.rs +++ b/src/rustc/front/intrinsic.rs @@ -2,6 +2,7 @@ // and injected into each crate the compiler builds. Keep it small. mod intrinsic { + #[legacy_exports]; pub use rusti::visit_tydesc; @@ -113,6 +114,7 @@ mod intrinsic { #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn get_tydesc<T>() -> *(); fn visit_tydesc(td: *TyDesc, &&tv: TyVisitor); } diff --git a/src/rustc/front/test.rs b/src/rustc/front/test.rs index 27c070cd201..e1441d9ee5e 100644 --- a/src/rustc/front/test.rs +++ b/src/rustc/front/test.rs @@ -174,6 +174,7 @@ fn add_test_module(cx: test_ctxt, m: ast::_mod) -> ast::_mod { We're going to be building a module that looks more or less like: mod __test { + #[legacy_exports]; fn main(args: ~[str]) -> int { std::test::test_main(args, tests()) diff --git a/src/rustc/lib/llvm.rs b/src/rustc/lib/llvm.rs index 10866a213fe..60c08dab716 100644 --- a/src/rustc/lib/llvm.rs +++ b/src/rustc/lib/llvm.rs @@ -274,6 +274,7 @@ type SectionIteratorRef = *SectionIterator_opaque; #[link_name = "rustllvm"] #[abi = "cdecl"] extern mod llvm { + #[legacy_exports]; /* Create and destroy contexts. */ fn LLVMContextCreate() -> ContextRef; fn LLVMGetGlobalContext() -> ContextRef; diff --git a/src/rustc/metadata.rs b/src/rustc/metadata.rs index 66e53cf4540..2d2d6a3f79e 100644 --- a/src/rustc/metadata.rs +++ b/src/rustc/metadata.rs @@ -3,23 +3,29 @@ // no dependencies on rustc it can move into its own crate. mod middle { + #[legacy_exports]; pub use middle_::ty; pub use middle_::resolve; } mod front { + #[legacy_exports]; } mod back { + #[legacy_exports]; } mod driver { + #[legacy_exports]; } mod util { + #[legacy_exports]; pub use util_::ppaux; } mod lib { + #[legacy_exports]; pub use lib_::llvm; } diff --git a/src/rustc/middle/lang_items.rs b/src/rustc/middle/lang_items.rs index e33ff5dcf50..87201f5a4da 100644 --- a/src/rustc/middle/lang_items.rs +++ b/src/rustc/middle/lang_items.rs @@ -50,6 +50,7 @@ struct LanguageItems { } mod LanguageItems { + #[legacy_exports]; fn make() -> LanguageItems { LanguageItems { const_trait: None, diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs index 18bea6338a4..7158754429b 100644 --- a/src/rustc/middle/resolve.rs +++ b/src/rustc/middle/resolve.rs @@ -483,6 +483,13 @@ struct Module { exported_names: HashMap<Atom,node_id>, + // XXX: This is a transition measure to let us switch export-evaluation + // logic when compiling modules that have transitioned to listing their + // pub/priv qualifications on items, explicitly, rather than using the + // old export rule. + + legacy_exports: bool, + // The status of resolving each import in this module. import_resolutions: HashMap<Atom,@ImportResolution>, @@ -493,7 +500,9 @@ struct Module { mut resolved_import_count: uint, } -fn Module(parent_link: ParentLink, def_id: Option<def_id>) -> Module { +fn Module(parent_link: ParentLink, + def_id: Option<def_id>, + legacy_exports: bool) -> Module { Module { parent_link: parent_link, def_id: def_id, @@ -501,6 +510,7 @@ fn Module(parent_link: ParentLink, def_id: Option<def_id>) -> Module { imports: DVec(), anonymous_children: HashMap(), exported_names: atom_hashmap(), + legacy_exports: legacy_exports, import_resolutions: atom_hashmap(), glob_count: 0u, resolved_import_count: 0u @@ -577,10 +587,12 @@ struct NameBindings { impl NameBindings { /// Creates a new module in this set of name bindings. - fn define_module(parent_link: ParentLink, def_id: Option<def_id>, + fn define_module(parent_link: ParentLink, + def_id: Option<def_id>, + legacy_exports: bool, sp: span) { if self.module_def.is_none() { - let module_ = @Module(parent_link, def_id); + let module_ = @Module(parent_link, def_id, legacy_exports); self.module_def = ModuleDef(module_); self.module_span = Some(sp); } @@ -728,6 +740,18 @@ fn namespace_to_str(ns: Namespace) -> ~str { } } +fn has_legacy_export_attr(attrs: &[syntax::ast::attribute]) -> bool { + for attrs.each |attribute| { + match attribute.node.value.node { + syntax::ast::meta_word(w) if w == ~"legacy_exports" => { + return true; + } + _ => {} + } + } + return false; +} + fn Resolver(session: session, lang_items: LanguageItems, crate: @crate) -> Resolver { @@ -735,6 +759,7 @@ fn Resolver(session: session, lang_items: LanguageItems, (*graph_root).define_module(NoParentLink, Some({ crate: 0, node: 0 }), + has_legacy_export_attr(crate.node.attrs), crate.span); let current_module = (*graph_root).get_module(); @@ -885,10 +910,18 @@ impl Resolver { })); } - fn visibility_to_privacy(visibility: visibility) -> Privacy { - match visibility { - inherited | public => Public, - private => Private + fn visibility_to_privacy(visibility: visibility, + legacy_exports: bool) -> Privacy { + if legacy_exports { + match visibility { + inherited | public => Public, + private => Private + } + } else { + match visibility { + public => Public, + inherited | private => Private + } } } @@ -1009,16 +1042,20 @@ impl Resolver { let atom = item.ident; let sp = item.span; + let legacy = match parent { + ModuleReducedGraphParent(m) => m.legacy_exports + }; match item.node { item_mod(module_) => { + let legacy = has_legacy_export_attr(item.attrs); let (name_bindings, new_parent) = self.add_child(atom, parent, ~[ModuleNS], sp); let parent_link = self.get_parent_link(new_parent, atom); let def_id = { crate: 0, node: item.id }; (*name_bindings).define_module(parent_link, Some(def_id), - sp); + legacy, sp); let new_parent = ModuleReducedGraphParent((*name_bindings).get_module()); @@ -1026,6 +1063,7 @@ impl Resolver { visit_mod(module_, sp, item.id, new_parent, visitor); } item_foreign_mod(fm) => { + let legacy = has_legacy_export_attr(item.attrs); let new_parent = match fm.sort { named => { let (name_bindings, new_parent) = self.add_child(atom, @@ -1034,7 +1072,7 @@ impl Resolver { let parent_link = self.get_parent_link(new_parent, atom); let def_id = { crate: 0, node: item.id }; (*name_bindings).define_module(parent_link, Some(def_id), - sp); + legacy, sp); ModuleReducedGraphParent((*name_bindings).get_module()) } @@ -1052,7 +1090,7 @@ impl Resolver { ~[ValueNS], sp); (*name_bindings).define_value - (self.visibility_to_privacy(item.vis), + (self.visibility_to_privacy(item.vis, legacy), def_const(local_def(item.id)), sp); } @@ -1062,7 +1100,7 @@ impl Resolver { let def = def_fn(local_def(item.id), purity); (*name_bindings).define_value - (self.visibility_to_privacy(item.vis), def, sp); + (self.visibility_to_privacy(item.vis, legacy), def, sp); visit_item(item, new_parent, visitor); } @@ -1072,7 +1110,7 @@ impl Resolver { ~[TypeNS], sp); (*name_bindings).define_type - (self.visibility_to_privacy(item.vis), + (self.visibility_to_privacy(item.vis, legacy), def_ty(local_def(item.id)), sp); } @@ -1083,7 +1121,7 @@ impl Resolver { ~[TypeNS], sp); (*name_bindings).define_type - (self.visibility_to_privacy(item.vis), + (self.visibility_to_privacy(item.vis, legacy), def_ty(local_def(item.id)), sp); @@ -1104,7 +1142,7 @@ impl Resolver { self.add_child(atom, parent, ~[TypeNS], sp); (*name_bindings).define_type - (self.visibility_to_privacy(item.vis), + (self.visibility_to_privacy(item.vis, legacy), def_ty(local_def(item.id)), sp); new_parent @@ -1114,7 +1152,8 @@ impl Resolver { self.add_child(atom, parent, ~[ValueNS, TypeNS], sp); - let privacy = self.visibility_to_privacy(item.vis); + let privacy = self.visibility_to_privacy(item.vis, + legacy); (*name_bindings).define_type (privacy, def_ty(local_def(item.id)), sp); @@ -1171,7 +1210,7 @@ impl Resolver { self.trait_info.insert(def_id, method_names); (*name_bindings).define_type - (self.visibility_to_privacy(item.vis), + (self.visibility_to_privacy(item.vis, legacy), def_ty(def_id), sp); visit_item(item, new_parent, visitor); @@ -1190,10 +1229,14 @@ impl Resolver { parent: ReducedGraphParent, &&visitor: vt<ReducedGraphParent>) { + let legacy = match parent { + ModuleReducedGraphParent(m) => m.legacy_exports + }; + let atom = variant.node.name; let (child, _) = self.add_child(atom, parent, ~[ValueNS], variant.span); - let privacy = self.visibility_to_privacy(variant.node.vis); + let privacy = self.visibility_to_privacy(variant.node.vis, legacy); match variant.node.kind { tuple_variant_kind(_) => { @@ -1228,6 +1271,7 @@ impl Resolver { fn build_reduced_graph_for_view_item(view_item: @view_item, parent: ReducedGraphParent, &&_visitor: vt<ReducedGraphParent>) { + match view_item.node { view_item_import(view_paths) => { for view_paths.each |view_path| { @@ -1368,6 +1412,7 @@ impl Resolver { (*child_name_bindings).define_module(parent_link, Some(def_id), + false, view_item.span); self.build_reduced_graph_for_external_crate ((*child_name_bindings).get_module()); @@ -1424,7 +1469,7 @@ impl Resolver { let parent_module = self.get_module_from_parent(parent); let new_module = @Module(BlockParentLink(parent_module, block_id), - None); + None, false); parent_module.anonymous_children.insert(block_id, new_module); new_parent = ModuleReducedGraphParent(new_module); } else { @@ -1451,6 +1496,7 @@ impl Resolver { None => { child_name_bindings.define_module(parent_link, Some(def_id), + false, dummy_sp()); modules.insert(def_id, child_name_bindings.get_module()); @@ -1594,7 +1640,8 @@ impl Resolver { let parent_link = self.get_parent_link(new_parent, ident); (*child_name_bindings).define_module(parent_link, - None, dummy_sp()); + None, false, + dummy_sp()); } ModuleDef(_) => { /* Fall through. */ } } @@ -2554,8 +2601,9 @@ impl Resolver { } fn name_is_exported(module_: @Module, name: Atom) -> bool { - return module_.exported_names.size() == 0u || - module_.exported_names.contains_key(name); + return !module_.legacy_exports || + module_.exported_names.size() == 0u || + module_.exported_names.contains_key(name); } /** diff --git a/src/rustc/rustc.rc b/src/rustc/rustc.rc index 67f36e3f249..d34ae4e35f3 100644 --- a/src/rustc/rustc.rc +++ b/src/rustc/rustc.rc @@ -37,102 +37,188 @@ use middle_ = middle; use back_ = back; mod middle { + #[legacy_exports]; mod trans { + #[legacy_exports]; + #[legacy_exports] mod inline; + #[legacy_exports] mod monomorphize; + #[legacy_exports] mod controlflow; + #[legacy_exports] mod glue; + #[legacy_exports] mod datum; + #[legacy_exports] mod callee; + #[legacy_exports] mod expr; + #[legacy_exports] mod common; + #[legacy_exports] mod consts; + #[legacy_exports] mod type_of; + #[legacy_exports] mod build; + #[legacy_exports] mod base; + #[legacy_exports] mod alt; + #[legacy_exports] mod uniq; + #[legacy_exports] mod closure; + #[legacy_exports] mod tvec; + #[legacy_exports] mod meth; + #[legacy_exports] mod foreign; + #[legacy_exports] mod reflect; + #[legacy_exports] mod shape; + #[legacy_exports] mod debuginfo; + #[legacy_exports] mod type_use; + #[legacy_exports] mod reachable; } + #[legacy_exports] mod ty; + #[legacy_exports] mod resolve; mod typeck { + #[legacy_exports]; mod check { + #[legacy_exports]; + #[legacy_exports] mod alt; + #[legacy_exports] mod vtable; + #[legacy_exports] mod writeback; + #[legacy_exports] mod regionmanip; + #[legacy_exports] mod regionck; + #[legacy_exports] mod demand; + #[legacy_exports] mod method; } + #[legacy_exports] mod rscope; + #[legacy_exports] mod astconv; mod infer { + #[legacy_exports]; + #[legacy_exports] mod assignment; + #[legacy_exports] mod combine; + #[legacy_exports] mod glb; + #[legacy_exports] mod integral; + #[legacy_exports] mod lattice; + #[legacy_exports] mod lub; + #[legacy_exports] mod region_var_bindings; + #[legacy_exports] mod resolve; + #[legacy_exports] mod sub; + #[legacy_exports] mod to_str; + #[legacy_exports] mod unify; } + #[legacy_exports] mod collect; + #[legacy_exports] mod coherence; } + #[legacy_exports] mod check_loop; + #[legacy_exports] mod check_alt; + #[legacy_exports] mod check_const; + #[legacy_exports] mod lint; mod borrowck { + #[legacy_exports]; + #[legacy_exports] mod check_loans; + #[legacy_exports] mod gather_loans; + #[legacy_exports] mod loan; + #[legacy_exports] mod preserve; } + #[legacy_exports] mod mem_categorization; + #[legacy_exports] mod liveness; + #[legacy_exports] mod kind; + #[legacy_exports] mod freevars; + #[legacy_exports] mod capture; + #[legacy_exports] mod pat_util; + #[legacy_exports] mod region; + #[legacy_exports] mod const_eval; + #[legacy_exports] mod astencode; + #[legacy_exports] mod lang_items; + #[legacy_exports] mod privacy; } mod front { + #[legacy_exports]; + #[legacy_exports] mod config; + #[legacy_exports] mod test; + #[legacy_exports] mod core_inject; + #[legacy_exports] mod intrinsic_inject; } mod back { + #[legacy_exports]; + #[legacy_exports] mod link; + #[legacy_exports] mod abi; + #[legacy_exports] mod upcall; + #[legacy_exports] mod x86; + #[legacy_exports] mod x86_64; + #[legacy_exports] mod rpath; + #[legacy_exports] mod target_strs; } mod metadata { + #[legacy_exports]; export encoder; export creader; export cstore; @@ -144,29 +230,47 @@ mod metadata { export loader; export filesearch; + #[legacy_exports] mod common; + #[legacy_exports] mod tyencode; + #[legacy_exports] mod tydecode; + #[legacy_exports] mod encoder; + #[legacy_exports] mod decoder; + #[legacy_exports] mod creader; + #[legacy_exports] mod cstore; + #[legacy_exports] mod csearch; + #[legacy_exports] mod loader; + #[legacy_exports] mod filesearch; } mod driver { + #[legacy_exports]; + #[legacy_exports] mod driver; + #[legacy_exports] mod session; } mod util { + #[legacy_exports]; + #[legacy_exports] mod common; + #[legacy_exports] mod ppaux; } mod lib { + #[legacy_exports]; + #[legacy_exports] mod llvm; } diff --git a/src/rustdoc/attr_parser.rs b/src/rustdoc/attr_parser.rs index e3522c9b4d7..d2b314adf9c 100644 --- a/src/rustdoc/attr_parser.rs +++ b/src/rustdoc/attr_parser.rs @@ -19,6 +19,7 @@ type CrateAttrs = { #[cfg(test)] mod test { + #[legacy_exports]; fn parse_attributes(source: ~str) -> ~[ast::attribute] { use syntax::parse; diff --git a/src/rustdoc/attr_pass.rs b/src/rustdoc/attr_pass.rs index ea049e0d9fc..77665977d4a 100644 --- a/src/rustdoc/attr_pass.rs +++ b/src/rustdoc/attr_pass.rs @@ -290,6 +290,7 @@ fn should_extract_impl_method_docs() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); diff --git a/src/rustdoc/config.rs b/src/rustdoc/config.rs index 2dddc42b50c..177482a5e93 100644 --- a/src/rustdoc/config.rs +++ b/src/rustdoc/config.rs @@ -294,6 +294,7 @@ fn should_error_with_no_pandoc() { #[cfg(test)] mod test { + #[legacy_exports]; fn parse_config(args: ~[~str]) -> Result<Config, ~str> { parse_config_(args, mock_program_output) } diff --git a/src/rustdoc/demo.rs b/src/rustdoc/demo.rs index cb50753d87e..bf1cdf2622e 100644 --- a/src/rustdoc/demo.rs +++ b/src/rustdoc/demo.rs @@ -63,6 +63,7 @@ fn take_my_order_please( } mod fortress_of_solitude { + #[legacy_exports]; /*! * Superman's vacation home * @@ -77,6 +78,7 @@ mod fortress_of_solitude { } mod blade_runner { + #[legacy_exports]; /*! * Blade Runner is probably the best movie ever * diff --git a/src/rustdoc/desc_to_brief_pass.rs b/src/rustdoc/desc_to_brief_pass.rs index 7e08ce711e7..a1d365506ae 100644 --- a/src/rustdoc/desc_to_brief_pass.rs +++ b/src/rustdoc/desc_to_brief_pass.rs @@ -83,6 +83,7 @@ fn should_promote_impl_method_desc() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); diff --git a/src/rustdoc/extract.rs b/src/rustdoc/extract.rs index ba617b7cce6..93217f2887f 100644 --- a/src/rustdoc/extract.rs +++ b/src/rustdoc/extract.rs @@ -328,6 +328,7 @@ fn should_extract_struct_fields() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { let ast = parse::from_str(source); @@ -377,7 +378,8 @@ mod test { fn extract_fns() { let doc = mk_doc( ~"fn a() { } \ - mod b { fn c() { } }"); + mod b { + #[legacy_exports]; fn c() { } }"); assert doc.cratemod().fns()[0].name() == ~"a"; assert doc.cratemod().mods()[0].fns()[0].name() == ~"c"; } diff --git a/src/rustdoc/markdown_index_pass.rs b/src/rustdoc/markdown_index_pass.rs index ca2f352d15c..cf97308fd0e 100644 --- a/src/rustdoc/markdown_index_pass.rs +++ b/src/rustdoc/markdown_index_pass.rs @@ -226,6 +226,7 @@ fn should_index_foreign_mod_contents() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(output_style: config::OutputStyle, source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let config = { diff --git a/src/rustdoc/markdown_pass.rs b/src/rustdoc/markdown_pass.rs index 39971bc91e7..428628ee676 100644 --- a/src/rustdoc/markdown_pass.rs +++ b/src/rustdoc/markdown_pass.rs @@ -61,7 +61,8 @@ fn should_write_modules_last() { let markdown = test::render( ~"mod a { }\ fn b() { }\ - mod c { }\ + mod c { + #[legacy_exports]; }\ fn d() { }" ); @@ -334,7 +335,8 @@ fn should_write_sections() { ~"#[doc = \"\ # Header\n\ Body\"]\ - mod a { }"); + mod a { + #[legacy_exports]; }"); assert str::contains(markdown, ~"#### Header\n\nBody\n\n"); } @@ -795,6 +797,7 @@ fn should_write_struct_header() { #[cfg(test)] mod test { + #[legacy_exports]; fn render(source: ~str) -> ~str { let (srv, doc) = create_doc_srv(source); let markdown = write_markdown_str_srv(srv, doc); diff --git a/src/rustdoc/markdown_writer.rs b/src/rustdoc/markdown_writer.rs index 59d8f6d7657..5749e4dcb23 100644 --- a/src/rustdoc/markdown_writer.rs +++ b/src/rustdoc/markdown_writer.rs @@ -244,6 +244,7 @@ fn should_name_mod_file_names_by_path() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(name: ~str, source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, name); diff --git a/src/rustdoc/page_pass.rs b/src/rustdoc/page_pass.rs index f9f3d3c9e1e..48b57c7361d 100644 --- a/src/rustdoc/page_pass.rs +++ b/src/rustdoc/page_pass.rs @@ -160,6 +160,7 @@ fn should_remove_foreign_mods_from_containing_mods() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc_( output_style: config::OutputStyle, source: ~str diff --git a/src/rustdoc/prune_hidden_pass.rs b/src/rustdoc/prune_hidden_pass.rs index 597c0418c51..bf2ea216e6e 100644 --- a/src/rustdoc/prune_hidden_pass.rs +++ b/src/rustdoc/prune_hidden_pass.rs @@ -54,6 +54,7 @@ fn should_prune_hidden_items() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); diff --git a/src/rustdoc/rustdoc.rc b/src/rustdoc/rustdoc.rc index a93f47e5223..1686f56e3f1 100644 --- a/src/rustdoc/rustdoc.rc +++ b/src/rustdoc/rustdoc.rc @@ -11,6 +11,7 @@ #[no_core]; #[legacy_modes]; +#[legacy_exports]; #[allow(vecs_implicitly_copyable)]; #[allow(non_implicitly_copyable_typarams)]; @@ -23,30 +24,56 @@ extern mod syntax(vers = "0.4"); use core::*; use std::par; +#[legacy_exports] mod pass; +#[legacy_exports] mod config; +#[legacy_exports] mod parse; +#[legacy_exports] mod extract; +#[legacy_exports] mod attr_parser; +#[legacy_exports] mod doc; +#[legacy_exports] mod markdown_index_pass; +#[legacy_exports] mod markdown_pass; +#[legacy_exports] mod markdown_writer; +#[legacy_exports] mod fold; +#[legacy_exports] mod path_pass; +#[legacy_exports] mod attr_pass; +#[legacy_exports] mod tystr_pass; +#[legacy_exports] mod prune_hidden_pass; +#[legacy_exports] mod desc_to_brief_pass; +#[legacy_exports] mod text_pass; +#[legacy_exports] mod unindent_pass; +#[legacy_exports] mod trim_pass; +#[legacy_exports] mod astsrv; +#[legacy_exports] mod demo; +#[legacy_exports] mod sort_pass; +#[legacy_exports] mod sort_item_name_pass; +#[legacy_exports] mod sort_item_type_pass; +#[legacy_exports] mod page_pass; +#[legacy_exports] mod sectionalize_pass; +#[legacy_exports] mod escape_pass; -mod prune_private_pass; \ No newline at end of file +mod prune_private_pass; diff --git a/src/rustdoc/sectionalize_pass.rs b/src/rustdoc/sectionalize_pass.rs index 2a011889536..583817aef8b 100644 --- a/src/rustdoc/sectionalize_pass.rs +++ b/src/rustdoc/sectionalize_pass.rs @@ -149,7 +149,8 @@ fn should_create_section_headers() { ~"#[doc = \"\ # Header\n\ Body\"]\ - mod a { }"); + mod a { + #[legacy_exports]; }"); assert str::contains( doc.cratemod().mods()[0].item.sections[0].header, ~"Header"); @@ -161,7 +162,8 @@ fn should_create_section_bodies() { ~"#[doc = \"\ # Header\n\ Body\"]\ - mod a { }"); + mod a { + #[legacy_exports]; }"); assert str::contains( doc.cratemod().mods()[0].item.sections[0].body, ~"Body"); @@ -173,7 +175,8 @@ fn should_not_create_sections_from_indented_headers() { ~"#[doc = \"\n\ Text\n # Header\n\ Body\"]\ - mod a { }"); + mod a { + #[legacy_exports]; }"); assert vec::is_empty(doc.cratemod().mods()[0].item.sections); } @@ -184,7 +187,8 @@ fn should_remove_section_text_from_main_desc() { Description\n\n\ # Header\n\ Body\"]\ - mod a { }"); + mod a { + #[legacy_exports]; }"); assert !str::contains( option::get(doc.cratemod().mods()[0].desc()), ~"Header"); @@ -199,7 +203,8 @@ fn should_eliminate_desc_if_it_is_just_whitespace() { ~"#[doc = \"\ # Header\n\ Body\"]\ - mod a { }"); + mod a { + #[legacy_exports]; }"); assert doc.cratemod().mods()[0].desc() == None; } @@ -227,6 +232,7 @@ fn should_sectionalize_impl_methods() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); diff --git a/src/rustdoc/sort_item_type_pass.rs b/src/rustdoc/sort_item_type_pass.rs index 70ad14e1efd..4ace822d88c 100644 --- a/src/rustdoc/sort_item_type_pass.rs +++ b/src/rustdoc/sort_item_type_pass.rs @@ -30,7 +30,8 @@ fn mk_pass() -> Pass { fn test() { let source = ~"mod imod { } \ - extern mod inmod { } \ + extern mod inmod { + #[legacy_exports]; } \ const iconst: int = 0; \ fn ifn() { } \ enum ienum { ivar } \ diff --git a/src/rustdoc/text_pass.rs b/src/rustdoc/text_pass.rs index 9f7d6fda18f..daa67ff3b0e 100644 --- a/src/rustdoc/text_pass.rs +++ b/src/rustdoc/text_pass.rs @@ -252,6 +252,7 @@ fn should_execute_on_impl_method_section_bodies() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); diff --git a/src/rustdoc/trim_pass.rs b/src/rustdoc/trim_pass.rs index b611551d23b..2ff6e1ea442 100644 --- a/src/rustdoc/trim_pass.rs +++ b/src/rustdoc/trim_pass.rs @@ -16,12 +16,14 @@ fn mk_pass() -> Pass { #[test] fn should_trim_text() { let doc = test::mk_doc(~"#[doc = \" desc \"] \ - mod m { }"); + mod m { + #[legacy_exports]; }"); assert doc.cratemod().mods()[0].desc() == Some(~"desc"); } #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); diff --git a/src/rustdoc/tystr_pass.rs b/src/rustdoc/tystr_pass.rs index 76a5815c942..97313e06caa 100644 --- a/src/rustdoc/tystr_pass.rs +++ b/src/rustdoc/tystr_pass.rs @@ -389,6 +389,7 @@ fn should_not_serialize_struct_attrs() { #[cfg(test)] mod test { + #[legacy_exports]; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv, ~""); diff --git a/src/test/auxiliary/cci_class.rs b/src/test/auxiliary/cci_class.rs index b08f8def5ad..8f4055cd415 100644 --- a/src/test/auxiliary/cci_class.rs +++ b/src/test/auxiliary/cci_class.rs @@ -1,4 +1,5 @@ mod kitties { + #[legacy_exports]; struct cat { priv mut meows : uint, diff --git a/src/test/auxiliary/cci_class_2.rs b/src/test/auxiliary/cci_class_2.rs index bfbf58ddd11..e572f41322c 100644 --- a/src/test/auxiliary/cci_class_2.rs +++ b/src/test/auxiliary/cci_class_2.rs @@ -1,4 +1,5 @@ mod kitties { + #[legacy_exports]; struct cat { priv mut meows : uint, diff --git a/src/test/auxiliary/cci_class_3.rs b/src/test/auxiliary/cci_class_3.rs index a16c6b4c3a9..79583a6134c 100644 --- a/src/test/auxiliary/cci_class_3.rs +++ b/src/test/auxiliary/cci_class_3.rs @@ -1,4 +1,5 @@ mod kitties { + #[legacy_exports]; struct cat { priv mut meows : uint, diff --git a/src/test/auxiliary/cci_class_4.rs b/src/test/auxiliary/cci_class_4.rs index 32da73d14e4..57c6f2f4b52 100644 --- a/src/test/auxiliary/cci_class_4.rs +++ b/src/test/auxiliary/cci_class_4.rs @@ -1,4 +1,5 @@ mod kitties { + #[legacy_exports]; struct cat { priv mut meows : uint, diff --git a/src/test/auxiliary/cci_class_5.rs b/src/test/auxiliary/cci_class_5.rs index f2c34722bd2..94451ba4c4b 100644 --- a/src/test/auxiliary/cci_class_5.rs +++ b/src/test/auxiliary/cci_class_5.rs @@ -1,4 +1,5 @@ mod kitties { + #[legacy_exports]; struct cat { priv { diff --git a/src/test/auxiliary/cci_class_6.rs b/src/test/auxiliary/cci_class_6.rs index 0d41bccfd33..72262781222 100644 --- a/src/test/auxiliary/cci_class_6.rs +++ b/src/test/auxiliary/cci_class_6.rs @@ -1,4 +1,5 @@ mod kitties { + #[legacy_exports]; struct cat<U> { priv mut info : ~[U], diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs index 2471c9f4ccf..550dfb6886a 100644 --- a/src/test/auxiliary/cci_class_cast.rs +++ b/src/test/auxiliary/cci_class_cast.rs @@ -2,6 +2,7 @@ use to_str::*; use to_str::ToStr; mod kitty { + #[legacy_exports]; struct cat { priv mut meows : uint, diff --git a/src/test/auxiliary/cci_class_trait.rs b/src/test/auxiliary/cci_class_trait.rs index 94535f0a2c0..78e6af4c8c7 100644 --- a/src/test/auxiliary/cci_class_trait.rs +++ b/src/test/auxiliary/cci_class_trait.rs @@ -1,4 +1,5 @@ mod animals { + #[legacy_exports]; trait noisy { fn speak(); diff --git a/src/test/auxiliary/cci_intrinsic.rs b/src/test/auxiliary/cci_intrinsic.rs index b75462b3c4a..767f5d4ad68 100644 --- a/src/test/auxiliary/cci_intrinsic.rs +++ b/src/test/auxiliary/cci_intrinsic.rs @@ -1,5 +1,6 @@ #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn atomic_xchg(dst: &mut int, src: int) -> int; fn atomic_xchg_acq(dst: &mut int, src: int) -> int; fn atomic_xchg_rel(dst: &mut int, src: int) -> int; diff --git a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs index e9becef99b5..9ab96f45a34 100644 --- a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs +++ b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs @@ -5,6 +5,7 @@ export rust; use name_pool::add; mod name_pool { + #[legacy_exports]; type name_pool = (); @@ -19,6 +20,7 @@ mod name_pool { } mod rust { + #[legacy_exports]; import name_pool::add; // FIXME #3155: this is a hack diff --git a/src/test/auxiliary/crateresolve7x.rs b/src/test/auxiliary/crateresolve7x.rs index 45a41581b3a..520a207345f 100644 --- a/src/test/auxiliary/crateresolve7x.rs +++ b/src/test/auxiliary/crateresolve7x.rs @@ -4,11 +4,13 @@ // These both have the same version but differ in other metadata mod a { + #[legacy_exports]; extern mod cr_1 (name = "crateresolve_calories", vers = "0.1", calories="100"); fn f() -> int { cr_1::f() } } mod b { + #[legacy_exports]; extern mod cr_2 (name = "crateresolve_calories", vers = "0.1", calories="200"); fn f() -> int { cr_2::f() } } diff --git a/src/test/auxiliary/extern-crosscrate-source.rs b/src/test/auxiliary/extern-crosscrate-source.rs index f42d65c2436..80bf51f31e1 100644 --- a/src/test/auxiliary/extern-crosscrate-source.rs +++ b/src/test/auxiliary/extern-crosscrate-source.rs @@ -4,6 +4,7 @@ #[crate_type = "lib"]; extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/auxiliary/foreign_lib.rs b/src/test/auxiliary/foreign_lib.rs index c33ced59fec..6ea28255421 100644 --- a/src/test/auxiliary/foreign_lib.rs +++ b/src/test/auxiliary/foreign_lib.rs @@ -1,5 +1,6 @@ #[link(name="foreign_lib", vers="0.0")]; extern mod rustrt { + #[legacy_exports]; fn last_os_error() -> ~str; } \ No newline at end of file diff --git a/src/test/auxiliary/issue-3012-1.rs b/src/test/auxiliary/issue-3012-1.rs index 258f681a9c6..a9d371321f8 100644 --- a/src/test/auxiliary/issue-3012-1.rs +++ b/src/test/auxiliary/issue-3012-1.rs @@ -2,6 +2,7 @@ #[crate_type = "lib"]; mod socket { + #[legacy_exports]; export socket_handle; diff --git a/src/test/auxiliary/issue_2316_b.rs b/src/test/auxiliary/issue_2316_b.rs index 0e3057cbc78..d30028e44cf 100644 --- a/src/test/auxiliary/issue_2316_b.rs +++ b/src/test/auxiliary/issue_2316_b.rs @@ -1,6 +1,7 @@ extern mod issue_2316_a; mod cloth { + #[legacy_exports]; use issue_2316_a::*; diff --git a/src/test/auxiliary/noexporttypelib.rs b/src/test/auxiliary/noexporttypelib.rs index ef4dcdfbdda..f97a645ca8f 100644 --- a/src/test/auxiliary/noexporttypelib.rs +++ b/src/test/auxiliary/noexporttypelib.rs @@ -1,3 +1,4 @@ +#[legacy_exports]; export foo; type oint = Option<int>; fn foo() -> oint { Some(3) } diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs index cd011227c84..159a1e1b8ba 100644 --- a/src/test/auxiliary/static-methods-crate.rs +++ b/src/test/auxiliary/static-methods-crate.rs @@ -2,7 +2,7 @@ vers = "0.1")]; #[crate_type = "lib"]; - +#[legacy_exports]; export read, readMaybe; trait read { diff --git a/src/test/auxiliary/test_comm.rs b/src/test/auxiliary/test_comm.rs index fed01e6a30e..7e5474df906 100644 --- a/src/test/auxiliary/test_comm.rs +++ b/src/test/auxiliary/test_comm.rs @@ -91,6 +91,7 @@ type port_id = int; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn new_port(unit_sz: libc::size_t) -> *rust_port; fn del_port(po: *rust_port); @@ -104,6 +105,7 @@ extern mod rustrt { #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn init<T>() -> T; } diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs index 15b103ca99c..129c1ad5a8e 100644 --- a/src/test/bench/shootout-nbody.rs +++ b/src/test/bench/shootout-nbody.rs @@ -10,6 +10,7 @@ extern mod std; // an llvm intrinsic. #[nolink] extern mod libc { + #[legacy_exports]; fn sqrt(n: float) -> float; } @@ -30,6 +31,7 @@ fn main(args: ~[~str]) { } mod NBodySystem { + #[legacy_exports]; fn make() -> ~[Body::props] { let bodies: ~[Body::props] = @@ -128,6 +130,7 @@ mod NBodySystem { } mod Body { + #[legacy_exports]; const PI: float = 3.141592653589793; const SOLAR_MASS: float = 39.478417604357432; diff --git a/src/test/bench/task-perf-word-count-generic.rs b/src/test/bench/task-perf-word-count-generic.rs index b7d6e4769a0..95155a8d283 100644 --- a/src/test/bench/task-perf-word-count-generic.rs +++ b/src/test/bench/task-perf-word-count-generic.rs @@ -109,6 +109,7 @@ fn box<T>(+x: T) -> box<T> { } mod map_reduce { + #[legacy_exports]; export putter; export getter; export mapper; diff --git a/src/test/compile-fail/attr-bad-meta.rs b/src/test/compile-fail/attr-bad-meta.rs index 6b074d736cd..6d7ffae620c 100644 --- a/src/test/compile-fail/attr-bad-meta.rs +++ b/src/test/compile-fail/attr-bad-meta.rs @@ -2,4 +2,5 @@ // asterisk is bogus #[attr*] -mod m { } +mod m { + #[legacy_exports]; } diff --git a/src/test/compile-fail/bad-expr-path.rs b/src/test/compile-fail/bad-expr-path.rs index 62fc81649ff..e38ca8443bc 100644 --- a/src/test/compile-fail/bad-expr-path.rs +++ b/src/test/compile-fail/bad-expr-path.rs @@ -1,5 +1,6 @@ // error-pattern: unresolved name: m1::a -mod m1 { } +mod m1 { + #[legacy_exports]; } fn main(args: ~[str]) { log(debug, m1::a); } diff --git a/src/test/compile-fail/bad-expr-path2.rs b/src/test/compile-fail/bad-expr-path2.rs index fe2501b29f7..a7f23df1c66 100644 --- a/src/test/compile-fail/bad-expr-path2.rs +++ b/src/test/compile-fail/bad-expr-path2.rs @@ -1,7 +1,9 @@ // error-pattern: unresolved name: m1::a mod m1 { - mod a { } + #[legacy_exports]; + mod a { + #[legacy_exports]; } } fn main(args: ~[str]) { log(debug, m1::a); } diff --git a/src/test/compile-fail/crateresolve2.rs b/src/test/compile-fail/crateresolve2.rs index 9f23d30fdde..91b2c95b8a7 100644 --- a/src/test/compile-fail/crateresolve2.rs +++ b/src/test/compile-fail/crateresolve2.rs @@ -6,6 +6,7 @@ extern mod crateresolve2(vers = "0.1"); mod m { + #[legacy_exports]; extern mod crateresolve2(vers = "0.2"); } diff --git a/src/test/compile-fail/empty-linkname.rs b/src/test/compile-fail/empty-linkname.rs index 0b6cd08d6bc..c9f2775329c 100644 --- a/src/test/compile-fail/empty-linkname.rs +++ b/src/test/compile-fail/empty-linkname.rs @@ -2,4 +2,5 @@ #[link_name = ""] extern mod foo { + #[legacy_exports]; } diff --git a/src/test/compile-fail/empty-linkname2.rs b/src/test/compile-fail/empty-linkname2.rs index 2c87c7308e2..faf283ef4a1 100644 --- a/src/test/compile-fail/empty-linkname2.rs +++ b/src/test/compile-fail/empty-linkname2.rs @@ -4,4 +4,5 @@ #[link_name = ""] #[nolink] extern mod foo { + #[legacy_exports]; } diff --git a/src/test/compile-fail/export-fully-qualified.rs b/src/test/compile-fail/export-fully-qualified.rs index 30075a1cadb..5a711ff95bd 100644 --- a/src/test/compile-fail/export-fully-qualified.rs +++ b/src/test/compile-fail/export-fully-qualified.rs @@ -5,6 +5,7 @@ // want to change eventually. mod foo { + #[legacy_exports]; export bar; diff --git a/src/test/compile-fail/export-import.rs b/src/test/compile-fail/export-import.rs index 6c9f8d15698..c6a9d3c0528 100644 --- a/src/test/compile-fail/export-import.rs +++ b/src/test/compile-fail/export-import.rs @@ -3,6 +3,7 @@ use m::unexported; mod m { + #[legacy_exports]; export exported; fn exported() { } diff --git a/src/test/compile-fail/export-tag-variant.rs b/src/test/compile-fail/export-tag-variant.rs index 7f0d7a90d38..ceedf719dd3 100644 --- a/src/test/compile-fail/export-tag-variant.rs +++ b/src/test/compile-fail/export-tag-variant.rs @@ -1,6 +1,7 @@ // error-pattern: unresolved name mod foo { + #[legacy_exports]; export x; fn x() { } diff --git a/src/test/compile-fail/export.rs b/src/test/compile-fail/export.rs index bda344587d9..69485a0ead5 100644 --- a/src/test/compile-fail/export.rs +++ b/src/test/compile-fail/export.rs @@ -1,5 +1,6 @@ // error-pattern: unresolved name mod foo { + #[legacy_exports]; export x; fn x(y: int) { log(debug, y); } fn z(y: int) { log(debug, y); } diff --git a/src/test/compile-fail/export2.rs b/src/test/compile-fail/export2.rs index cc2fcf31e9e..b1912397f4c 100644 --- a/src/test/compile-fail/export2.rs +++ b/src/test/compile-fail/export2.rs @@ -1,12 +1,14 @@ // error-pattern: unresolved name mod foo { + #[legacy_exports]; export x; fn x() { bar::x(); } } mod bar { + #[legacy_exports]; export y; fn x() { debug!("x"); } diff --git a/src/test/compile-fail/foreign-unsafe-fn-called.rs b/src/test/compile-fail/foreign-unsafe-fn-called.rs index c5c80d3a852..db1d3195eec 100644 --- a/src/test/compile-fail/foreign-unsafe-fn-called.rs +++ b/src/test/compile-fail/foreign-unsafe-fn-called.rs @@ -2,6 +2,7 @@ #[abi = "cdecl"] extern mod test { + #[legacy_exports]; unsafe fn free(); } diff --git a/src/test/compile-fail/foreign-unsafe-fn.rs b/src/test/compile-fail/foreign-unsafe-fn.rs index f0619e107bd..03c16199843 100644 --- a/src/test/compile-fail/foreign-unsafe-fn.rs +++ b/src/test/compile-fail/foreign-unsafe-fn.rs @@ -2,6 +2,7 @@ #[abi = "cdecl"] extern mod test { + #[legacy_exports]; unsafe fn free(); } diff --git a/src/test/compile-fail/fully-qualified-type-name2.rs b/src/test/compile-fail/fully-qualified-type-name2.rs index 12125422a94..454e7012d37 100644 --- a/src/test/compile-fail/fully-qualified-type-name2.rs +++ b/src/test/compile-fail/fully-qualified-type-name2.rs @@ -1,10 +1,12 @@ // Test that we use fully-qualified type names in error messages. mod x { + #[legacy_exports]; enum foo { } } mod y { + #[legacy_exports]; enum foo { } } diff --git a/src/test/compile-fail/import-from-missing.rs b/src/test/compile-fail/import-from-missing.rs index bd3a35ad280..9b408100eee 100644 --- a/src/test/compile-fail/import-from-missing.rs +++ b/src/test/compile-fail/import-from-missing.rs @@ -3,6 +3,7 @@ use spam::{ham, eggs}; mod spam { + #[legacy_exports]; fn ham() { } } diff --git a/src/test/compile-fail/import-from-rename.rs b/src/test/compile-fail/import-from-rename.rs index c72d9fda4e5..bbcb6e47882 100644 --- a/src/test/compile-fail/import-from-rename.rs +++ b/src/test/compile-fail/import-from-rename.rs @@ -3,6 +3,7 @@ use baz = foo::{bar}; mod foo { + #[legacy_exports]; fn bar() {} } diff --git a/src/test/compile-fail/import-glob-0.rs b/src/test/compile-fail/import-glob-0.rs index e9b485e4c6c..7ce73b7787f 100644 --- a/src/test/compile-fail/import-glob-0.rs +++ b/src/test/compile-fail/import-glob-0.rs @@ -3,6 +3,7 @@ use module_of_many_things::*; mod module_of_many_things { + #[legacy_exports]; export f1; export f2; export f4; diff --git a/src/test/compile-fail/import-glob-circular.rs b/src/test/compile-fail/import-glob-circular.rs index a3847c989d1..091b1e783b7 100644 --- a/src/test/compile-fail/import-glob-circular.rs +++ b/src/test/compile-fail/import-glob-circular.rs @@ -1,6 +1,7 @@ // error-pattern: unresolved mod circ1 { + #[legacy_exports]; use circ1::*; export f1; export f2; @@ -10,6 +11,7 @@ mod circ1 { } mod circ2 { + #[legacy_exports]; use circ2::*; export f1; export f2; @@ -19,6 +21,7 @@ mod circ2 { } mod test { + #[legacy_exports]; use circ1::*; fn test() { f1066(); } diff --git a/src/test/compile-fail/import-glob-export.rs b/src/test/compile-fail/import-glob-export.rs index 067caab3542..4e62df3cc00 100644 --- a/src/test/compile-fail/import-glob-export.rs +++ b/src/test/compile-fail/import-glob-export.rs @@ -4,6 +4,7 @@ use m1::*; mod m1 { + #[legacy_exports]; export f1; fn f1() { } fn f2() { } diff --git a/src/test/compile-fail/import-glob-rename.rs b/src/test/compile-fail/import-glob-rename.rs index 3fd927d7e64..24fe3fd74b9 100644 --- a/src/test/compile-fail/import-glob-rename.rs +++ b/src/test/compile-fail/import-glob-rename.rs @@ -3,6 +3,7 @@ use baz = foo::*; mod foo { + #[legacy_exports]; fn bar() {} } diff --git a/src/test/compile-fail/import-loop-2.rs b/src/test/compile-fail/import-loop-2.rs index 7cedd8a9c41..6a4d31c2ef3 100644 --- a/src/test/compile-fail/import-loop-2.rs +++ b/src/test/compile-fail/import-loop-2.rs @@ -1,11 +1,13 @@ // error-pattern:import mod a { + #[legacy_exports]; import b::x; export x; } mod b { + #[legacy_exports]; import a::x; export x; diff --git a/src/test/compile-fail/import-loop.rs b/src/test/compile-fail/import-loop.rs index 0b263f23087..11745f302bf 100644 --- a/src/test/compile-fail/import-loop.rs +++ b/src/test/compile-fail/import-loop.rs @@ -3,6 +3,7 @@ use y::x; mod y { + #[legacy_exports]; import x; export x; } diff --git a/src/test/compile-fail/import.rs b/src/test/compile-fail/import.rs index 14f23dec5f3..6863d2b1a7a 100644 --- a/src/test/compile-fail/import.rs +++ b/src/test/compile-fail/import.rs @@ -3,6 +3,7 @@ use zed::bar; use zed::baz; mod zed { + #[legacy_exports]; fn bar() { debug!("bar"); } } fn main(args: ~[str]) { bar(); } diff --git a/src/test/compile-fail/import2.rs b/src/test/compile-fail/import2.rs index ab9ea6b26df..7b1f258a9db 100644 --- a/src/test/compile-fail/import2.rs +++ b/src/test/compile-fail/import2.rs @@ -1,7 +1,9 @@ // error-pattern: unresolved use baz::zed::bar; -mod baz { } +mod baz { + #[legacy_exports]; } mod zed { + #[legacy_exports]; fn bar() { debug!("bar3"); } } fn main(args: ~[str]) { bar(); } diff --git a/src/test/compile-fail/import4.rs b/src/test/compile-fail/import4.rs index 6717434273f..22068f1badf 100644 --- a/src/test/compile-fail/import4.rs +++ b/src/test/compile-fail/import4.rs @@ -1,6 +1,8 @@ // error-pattern: import -mod a { import foo = b::foo; export foo; } -mod b { import foo = a::foo; export foo; } +mod a { + #[legacy_exports]; import foo = b::foo; export foo; } +mod b { + #[legacy_exports]; import foo = a::foo; export foo; } fn main(args: ~[str]) { debug!("loop"); } diff --git a/src/test/compile-fail/issue-1193.rs b/src/test/compile-fail/issue-1193.rs index e9a5d91c9d2..ba21c995adb 100644 --- a/src/test/compile-fail/issue-1193.rs +++ b/src/test/compile-fail/issue-1193.rs @@ -1,5 +1,6 @@ // error-pattern: pattern variable conflicts mod foo { + #[legacy_exports]; type t = u8; const a : t = 0u8; diff --git a/src/test/compile-fail/issue-1655.rs b/src/test/compile-fail/issue-1655.rs index bfaca3155f8..91a3c3f25c0 100644 --- a/src/test/compile-fail/issue-1655.rs +++ b/src/test/compile-fail/issue-1655.rs @@ -1,5 +1,6 @@ // error-pattern:expected item mod blade_runner { + #[legacy_exports]; #~[doc( brief = "Blade Runner is probably the best movie ever", desc = "I like that in the world of Blade Runner it is always diff --git a/src/test/compile-fail/issue-2123.rs b/src/test/compile-fail/issue-2123.rs index 843fd2b14eb..4912433c2ad 100644 --- a/src/test/compile-fail/issue-2123.rs +++ b/src/test/compile-fail/issue-2123.rs @@ -3,6 +3,7 @@ use x = m::f; mod m { + #[legacy_exports]; } fn main() { diff --git a/src/test/compile-fail/issue-2718-a.rs b/src/test/compile-fail/issue-2718-a.rs index b857af4e2f3..fa519453ca2 100644 --- a/src/test/compile-fail/issue-2718-a.rs +++ b/src/test/compile-fail/issue-2718-a.rs @@ -4,6 +4,7 @@ struct send_packet<T: Copy> { mod pingpong { + #[legacy_exports]; type ping = send_packet<pong>; enum pong = send_packet<ping>; //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable } diff --git a/src/test/compile-fail/issue-2766-a.rs b/src/test/compile-fail/issue-2766-a.rs index 78225ba15ec..28042e77a5e 100644 --- a/src/test/compile-fail/issue-2766-a.rs +++ b/src/test/compile-fail/issue-2766-a.rs @@ -1,6 +1,8 @@ mod stream { + #[legacy_exports]; enum stream<T: Send> { send(T, server::stream<T>), } mod server { + #[legacy_exports]; impl<T: Send> stream<T> { fn recv() -> extern fn(+stream<T>) -> stream::stream<T> { // resolve really should report just one error here. diff --git a/src/test/compile-fail/issue-2848.rs b/src/test/compile-fail/issue-2848.rs index b091dc71357..689b8240140 100644 --- a/src/test/compile-fail/issue-2848.rs +++ b/src/test/compile-fail/issue-2848.rs @@ -1,4 +1,5 @@ mod bar { + #[legacy_exports]; enum foo { alpha, beta, diff --git a/src/test/compile-fail/issue-2937.rs b/src/test/compile-fail/issue-2937.rs index c923d1d2dbe..85ba4c2eabf 100644 --- a/src/test/compile-fail/issue-2937.rs +++ b/src/test/compile-fail/issue-2937.rs @@ -2,6 +2,7 @@ use x = m::f; mod m { + #[legacy_exports]; } fn main() { diff --git a/src/test/compile-fail/issue-3099-b.rs b/src/test/compile-fail/issue-3099-b.rs index 307c629d51f..997bb9e2557 100644 --- a/src/test/compile-fail/issue-3099-b.rs +++ b/src/test/compile-fail/issue-3099-b.rs @@ -1,5 +1,7 @@ +#[legacy_exports] mod a {} +#[legacy_exports] mod a {} //~ ERROR Duplicate definition of module a fn main() {} diff --git a/src/test/compile-fail/keyword.rs b/src/test/compile-fail/keyword.rs index 02d0b089199..e39046fa9f7 100644 --- a/src/test/compile-fail/keyword.rs +++ b/src/test/compile-fail/keyword.rs @@ -1,3 +1,4 @@ +#[legacy_exports] mod break { //~^ ERROR found `break` in ident position } \ No newline at end of file diff --git a/src/test/compile-fail/nolink-with-link-args.rs b/src/test/compile-fail/nolink-with-link-args.rs index 713c8033a0e..d17aed4d5a7 100644 --- a/src/test/compile-fail/nolink-with-link-args.rs +++ b/src/test/compile-fail/nolink-with-link-args.rs @@ -6,6 +6,7 @@ the compiler output. */ #[link_args = "aFdEfSeVEEE"] #[nolink] -extern mod m1 { } +extern mod m1 { + #[legacy_exports]; } fn main() { } \ No newline at end of file diff --git a/src/test/compile-fail/private-impl-method.rs b/src/test/compile-fail/private-impl-method.rs index 2d6047b3647..a94bc37e132 100644 --- a/src/test/compile-fail/private-impl-method.rs +++ b/src/test/compile-fail/private-impl-method.rs @@ -1,4 +1,5 @@ mod a { + #[legacy_exports]; struct Foo { x: int } diff --git a/src/test/compile-fail/private-item-simple.rs b/src/test/compile-fail/private-item-simple.rs index 305899799fd..b39c51c1846 100644 --- a/src/test/compile-fail/private-item-simple.rs +++ b/src/test/compile-fail/private-item-simple.rs @@ -1,4 +1,5 @@ mod a { + #[legacy_exports]; priv fn f() {} } diff --git a/src/test/compile-fail/private-method.rs b/src/test/compile-fail/private-method.rs index 0f489a7dc76..0b4dd71da64 100644 --- a/src/test/compile-fail/private-method.rs +++ b/src/test/compile-fail/private-method.rs @@ -1,6 +1,7 @@ // error-pattern:method `nap` is private mod kitties { + #[legacy_exports]; struct cat { priv mut meows : uint, diff --git a/src/test/compile-fail/private-struct-field-ctor.rs b/src/test/compile-fail/private-struct-field-ctor.rs index 6d075cbd7ad..a766a7ed66a 100644 --- a/src/test/compile-fail/private-struct-field-ctor.rs +++ b/src/test/compile-fail/private-struct-field-ctor.rs @@ -1,4 +1,5 @@ mod a { + #[legacy_exports]; struct Foo { priv x: int } diff --git a/src/test/compile-fail/private-struct-field-pattern.rs b/src/test/compile-fail/private-struct-field-pattern.rs index cc3ebc92172..4ab5934c287 100644 --- a/src/test/compile-fail/private-struct-field-pattern.rs +++ b/src/test/compile-fail/private-struct-field-pattern.rs @@ -1,6 +1,7 @@ use a::Foo; mod a { + #[legacy_exports]; struct Foo { priv x: int } diff --git a/src/test/compile-fail/private-struct-field.rs b/src/test/compile-fail/private-struct-field.rs index 5dffdfa4fd1..1ec9ffcd306 100644 --- a/src/test/compile-fail/private-struct-field.rs +++ b/src/test/compile-fail/private-struct-field.rs @@ -1,4 +1,5 @@ mod cat { + #[legacy_exports]; struct Cat { priv meows: uint } diff --git a/src/test/compile-fail/private-variant.rs b/src/test/compile-fail/private-variant.rs index 2b31b550e24..12d2ee401ef 100644 --- a/src/test/compile-fail/private-variant.rs +++ b/src/test/compile-fail/private-variant.rs @@ -1,4 +1,5 @@ mod a { + #[legacy_exports]; enum Waffle { Belgian, Brussels, diff --git a/src/test/compile-fail/redundant-link-args.rs b/src/test/compile-fail/redundant-link-args.rs index 6a316886fe0..88d0e4a53ee 100644 --- a/src/test/compile-fail/redundant-link-args.rs +++ b/src/test/compile-fail/redundant-link-args.rs @@ -9,9 +9,11 @@ #[link_name= "m"] #[link_args="-foo"] // this could have been elided. extern mod m1 { + #[legacy_exports]; } #[link_name= "m"] #[link_args="-bar"] // this is the actual error trigger. extern mod m2 { + #[legacy_exports]; } diff --git a/src/test/compile-fail/regions-glb-free-free.rs b/src/test/compile-fail/regions-glb-free-free.rs index d7f6d42c74e..223665381da 100644 --- a/src/test/compile-fail/regions-glb-free-free.rs +++ b/src/test/compile-fail/regions-glb-free-free.rs @@ -1,4 +1,5 @@ mod argparse { + #[legacy_exports]; extern mod std; use either::{Either, Left, Right}; diff --git a/src/test/compile-fail/unused-imports-warn.rs b/src/test/compile-fail/unused-imports-warn.rs index da1fb692c06..24f423400aa 100644 --- a/src/test/compile-fail/unused-imports-warn.rs +++ b/src/test/compile-fail/unused-imports-warn.rs @@ -3,12 +3,15 @@ use cal = bar::c::cc; mod foo { + #[legacy_exports]; type point = {x: int, y: int}; type square = {p: point, h: uint, w: uint}; } mod bar { + #[legacy_exports]; mod c { + #[legacy_exports]; use foo::point; use foo::square; fn cc(p: point) -> str { return 2 * (p.x + p.y); } diff --git a/src/test/compile-fail/warn-ctypes-err-attr.rs b/src/test/compile-fail/warn-ctypes-err-attr.rs index de2849a78de..8c8bcd58a4f 100644 --- a/src/test/compile-fail/warn-ctypes-err-attr.rs +++ b/src/test/compile-fail/warn-ctypes-err-attr.rs @@ -3,6 +3,7 @@ #[nolink] extern mod libc { + #[legacy_exports]; fn malloc(size: int) -> *u8; } diff --git a/src/test/compile-fail/warn-ctypes.rs b/src/test/compile-fail/warn-ctypes.rs index 1bf05b4c190..76b18e7094c 100644 --- a/src/test/compile-fail/warn-ctypes.rs +++ b/src/test/compile-fail/warn-ctypes.rs @@ -2,6 +2,7 @@ // error-pattern:found rust type #[nolink] extern mod libc { + #[legacy_exports]; fn malloc(size: int) -> *u8; } diff --git a/src/test/compile-fail/warn-foreign-int-types.rs b/src/test/compile-fail/warn-foreign-int-types.rs index 4ff7d0edf05..8322a25543e 100644 --- a/src/test/compile-fail/warn-foreign-int-types.rs +++ b/src/test/compile-fail/warn-foreign-int-types.rs @@ -1,5 +1,6 @@ //error-pattern:libc::c_int or libc::c_long should be used extern mod xx { + #[legacy_exports]; fn strlen(str: *u8) -> uint; fn foo(x: int, y: uint); } diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index 71343c6751e..405cd5fdb84 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -3,6 +3,7 @@ // Instead the failure will be delivered after the callbacks return. extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index 83499baf0d0..d0b6f727b64 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -8,6 +8,7 @@ extern mod std; extern mod rustrt { + #[legacy_exports]; fn last_os_error() -> ~str; } diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/run-fail/run-unexported-tests.rs index 5991f0921ea..59da245d114 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/run-fail/run-unexported-tests.rs @@ -4,6 +4,7 @@ extern mod std; mod m { + #[legacy_exports]; export exported; fn exported() { } diff --git a/src/test/run-pass/alt-path.rs b/src/test/run-pass/alt-path.rs index cd8b21fc248..5c6ef554bb6 100644 --- a/src/test/run-pass/alt-path.rs +++ b/src/test/run-pass/alt-path.rs @@ -1,6 +1,7 @@ mod m1 { + #[legacy_exports]; enum foo { foo1, foo2, } } diff --git a/src/test/run-pass/attr-before-view-item2.rs b/src/test/run-pass/attr-before-view-item2.rs index e34bcd1ed44..94747db0a8a 100644 --- a/src/test/run-pass/attr-before-view-item2.rs +++ b/src/test/run-pass/attr-before-view-item2.rs @@ -1,6 +1,7 @@ // error-pattern:expected item mod m { + #[legacy_exports]; #[foo = "bar"] extern mod std; } diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index bd541e818ad..0cc828132c9 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -73,6 +73,7 @@ fn test_ptr() unsafe { #[abi = "cdecl"] #[nolink] extern mod test { + #[legacy_exports]; fn rust_get_sched_id() -> libc::intptr_t; fn get_task_id() -> libc::intptr_t; } diff --git a/src/test/run-pass/box-annihilator-shared.rs b/src/test/run-pass/box-annihilator-shared.rs index 768a828d7a2..5786b334af7 100644 --- a/src/test/run-pass/box-annihilator-shared.rs +++ b/src/test/run-pass/box-annihilator-shared.rs @@ -1,4 +1,5 @@ extern mod rustrt { + #[legacy_exports]; fn rust_annihilate_box(ptr: *uint); } diff --git a/src/test/run-pass/box-annihilator-unique-vec.rs b/src/test/run-pass/box-annihilator-unique-vec.rs index a01240b01f4..45449cc6382 100644 --- a/src/test/run-pass/box-annihilator-unique-vec.rs +++ b/src/test/run-pass/box-annihilator-unique-vec.rs @@ -1,4 +1,5 @@ extern mod rustrt { + #[legacy_exports]; fn rust_annihilate_box(ptr: *uint); } diff --git a/src/test/run-pass/box-annihilator-unique.rs b/src/test/run-pass/box-annihilator-unique.rs index 0198b5b1646..a2d11654f9a 100644 --- a/src/test/run-pass/box-annihilator-unique.rs +++ b/src/test/run-pass/box-annihilator-unique.rs @@ -1,4 +1,5 @@ extern mod rustrt { + #[legacy_exports]; fn rust_annihilate_box(ptr: *uint); } diff --git a/src/test/run-pass/c-stack-as-value.rs b/src/test/run-pass/c-stack-as-value.rs index 8164913d0f7..1046a0e78a2 100644 --- a/src/test/run-pass/c-stack-as-value.rs +++ b/src/test/run-pass/c-stack-as-value.rs @@ -1,5 +1,6 @@ #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn get_task_id() -> libc::intptr_t; } diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index 81c26f90486..e812e23bdea 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -3,6 +3,7 @@ extern mod std; #[abi = "cdecl"] #[nolink] extern mod libc { + #[legacy_exports]; fn atol(x: *u8) -> int; fn atoll(x: *u8) -> i64; } diff --git a/src/test/run-pass/class-exports.rs b/src/test/run-pass/class-exports.rs index ef036811976..58543158b07 100644 --- a/src/test/run-pass/class-exports.rs +++ b/src/test/run-pass/class-exports.rs @@ -4,6 +4,7 @@ use kitty::*; mod kitty { + #[legacy_exports]; export cat; struct cat { meows: uint, diff --git a/src/test/run-pass/companionmod.rc b/src/test/run-pass/companionmod.rc index f2547991d0c..8736345c982 100644 --- a/src/test/run-pass/companionmod.rc +++ b/src/test/run-pass/companionmod.rc @@ -1,13 +1,19 @@ // xfail-win32 don't understand what's wrong // Test that crates and directory modules can contain code +#[legacy_exports]; #[path = "companionmod-src"] mod a { + #[legacy_exports]; mod b { + #[legacy_exports]; + #[legacy_exports] mod x; } #[path = "d"] mod c { + #[legacy_exports]; + #[legacy_exports] mod x; } } diff --git a/src/test/run-pass/companionmod.rs b/src/test/run-pass/companionmod.rs index 99c21e06d3a..ff15fe58056 100644 --- a/src/test/run-pass/companionmod.rs +++ b/src/test/run-pass/companionmod.rs @@ -1,6 +1,7 @@ // This isn't really xfailed; it's used by the companionmod.rc test // xfail-test +#[legacy_exports]; fn main() { assert a::b::g() == ~"ralph"; assert a::c::g() == ~"nelson"; diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs index e0e0a3ef374..bc97114b581 100644 --- a/src/test/run-pass/conditional-compile.rs +++ b/src/test/run-pass/conditional-compile.rs @@ -6,13 +6,15 @@ const b: bool = true; #[cfg(bogus)] #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; // This symbol doesn't exist and would be a link error if this // module was translated fn bogus(); } #[abi = "cdecl"] -extern mod rustrt { } +extern mod rustrt { + #[legacy_exports]; } #[cfg(bogus)] type t = int; @@ -48,12 +50,14 @@ fn r(i:int) -> r { #[cfg(bogus)] mod m { + #[legacy_exports]; // This needs to parse but would fail in typeck. Since it's not in // the current config it should not be typechecked. fn bogus() { return 0; } } mod m { + #[legacy_exports]; // Submodules have slightly different code paths than the top-level // module, so let's make sure this jazz works here as well @@ -91,8 +95,10 @@ fn test_in_fn_ctxt() { } mod test_foreign_items { + #[legacy_exports]; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; #[cfg(bogus)] fn rust_getcwd() -> ~str; fn rust_getcwd() -> ~str; @@ -100,10 +106,12 @@ mod test_foreign_items { } mod test_use_statements { + #[legacy_exports]; #[cfg(bogus)] use flippity_foo; extern mod rustrt { + #[legacy_exports]; #[cfg(bogus)] use flippity_foo; } diff --git a/src/test/run-pass/crate-attributes-src/foo.rs b/src/test/run-pass/crate-attributes-src/foo.rs index 5ab36dfe00d..7086ebf2ea8 100644 --- a/src/test/run-pass/crate-attributes-src/foo.rs +++ b/src/test/run-pass/crate-attributes-src/foo.rs @@ -1,4 +1,5 @@ // These are attributes of the foo module +#[legacy_exports]; #[attr1 = "val"]; #[attr2 = "val"]; diff --git a/src/test/run-pass/crate-attributes.rc b/src/test/run-pass/crate-attributes.rc index 36304011a8c..2ee41913f40 100644 --- a/src/test/run-pass/crate-attributes.rc +++ b/src/test/run-pass/crate-attributes.rc @@ -4,8 +4,10 @@ #[attr1] #[path = "crate-attributes-src"] mod m { + #[legacy_exports]; #[attr_inner]; #[attr2] + #[legacy_exports] mod foo; } diff --git a/src/test/run-pass/crateresolve2.rs b/src/test/run-pass/crateresolve2.rs index c05254a80ab..cd1aad3e63f 100644 --- a/src/test/run-pass/crateresolve2.rs +++ b/src/test/run-pass/crateresolve2.rs @@ -4,16 +4,19 @@ // aux-build:crateresolve2-3.rs mod a { + #[legacy_exports]; extern mod crateresolve2(vers = "0.1"); fn f() { assert crateresolve2::f() == 10; } } mod b { + #[legacy_exports]; extern mod crateresolve2(vers = "0.2"); fn f() { assert crateresolve2::f() == 20; } } mod c { + #[legacy_exports]; extern mod crateresolve2(vers = "0.3"); fn f() { assert crateresolve2::f() == 30; } } diff --git a/src/test/run-pass/crateresolve3.rs b/src/test/run-pass/crateresolve3.rs index 57b8c1bfed8..db7a36e35bf 100644 --- a/src/test/run-pass/crateresolve3.rs +++ b/src/test/run-pass/crateresolve3.rs @@ -6,11 +6,13 @@ // as long as no name collision on invoked functions. mod a { + #[legacy_exports]; extern mod crateresolve3(vers = "0.1"); fn f() { assert crateresolve3::f() == 10; } } mod b { + #[legacy_exports]; extern mod crateresolve3(vers = "0.2"); fn f() { assert crateresolve3::g() == 20; } } diff --git a/src/test/run-pass/crateresolve4.rs b/src/test/run-pass/crateresolve4.rs index 28512dc0bdb..24764b4ba83 100644 --- a/src/test/run-pass/crateresolve4.rs +++ b/src/test/run-pass/crateresolve4.rs @@ -5,11 +5,13 @@ // aux-build:crateresolve4b-2.rs mod a { + #[legacy_exports]; extern mod crateresolve4b(vers = "0.1"); fn f() { assert crateresolve4b::f() == 20; } } mod b { + #[legacy_exports]; extern mod crateresolve4b(vers = "0.2"); fn f() { assert crateresolve4b::g() == 10; } } diff --git a/src/test/run-pass/export-abstract-tag.rs b/src/test/run-pass/export-abstract-tag.rs index eb76676ece6..b482f64ec8a 100644 --- a/src/test/run-pass/export-abstract-tag.rs +++ b/src/test/run-pass/export-abstract-tag.rs @@ -2,6 +2,7 @@ // sort of ADT. mod foo { + #[legacy_exports]; export t; export f; diff --git a/src/test/run-pass/export-glob-imports-target.rs b/src/test/run-pass/export-glob-imports-target.rs index 915393f05e1..500d74c1b87 100644 --- a/src/test/run-pass/export-glob-imports-target.rs +++ b/src/test/run-pass/export-glob-imports-target.rs @@ -4,8 +4,10 @@ // Modified to not use export since it's going away. --pcw mod foo { + #[legacy_exports]; use bar::*; mod bar { + #[legacy_exports]; const a : int = 10; } fn zum() { diff --git a/src/test/run-pass/export-glob.rs b/src/test/run-pass/export-glob.rs index 666bc7ef3ac..3f3ecb68250 100644 --- a/src/test/run-pass/export-glob.rs +++ b/src/test/run-pass/export-glob.rs @@ -4,9 +4,11 @@ // Modified to not use export since it's going away. --pcw mod foo { + #[legacy_exports]; use bar::*; export a; mod bar { + #[legacy_exports]; const a : int = 10; } } diff --git a/src/test/run-pass/export-multi.rs b/src/test/run-pass/export-multi.rs index 70af1a3bcaa..5e978df0017 100644 --- a/src/test/run-pass/export-multi.rs +++ b/src/test/run-pass/export-multi.rs @@ -2,6 +2,7 @@ use m::f; use m::g; mod m { + #[legacy_exports]; export f, g; fn f() { } diff --git a/src/test/run-pass/export-non-interference2.rs b/src/test/run-pass/export-non-interference2.rs index 206f8f239e0..345a7dec5ea 100644 --- a/src/test/run-pass/export-non-interference2.rs +++ b/src/test/run-pass/export-non-interference2.rs @@ -1,8 +1,10 @@ mod foo { + #[legacy_exports]; export bar; mod bar { + #[legacy_exports]; fn y() { x(); } } diff --git a/src/test/run-pass/export-non-interference3.rs b/src/test/run-pass/export-non-interference3.rs index 41cc6bd7d23..a0c9f35fa72 100644 --- a/src/test/run-pass/export-non-interference3.rs +++ b/src/test/run-pass/export-non-interference3.rs @@ -1,10 +1,12 @@ mod foo { + #[legacy_exports]; export x; fn x() { bar::x(); } } mod bar { + #[legacy_exports]; export x; fn x() { debug!("x"); } diff --git a/src/test/run-pass/export-tag-variant.rs b/src/test/run-pass/export-tag-variant.rs index ccdb235164c..c8d0267a73f 100644 --- a/src/test/run-pass/export-tag-variant.rs +++ b/src/test/run-pass/export-tag-variant.rs @@ -1,6 +1,7 @@ // Export the enum variants, without the enum mod foo { + #[legacy_exports]; export t1; enum t { t1, } } diff --git a/src/test/run-pass/export-unexported-dep.rs b/src/test/run-pass/export-unexported-dep.rs index 1d0e64dc366..65cbb7e30ee 100644 --- a/src/test/run-pass/export-unexported-dep.rs +++ b/src/test/run-pass/export-unexported-dep.rs @@ -2,6 +2,7 @@ // that are not exported, allowing for a sort of poor-man's ADT mod foo { + #[legacy_exports]; export f; export g; diff --git a/src/test/run-pass/expr-scope.rs b/src/test/run-pass/expr-scope.rs index d974b1ec5a9..e0e79788acd 100644 --- a/src/test/run-pass/expr-scope.rs +++ b/src/test/run-pass/expr-scope.rs @@ -1,5 +1,7 @@ // Regression test for issue #762 // xfail-fast +#[legacy_exports]; + fn f() { } fn main() { return ::f(); } diff --git a/src/test/run-pass/extern-call-deep.rs b/src/test/run-pass/extern-call-deep.rs index 05404032a73..e275bcedf38 100644 --- a/src/test/run-pass/extern-call-deep.rs +++ b/src/test/run-pass/extern-call-deep.rs @@ -1,4 +1,5 @@ extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/run-pass/extern-call-deep2.rs b/src/test/run-pass/extern-call-deep2.rs index 23a34a45d8d..aae46660b31 100644 --- a/src/test/run-pass/extern-call-deep2.rs +++ b/src/test/run-pass/extern-call-deep2.rs @@ -1,4 +1,5 @@ extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/run-pass/extern-call-scrub.rs b/src/test/run-pass/extern-call-scrub.rs index 49e55cca1c8..58677d18c1f 100644 --- a/src/test/run-pass/extern-call-scrub.rs +++ b/src/test/run-pass/extern-call-scrub.rs @@ -3,6 +3,7 @@ // directions extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/run-pass/extern-call.rs b/src/test/run-pass/extern-call.rs index 6f8cfc28860..5fb62e7c185 100644 --- a/src/test/run-pass/extern-call.rs +++ b/src/test/run-pass/extern-call.rs @@ -1,4 +1,5 @@ extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/run-pass/extern-stress.rs b/src/test/run-pass/extern-stress.rs index dc3ac7001e1..ef2ab539d05 100644 --- a/src/test/run-pass/extern-stress.rs +++ b/src/test/run-pass/extern-stress.rs @@ -2,6 +2,7 @@ // while holding onto C stacks extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/run-pass/extern-yield.rs b/src/test/run-pass/extern-yield.rs index eff78a6f0ad..890bb90a35e 100644 --- a/src/test/run-pass/extern-yield.rs +++ b/src/test/run-pass/extern-yield.rs @@ -1,4 +1,5 @@ extern mod rustrt { + #[legacy_exports]; fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } diff --git a/src/test/run-pass/foreign-dupe.rs b/src/test/run-pass/foreign-dupe.rs index b780e95f544..24077785f4a 100644 --- a/src/test/run-pass/foreign-dupe.rs +++ b/src/test/run-pass/foreign-dupe.rs @@ -4,12 +4,14 @@ #[abi = "cdecl"] #[link_name = "rustrt"] extern mod rustrt1 { + #[legacy_exports]; fn last_os_error() -> ~str; } #[abi = "cdecl"] #[link_name = "rustrt"] extern mod rustrt2 { + #[legacy_exports]; fn last_os_error() -> ~str; } diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index 22b35eca9f2..b55eb9445cf 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -4,6 +4,7 @@ extern mod std; #[nolink] #[abi = "cdecl"] extern mod libc { + #[legacy_exports]; #[link_name = "strlen"] fn my_strlen(str: *u8) -> uint; } diff --git a/src/test/run-pass/foreign-lib-path.rs b/src/test/run-pass/foreign-lib-path.rs index 99bf3c714f9..b777e6f9a70 100644 --- a/src/test/run-pass/foreign-lib-path.rs +++ b/src/test/run-pass/foreign-lib-path.rs @@ -6,6 +6,7 @@ // wouthout providing a -L argument to the compiler, and that // will also be found successfully at runtime. extern mod WHATGOESHERE { + #[legacy_exports]; fn IDONTKNOW() -> u32; } diff --git a/src/test/run-pass/foreign-mod-unused-const.rs b/src/test/run-pass/foreign-mod-unused-const.rs index 0c52a3e34af..a8cb2d2eae2 100644 --- a/src/test/run-pass/foreign-mod-unused-const.rs +++ b/src/test/run-pass/foreign-mod-unused-const.rs @@ -1,5 +1,6 @@ #[nolink] extern mod foo { + #[legacy_exports]; const errno: int; } diff --git a/src/test/run-pass/foreign-no-abi.rs b/src/test/run-pass/foreign-no-abi.rs index 8d9e7c50ac6..5a5641f7e1f 100644 --- a/src/test/run-pass/foreign-no-abi.rs +++ b/src/test/run-pass/foreign-no-abi.rs @@ -1,6 +1,7 @@ // ABI is cdecl by default extern mod rustrt { + #[legacy_exports]; fn get_task_id() -> libc::intptr_t; } diff --git a/src/test/run-pass/foreign-struct.rs b/src/test/run-pass/foreign-struct.rs index f88f47dd981..d9389eb6ac9 100644 --- a/src/test/run-pass/foreign-struct.rs +++ b/src/test/run-pass/foreign-struct.rs @@ -5,6 +5,7 @@ enum void { } #[nolink] extern mod bindgen { + #[legacy_exports]; fn printf(++v: void); } diff --git a/src/test/run-pass/foreign2.rs b/src/test/run-pass/foreign2.rs index 9d1ad60cc92..a2678225658 100644 --- a/src/test/run-pass/foreign2.rs +++ b/src/test/run-pass/foreign2.rs @@ -1,20 +1,24 @@ #[abi = "cdecl"] #[nolink] -extern mod bar { } +extern mod bar { + #[legacy_exports]; } #[abi = "cdecl"] #[nolink] -extern mod zed { } +extern mod zed { + #[legacy_exports]; } #[abi = "cdecl"] #[nolink] extern mod libc { + #[legacy_exports]; fn write(fd: int, buf: *u8, count: core::libc::size_t) -> core::libc::ssize_t; } #[abi = "cdecl"] #[nolink] -extern mod baz { } +extern mod baz { + #[legacy_exports]; } fn main(args: ~[~str]) { } diff --git a/src/test/run-pass/generic-fn-twice.rs b/src/test/run-pass/generic-fn-twice.rs index ae972fbd0d0..bd2bb3cff63 100644 --- a/src/test/run-pass/generic-fn-twice.rs +++ b/src/test/run-pass/generic-fn-twice.rs @@ -3,6 +3,7 @@ // -*- rust -*- mod foomod { + #[legacy_exports]; fn foo<T>() { } } diff --git a/src/test/run-pass/global-scope.rs b/src/test/run-pass/global-scope.rs index 89181c15691..66b86465cc4 100644 --- a/src/test/run-pass/global-scope.rs +++ b/src/test/run-pass/global-scope.rs @@ -1,8 +1,11 @@ // xfail-fast +#[legacy_exports]; + fn f() -> int { return 1; } mod foo { + #[legacy_exports]; fn f() -> int { return 2; } fn g() { assert (f() == 2); assert (::f() == 1); } } diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 9e0727471e2..24163cfa566 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -18,6 +18,7 @@ use comm::recv; fn map(filename: ~str, emit: map_reduce::putter) { emit(filename, ~"1"); } mod map_reduce { + #[legacy_exports]; export putter; export mapper; export map_reduce; diff --git a/src/test/run-pass/import-from-foreign.rs b/src/test/run-pass/import-from-foreign.rs index 9b71b0862dd..e9eec1c6a2a 100644 --- a/src/test/run-pass/import-from-foreign.rs +++ b/src/test/run-pass/import-from-foreign.rs @@ -1,10 +1,12 @@ mod spam { + #[legacy_exports]; fn ham() { } fn eggs() { } } #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; use spam::{ham, eggs}; export ham; export eggs; diff --git a/src/test/run-pass/import-from.rs b/src/test/run-pass/import-from.rs index 5892a729c68..814f31bc011 100644 --- a/src/test/run-pass/import-from.rs +++ b/src/test/run-pass/import-from.rs @@ -1,6 +1,7 @@ use spam::{ham, eggs}; mod spam { + #[legacy_exports]; fn ham() { } fn eggs() { } } diff --git a/src/test/run-pass/import-glob-0.rs b/src/test/run-pass/import-glob-0.rs index d9f0cd4181c..9ba29123388 100644 --- a/src/test/run-pass/import-glob-0.rs +++ b/src/test/run-pass/import-glob-0.rs @@ -2,6 +2,7 @@ use module_of_many_things::*; use dug::too::greedily::and::too::deep::*; mod module_of_many_things { + #[legacy_exports]; export f1; export f2; export f4; @@ -12,11 +13,17 @@ mod module_of_many_things { } mod dug { + #[legacy_exports]; mod too { + #[legacy_exports]; mod greedily { + #[legacy_exports]; mod and { + #[legacy_exports]; mod too { + #[legacy_exports]; mod deep { + #[legacy_exports]; fn nameless_fear() { debug!("Boo!"); } fn also_redstone() { debug!("Whatever."); } } diff --git a/src/test/run-pass/import-glob-1.rs b/src/test/run-pass/import-glob-1.rs index 49bbc7d5881..5039a7344df 100644 --- a/src/test/run-pass/import-glob-1.rs +++ b/src/test/run-pass/import-glob-1.rs @@ -1,8 +1,10 @@ use a1::b1::word_traveler; mod a1 { + #[legacy_exports]; // mod b1 { + #[legacy_exports]; // use a2::b1::*; // <-\ @@ -10,6 +12,7 @@ mod a1 { } // | mod b2 { + #[legacy_exports]; // | use a2::b2::*; // <-\ -\ | @@ -19,10 +22,12 @@ mod a1 { // | | | // | | | mod a2 { + #[legacy_exports]; // | | | #[abi = "cdecl"] #[nolink] extern mod b1 { + #[legacy_exports]; // | | | use a1::b2::*; // | <-/ -/ @@ -30,6 +35,7 @@ mod a2 { } // | mod b2 { + #[legacy_exports]; // | fn word_traveler() { // | debug!("ahoy!"); // -/ diff --git a/src/test/run-pass/import-trailing-comma.rs b/src/test/run-pass/import-trailing-comma.rs index 0a27ccc24a2..2e4e29c2d71 100644 --- a/src/test/run-pass/import-trailing-comma.rs +++ b/src/test/run-pass/import-trailing-comma.rs @@ -1,7 +1,9 @@ use foo::bar::{baz, quux,}; mod foo { + #[legacy_exports]; mod bar { + #[legacy_exports]; fn baz() { } fn quux() { } } diff --git a/src/test/run-pass/import.rs b/src/test/run-pass/import.rs index b0ee5439370..3a2b8996c4d 100644 --- a/src/test/run-pass/import.rs +++ b/src/test/run-pass/import.rs @@ -1,8 +1,10 @@ mod foo { + #[legacy_exports]; fn x(y: int) { log(debug, y); } } mod bar { + #[legacy_exports]; use foo::x; use z = foo::x; fn thing() { x(10); z(10); } diff --git a/src/test/run-pass/import2.rs b/src/test/run-pass/import2.rs index ab9d5222734..1cb58ffb911 100644 --- a/src/test/run-pass/import2.rs +++ b/src/test/run-pass/import2.rs @@ -2,6 +2,7 @@ use zed::bar; mod zed { + #[legacy_exports]; fn bar() { debug!("bar"); } } diff --git a/src/test/run-pass/import3.rs b/src/test/run-pass/import3.rs index 2c208593d1e..3fd1fecd607 100644 --- a/src/test/run-pass/import3.rs +++ b/src/test/run-pass/import3.rs @@ -3,7 +3,9 @@ use baz::zed; use zed::bar; mod baz { + #[legacy_exports]; mod zed { + #[legacy_exports]; fn bar() { debug!("bar2"); } } } diff --git a/src/test/run-pass/import4.rs b/src/test/run-pass/import4.rs index 49ec8babe24..4a9f78a069b 100644 --- a/src/test/run-pass/import4.rs +++ b/src/test/run-pass/import4.rs @@ -2,6 +2,7 @@ use zed::bar; mod zed { + #[legacy_exports]; fn bar() { debug!("bar"); } } diff --git a/src/test/run-pass/import5.rs b/src/test/run-pass/import5.rs index 3fab08badb9..5a00df6833d 100644 --- a/src/test/run-pass/import5.rs +++ b/src/test/run-pass/import5.rs @@ -1,8 +1,10 @@ use foo::bar; mod foo { + #[legacy_exports]; use zed::bar; export bar; mod zed { + #[legacy_exports]; fn bar() { debug!("foo"); } } } diff --git a/src/test/run-pass/import6.rs b/src/test/run-pass/import6.rs index 800429857e8..ee1cd582099 100644 --- a/src/test/run-pass/import6.rs +++ b/src/test/run-pass/import6.rs @@ -1,11 +1,14 @@ use foo::zed; use bar::baz; mod foo { + #[legacy_exports]; mod zed { + #[legacy_exports]; fn baz() { debug!("baz"); } } } mod bar { + #[legacy_exports]; use zed::baz; export baz; } diff --git a/src/test/run-pass/import7.rs b/src/test/run-pass/import7.rs index 5f2e8caaa79..e1a0235b030 100644 --- a/src/test/run-pass/import7.rs +++ b/src/test/run-pass/import7.rs @@ -1,15 +1,20 @@ use foo::zed; use bar::baz; mod foo { + #[legacy_exports]; mod zed { + #[legacy_exports]; fn baz() { debug!("baz"); } } } mod bar { + #[legacy_exports]; use zed::baz; export baz; mod foo { - mod zed { } + #[legacy_exports]; + mod zed { + #[legacy_exports]; } } } fn main(args: ~[~str]) { baz(); } diff --git a/src/test/run-pass/import8.rs b/src/test/run-pass/import8.rs index 8e51fb8c1b1..51d99da4302 100644 --- a/src/test/run-pass/import8.rs +++ b/src/test/run-pass/import8.rs @@ -3,6 +3,7 @@ use foo::x; use z = foo::x; mod foo { + #[legacy_exports]; fn x(y: int) { log(debug, y); } } diff --git a/src/test/run-pass/inner-module.rs b/src/test/run-pass/inner-module.rs index 65d9ce269de..f65a66db559 100644 --- a/src/test/run-pass/inner-module.rs +++ b/src/test/run-pass/inner-module.rs @@ -3,7 +3,9 @@ // -*- rust -*- mod inner { + #[legacy_exports]; mod inner2 { + #[legacy_exports]; fn hello() { debug!("hello, modular world"); } } fn hello() { inner2::hello(); } diff --git a/src/test/run-pass/intrinsic-alignment.rs b/src/test/run-pass/intrinsic-alignment.rs index d379693de8c..ad46eec8882 100644 --- a/src/test/run-pass/intrinsic-alignment.rs +++ b/src/test/run-pass/intrinsic-alignment.rs @@ -2,6 +2,7 @@ #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn pref_align_of<T>() -> uint; fn min_align_of<T>() -> uint; } @@ -10,6 +11,7 @@ extern mod rusti { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] mod m { + #[legacy_exports]; #[cfg(target_arch = "x86")] fn main() { assert rusti::pref_align_of::<u64>() == 8u; @@ -25,6 +27,7 @@ mod m { #[cfg(target_os = "win32")] mod m { + #[legacy_exports]; #[cfg(target_arch = "x86")] fn main() { assert rusti::pref_align_of::<u64>() == 8u; diff --git a/src/test/run-pass/intrinsic-atomics.rs b/src/test/run-pass/intrinsic-atomics.rs index 512e0edbec9..2629afa4909 100644 --- a/src/test/run-pass/intrinsic-atomics.rs +++ b/src/test/run-pass/intrinsic-atomics.rs @@ -1,5 +1,6 @@ #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn atomic_xchg(dst: &mut int, src: int) -> int; fn atomic_xchg_acq(dst: &mut int, src: int) -> int; fn atomic_xchg_rel(dst: &mut int, src: int) -> int; diff --git a/src/test/run-pass/intrinsic-frame-address.rs b/src/test/run-pass/intrinsic-frame-address.rs index 25ee6424913..ba28c5ea8a6 100644 --- a/src/test/run-pass/intrinsic-frame-address.rs +++ b/src/test/run-pass/intrinsic-frame-address.rs @@ -2,6 +2,7 @@ #[legacy_modes]; #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn frame_address(f: fn(*u8)); } diff --git a/src/test/run-pass/intrinsic-move-val.rs b/src/test/run-pass/intrinsic-move-val.rs index 80dcf2a4199..b7f2115f45d 100644 --- a/src/test/run-pass/intrinsic-move-val.rs +++ b/src/test/run-pass/intrinsic-move-val.rs @@ -1,5 +1,6 @@ #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn move_val_init<T>(&dst: T, -src: T); fn move_val<T>(&dst: T, -src: T); } diff --git a/src/test/run-pass/issue-1251.rs b/src/test/run-pass/issue-1251.rs index ae38bdf4a75..0417c18b844 100644 --- a/src/test/run-pass/issue-1251.rs +++ b/src/test/run-pass/issue-1251.rs @@ -1,6 +1,7 @@ #[link(name = "get_task_id")]; extern mod rustrt { + #[legacy_exports]; fn get_task_id() -> libc::intptr_t; } diff --git a/src/test/run-pass/issue-1866.rs b/src/test/run-pass/issue-1866.rs index c7219fbc2d9..b6435a8ff20 100644 --- a/src/test/run-pass/issue-1866.rs +++ b/src/test/run-pass/issue-1866.rs @@ -1,14 +1,18 @@ // xfail-test mod a { + #[legacy_exports]; type rust_task = uint; extern mod rustrt { + #[legacy_exports]; fn rust_task_is_unwinding(rt: *rust_task) -> bool; } } mod b { + #[legacy_exports]; type rust_task = bool; extern mod rustrt { + #[legacy_exports]; fn rust_task_is_unwinding(rt: *rust_task) -> bool; } } diff --git a/src/test/run-pass/issue-2214.rs b/src/test/run-pass/issue-2214.rs index 82678c1c081..11437f6cf45 100644 --- a/src/test/run-pass/issue-2214.rs +++ b/src/test/run-pass/issue-2214.rs @@ -12,6 +12,7 @@ fn lgamma(n: c_double, value: &mut int) -> c_double { #[link_name = "m"] #[abi = "cdecl"] extern mod m { + #[legacy_exports]; #[cfg(unix)] #[link_name="lgamma_r"] fn lgamma(n: c_double, sign: &mut c_int) -> c_double; diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 3122985d6b5..6da4349ba5f 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -1,4 +1,5 @@ mod pipes { + #[legacy_exports]; use cast::{forget, transmute}; enum state { @@ -32,6 +33,7 @@ mod pipes { #[abi = "rust-intrinsic"] mod rusti { + #[legacy_exports]; fn atomic_xchg(_dst: &mut int, _src: int) -> int { fail; } fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { fail; } fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { fail; } @@ -193,6 +195,7 @@ mod pipes { } mod pingpong { + #[legacy_exports]; enum ping = pipes::send_packet<pong>; enum pong = pipes::send_packet<ping>; @@ -219,6 +222,7 @@ mod pingpong { } mod client { + #[legacy_exports]; type ping = pipes::send_packet<pingpong::ping>; type pong = pipes::recv_packet<pingpong::pong>; @@ -239,6 +243,7 @@ mod pingpong { } mod server { + #[legacy_exports]; type ping = pipes::recv_packet<pingpong::ping>; type pong = pipes::send_packet<pingpong::pong>; diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 71ba9b65cef..704e8f79fb1 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -61,6 +61,7 @@ fn read_board_grid<rdr: Owned io::Reader>(+in: rdr) -> ~[~[square]] { } mod test { + #[legacy_exports]; #[test] fn trivial_to_str() { assert lambda.to_str() == "\\" diff --git a/src/test/run-pass/issue-506.rs b/src/test/run-pass/issue-506.rs index 730efcc9f34..93669c44896 100644 --- a/src/test/run-pass/issue-506.rs +++ b/src/test/run-pass/issue-506.rs @@ -8,6 +8,7 @@ extern mod std; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; fn rust_dbg_do_nothing(); } diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index 07f824f7ae6..a3451da6f9a 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -15,9 +15,11 @@ // These are are attributes of the following mod #[attr1 = "val"] #[attr2 = "val"] -mod test_first_item_in_file_mod { } +mod test_first_item_in_file_mod { + #[legacy_exports]; } mod test_single_attr_outer { + #[legacy_exports]; #[attr = "val"] const x: int = 10; @@ -26,14 +28,17 @@ mod test_single_attr_outer { fn f() { } #[attr = "val"] - mod mod1 { } + mod mod1 { + #[legacy_exports]; } #[attr = "val"] #[abi = "cdecl"] - extern mod rustrt { } + extern mod rustrt { + #[legacy_exports]; } } mod test_multi_attr_outer { + #[legacy_exports]; #[attr1 = "val"] #[attr2 = "val"] @@ -45,12 +50,14 @@ mod test_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] - mod mod1 { } + mod mod1 { + #[legacy_exports]; } #[attr1 = "val"] #[attr2 = "val"] #[abi = "cdecl"] - extern mod rustrt { } + extern mod rustrt { + #[legacy_exports]; } #[attr1 = "val"] #[attr2 = "val"] @@ -58,6 +65,7 @@ mod test_multi_attr_outer { } mod test_stmt_single_attr_outer { + #[legacy_exports]; fn f() { @@ -70,17 +78,20 @@ mod test_stmt_single_attr_outer { /* FIXME: Issue #493 #[attr = "val"] mod mod1 { + #[legacy_exports]; } #[attr = "val"] #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; } */ } } mod test_stmt_multi_attr_outer { + #[legacy_exports]; fn f() { @@ -96,28 +107,34 @@ mod test_stmt_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] mod mod1 { + #[legacy_exports]; } #[attr1 = "val"] #[attr2 = "val"] #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; } */ } } mod test_attr_inner { + #[legacy_exports]; mod m { + #[legacy_exports]; // This is an attribute of mod m #[attr = "val"]; } } mod test_attr_inner_then_outer { + #[legacy_exports]; mod m { + #[legacy_exports]; // This is an attribute of mod m #[attr = "val"]; // This is an attribute of fn f @@ -127,7 +144,9 @@ mod test_attr_inner_then_outer { } mod test_attr_inner_then_outer_multi { + #[legacy_exports]; mod m { + #[legacy_exports]; // This is an attribute of mod m #[attr1 = "val"]; #[attr2 = "val"]; @@ -139,6 +158,7 @@ mod test_attr_inner_then_outer_multi { } mod test_distinguish_syntax_ext { + #[legacy_exports]; extern mod std; @@ -150,6 +170,7 @@ mod test_distinguish_syntax_ext { } mod test_other_forms { + #[legacy_exports]; #[attr] #[attr(word)] #[attr(attr(word))] @@ -158,8 +179,10 @@ mod test_other_forms { } mod test_foreign_items { + #[legacy_exports]; #[abi = "cdecl"] extern mod rustrt { + #[legacy_exports]; #[attr]; #[attr] @@ -168,6 +191,7 @@ mod test_foreign_items { } mod test_literals { + #[legacy_exports]; #[str = "s"]; #[char = 'c']; #[int = 100]; @@ -177,7 +201,8 @@ mod test_literals { #[mach_float = 1.0f32]; #[nil = ()]; #[bool = true]; - mod m { } + mod m { + #[legacy_exports]; } } fn test_fn_inner() { diff --git a/src/test/run-pass/item-name-overload.rs b/src/test/run-pass/item-name-overload.rs index 02930d65cfa..d05419d155c 100644 --- a/src/test/run-pass/item-name-overload.rs +++ b/src/test/run-pass/item-name-overload.rs @@ -3,10 +3,12 @@ // -*- rust -*- mod foo { + #[legacy_exports]; fn baz() { } } mod bar { + #[legacy_exports]; fn baz() { } } diff --git a/src/test/run-pass/keyword-changes-2012-07-31.rs b/src/test/run-pass/keyword-changes-2012-07-31.rs index 95ac37c66b7..48c78c959ce 100644 --- a/src/test/run-pass/keyword-changes-2012-07-31.rs +++ b/src/test/run-pass/keyword-changes-2012-07-31.rs @@ -6,6 +6,7 @@ fn main() { } mod foo { + #[legacy_exports]; } fn bar() -> int { diff --git a/src/test/run-pass/mod-inside-fn.rs b/src/test/run-pass/mod-inside-fn.rs index 96c7101cdc3..9f13966eefb 100644 --- a/src/test/run-pass/mod-inside-fn.rs +++ b/src/test/run-pass/mod-inside-fn.rs @@ -1,5 +1,6 @@ fn f() -> int { mod m { + #[legacy_exports]; fn g() -> int { 720 } } diff --git a/src/test/run-pass/mod-view-items.rs b/src/test/run-pass/mod-view-items.rs index cb99d211baf..c849fc01b66 100644 --- a/src/test/run-pass/mod-view-items.rs +++ b/src/test/run-pass/mod-view-items.rs @@ -5,6 +5,7 @@ // begin failing. mod m { + #[legacy_exports]; use core::vec; fn f() -> ~[int] { vec::from_elem(1u, 0) } } diff --git a/src/test/run-pass/module-polymorphism.rc b/src/test/run-pass/module-polymorphism.rc index 938a594ccae..bce2d80e045 100644 --- a/src/test/run-pass/module-polymorphism.rc +++ b/src/test/run-pass/module-polymorphism.rc @@ -1,42 +1,51 @@ #[path = "module-polymorphism-files"] mod my_float { + #[legacy_exports]; // The type of the float use inst::T; // Define T as float #[path = "inst_float.rs"] + #[legacy_exports] mod inst; // Add in the implementation from a single source file #[path = "template.rs"] + #[legacy_exports] mod template; } #[path = "module-polymorphism-files"] mod my_f64 { + #[legacy_exports]; use inst::T; // Define T as f64 #[path = "inst_f64.rs"] + #[legacy_exports] mod inst; // Use the implementation for the same source file! #[path = "template.rs"] + #[legacy_exports] mod template; } #[path = "module-polymorphism-files"] mod my_f32 { + #[legacy_exports]; use inst::T; #[path = "inst_f32.rs"] + #[legacy_exports] mod inst; #[path = "template.rs"] + #[legacy_exports] mod template; } diff --git a/src/test/run-pass/module-polymorphism2.rc b/src/test/run-pass/module-polymorphism2.rc index 0c25f454625..49cd60fc0a9 100644 --- a/src/test/run-pass/module-polymorphism2.rc +++ b/src/test/run-pass/module-polymorphism2.rc @@ -1,8 +1,10 @@ #[path = "module-polymorphism2-files"] mod mystd { + #[legacy_exports]; #[path = "float-template"] mod float { + #[legacy_exports]; // The type of the float use inst::T; @@ -12,16 +14,19 @@ mod mystd { // Define T as float #[path = "inst_float.rs"] + #[legacy_exports] mod inst; // Add in the implementation from a single source file #[path = "template.rs"] + #[legacy_exports] mod template; } #[path = "float-template"] mod f64 { + #[legacy_exports]; use inst::T; @@ -31,16 +36,19 @@ mod mystd { // Define T as f64 #[path = "inst_f64.rs"] + #[legacy_exports] mod inst; // Use the implementation for the same source file! #[path = "template.rs"] + #[legacy_exports] mod template; } #[path = "float-template"] mod f32 { + #[legacy_exports]; use inst::T; // Unfortunate @@ -48,9 +56,11 @@ mod mystd { export plus; #[path = "inst_f32.rs"] + #[legacy_exports] mod inst; #[path = "template.rs"] + #[legacy_exports] mod template; } diff --git a/src/test/run-pass/module-polymorphism3.rc b/src/test/run-pass/module-polymorphism3.rc index 3b3a5133b52..27d9753d9d5 100644 --- a/src/test/run-pass/module-polymorphism3.rc +++ b/src/test/run-pass/module-polymorphism3.rc @@ -3,10 +3,12 @@ #[path = "module-polymorphism3-files"] mod mystd { + #[legacy_exports]; // The template is specified in float-template.rs #[path = "float-template"] mod float { + #[legacy_exports]; // The type of the float use inst::T; @@ -18,6 +20,7 @@ mod mystd { // Use the same template #[path = "float-template"] mod f64 { + #[legacy_exports]; use inst::T; @@ -28,6 +31,7 @@ mod mystd { #[path = "float-template"] mod f32 { + #[legacy_exports]; use inst::T; #[path = "inst_f32.rs"] diff --git a/src/test/run-pass/module-polymorphism4.rc b/src/test/run-pass/module-polymorphism4.rc index 6218948b814..4cb7acf8f03 100644 --- a/src/test/run-pass/module-polymorphism4.rc +++ b/src/test/run-pass/module-polymorphism4.rc @@ -1,26 +1,32 @@ #[path = "module-polymorphism4-files"] mod cat { + #[legacy_exports]; use inst::*; #[path = "cat.rs"] + #[legacy_exports] mod inst; #[path = "trait_.rs"] + #[legacy_exports] mod trait_; } #[path = "module-polymorphism4-files"] mod dog { + #[legacy_exports]; use inst::*; #[path = "dog.rs"] + #[legacy_exports] mod inst; #[path = "trait_.rs"] + #[legacy_exports] mod trait_; } diff --git a/src/test/run-pass/morestack-address.rs b/src/test/run-pass/morestack-address.rs index 7f0adcf0920..5779bd356e9 100644 --- a/src/test/run-pass/morestack-address.rs +++ b/src/test/run-pass/morestack-address.rs @@ -1,6 +1,7 @@ #[nolink] #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn morestack_addr() -> *(); } diff --git a/src/test/run-pass/morestack6.rs b/src/test/run-pass/morestack6.rs index deca22de643..0d44e264688 100644 --- a/src/test/run-pass/morestack6.rs +++ b/src/test/run-pass/morestack6.rs @@ -2,6 +2,7 @@ // external symbols as close to the red zone as possible. extern mod rustrt { + #[legacy_exports]; fn debug_get_stk_seg() -> *u8; fn rust_get_sched_id() -> libc::intptr_t; diff --git a/src/test/run-pass/multi.rc b/src/test/run-pass/multi.rc index 7a89ac915ce..61c81030bba 100644 --- a/src/test/run-pass/multi.rc +++ b/src/test/run-pass/multi.rc @@ -1,8 +1,11 @@ #[path = "multi-src"] mod multi { + #[legacy_exports]; // implicitly #[path = "foo.rs"] + #[legacy_exports] mod foo; #[path = "bar.rs"] + #[legacy_exports] mod bar; } diff --git a/src/test/run-pass/nil-decl-in-foreign.rs b/src/test/run-pass/nil-decl-in-foreign.rs index b35b81b11e2..5711e6df555 100644 --- a/src/test/run-pass/nil-decl-in-foreign.rs +++ b/src/test/run-pass/nil-decl-in-foreign.rs @@ -1,6 +1,7 @@ // Issue #901 #[nolink] extern mod libc { + #[legacy_exports]; fn printf(x: ()); } fn main() { } \ No newline at end of file diff --git a/src/test/run-pass/path.rs b/src/test/run-pass/path.rs index 345f93f760d..47440d2fa5b 100644 --- a/src/test/run-pass/path.rs +++ b/src/test/run-pass/path.rs @@ -1,6 +1,7 @@ mod foo { + #[legacy_exports]; fn bar(offset: uint) { } } diff --git a/src/test/run-pass/pipe-pingpong-bounded.rs b/src/test/run-pass/pipe-pingpong-bounded.rs index 2c8359991de..f9f091131ab 100644 --- a/src/test/run-pass/pipe-pingpong-bounded.rs +++ b/src/test/run-pass/pipe-pingpong-bounded.rs @@ -7,6 +7,7 @@ // This was generated initially by the pipe compiler, but it's been // modified in hopefully straightforward ways. mod pingpong { + #[legacy_exports]; use pipes::*; type packets = { @@ -33,6 +34,7 @@ mod pingpong { enum ping = server::pong; enum pong = client::ping; mod client { + #[legacy_exports]; fn ping(+pipe: ping) -> pong { { let b = pipe.reuse_buffer(); @@ -49,6 +51,7 @@ mod pingpong { pingpong::packets>; } mod server { + #[legacy_exports]; type ping = pipes::RecvPacketBuffered<pingpong::ping, pingpong::packets>; fn pong(+pipe: pong) -> ping { @@ -67,6 +70,7 @@ mod pingpong { } mod test { + #[legacy_exports]; use pipes::recv; use pingpong::{ping, pong}; diff --git a/src/test/run-pass/pipe-pingpong-proto.rs b/src/test/run-pass/pipe-pingpong-proto.rs index 7d70e2bdb68..7af00e8dbf2 100644 --- a/src/test/run-pass/pipe-pingpong-proto.rs +++ b/src/test/run-pass/pipe-pingpong-proto.rs @@ -13,6 +13,7 @@ proto! pingpong ( ) mod test { + #[legacy_exports]; use pipes::recv; use pingpong::{ping, pong}; diff --git a/src/test/run-pass/rec-align-u32.rs b/src/test/run-pass/rec-align-u32.rs index 29fd81df9bc..93ef8e755f4 100644 --- a/src/test/run-pass/rec-align-u32.rs +++ b/src/test/run-pass/rec-align-u32.rs @@ -3,6 +3,7 @@ #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn pref_align_of<T>() -> uint; fn min_align_of<T>() -> uint; } @@ -22,12 +23,14 @@ type outer = { #[cfg(target_arch = "x86")] mod m { + #[legacy_exports]; fn align() -> uint { 4u } fn size() -> uint { 8u } } #[cfg(target_arch = "x86_64")] mod m { + #[legacy_exports]; fn align() -> uint { 4u } fn size() -> uint { 8u } } diff --git a/src/test/run-pass/rec-align-u64.rs b/src/test/run-pass/rec-align-u64.rs index d4c9028b900..24400b8d340 100644 --- a/src/test/run-pass/rec-align-u64.rs +++ b/src/test/run-pass/rec-align-u64.rs @@ -3,6 +3,7 @@ #[abi = "rust-intrinsic"] extern mod rusti { + #[legacy_exports]; fn pref_align_of<T>() -> uint; fn min_align_of<T>() -> uint; } @@ -24,14 +25,17 @@ type outer = { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] mod m { + #[legacy_exports]; #[cfg(target_arch = "x86")] mod m { + #[legacy_exports]; fn align() -> uint { 4u } fn size() -> uint { 12u } } #[cfg(target_arch = "x86_64")] mod m { + #[legacy_exports]; fn align() -> uint { 8u } fn size() -> uint { 16u } } @@ -39,8 +43,10 @@ mod m { #[cfg(target_os = "win32")] mod m { + #[legacy_exports]; #[cfg(target_arch = "x86")] mod m { + #[legacy_exports]; fn align() -> uint { 8u } fn size() -> uint { 16u } } diff --git a/src/test/run-pass/rt-sched-1.rs b/src/test/run-pass/rt-sched-1.rs index b96fd5edd92..9604dff64d7 100644 --- a/src/test/run-pass/rt-sched-1.rs +++ b/src/test/run-pass/rt-sched-1.rs @@ -9,6 +9,7 @@ type task = *libc::c_void; type closure = *libc::c_void; extern mod rustrt { + #[legacy_exports]; fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id; fn rust_get_sched_id() -> sched_id; fn rust_new_task_in_sched(id: sched_id) -> task_id; diff --git a/src/test/run-pass/self-shadowing-import.rs b/src/test/run-pass/self-shadowing-import.rs index 0fec03d6b9b..1c343557122 100644 --- a/src/test/run-pass/self-shadowing-import.rs +++ b/src/test/run-pass/self-shadowing-import.rs @@ -1,12 +1,16 @@ mod a { + #[legacy_exports]; mod b { + #[legacy_exports]; mod a { + #[legacy_exports]; fn foo() -> int { return 1; } } } } mod c { + #[legacy_exports]; use a::b::a; fn bar() { assert (a::foo() == 1); } } diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs index 750d13b87e2..469de185968 100644 --- a/src/test/run-pass/static-impl.rs +++ b/src/test/run-pass/static-impl.rs @@ -8,10 +8,12 @@ trait plus { } mod a { + #[legacy_exports]; impl uint: plus { fn plus() -> int { self as int + 20 } } } mod b { + #[legacy_exports]; impl ~str: plus { fn plus() -> int { 200 } } } diff --git a/src/test/run-pass/static-method-xcrate.rs b/src/test/run-pass/static-method-xcrate.rs index e178a3a1304..398440ebf7f 100644 --- a/src/test/run-pass/static-method-xcrate.rs +++ b/src/test/run-pass/static-method-xcrate.rs @@ -1,5 +1,6 @@ // xfail-fast // aux-build:static-methods-crate.rs +#[legacy_exports]; extern mod static_methods_crate; use static_methods_crate::read; diff --git a/src/test/run-pass/struct-return.rs b/src/test/run-pass/struct-return.rs index 3b3a3eae624..c72be6f8a22 100644 --- a/src/test/run-pass/struct-return.rs +++ b/src/test/run-pass/struct-return.rs @@ -3,6 +3,7 @@ type floats = { a: f64, b: u8, c: f64 }; #[nolink] extern mod rustrt { + #[legacy_exports]; fn debug_abi_1(++q: quad) -> quad; fn debug_abi_2(++f: floats) -> floats; } diff --git a/src/test/run-pass/syntax-extension-source-utils.rs b/src/test/run-pass/syntax-extension-source-utils.rs index f20427dec88..1704047a48f 100644 --- a/src/test/run-pass/syntax-extension-source-utils.rs +++ b/src/test/run-pass/syntax-extension-source-utils.rs @@ -1,14 +1,17 @@ // This test is brittle! // xfail-pretty - the pretty tests lose path information, breaking #include +#[legacy_exports]; mod m1 { + #[legacy_exports]; mod m2 { + #[legacy_exports]; fn where_am_i() -> ~str { module_path!() } } } fn main() { - assert(line!() == 11u); + assert(line!() == 14u); assert(col!() == 11u); assert(file!().ends_with(~"syntax-extension-source-utils.rs")); assert(stringify!((2*3) + 5) == ~"2 * 3 + 5"); diff --git a/src/test/run-pass/tag-exports.rs b/src/test/run-pass/tag-exports.rs index 3c4d05b675f..8191ecfc5ea 100644 --- a/src/test/run-pass/tag-exports.rs +++ b/src/test/run-pass/tag-exports.rs @@ -1,6 +1,7 @@ use alder::*; mod alder { + #[legacy_exports]; export burnside; export couch; export everett; diff --git a/src/test/run-pass/trait-mix.rc b/src/test/run-pass/trait-mix.rc index 1366f08f38d..818f41de262 100644 --- a/src/test/run-pass/trait-mix.rc +++ b/src/test/run-pass/trait-mix.rc @@ -1,5 +1,8 @@ mod trait_mix { + #[legacy_exports]; #[path = "trait-mix.rs"] + #[legacy_exports] mod trait_mix; + #[legacy_exports] mod u_trait_mix; } diff --git a/src/test/run-pass/type-in-nested-module.rs b/src/test/run-pass/type-in-nested-module.rs index 059f22ba15c..fe31c261ad7 100644 --- a/src/test/run-pass/type-in-nested-module.rs +++ b/src/test/run-pass/type-in-nested-module.rs @@ -1,7 +1,9 @@ mod a { + #[legacy_exports]; mod b { + #[legacy_exports]; type t = int; fn foo() { let x: t = 10; } diff --git a/src/test/run-pass/use-import-export.rs b/src/test/run-pass/use-import-export.rs index 798bcb8c84f..630d9fc2323 100644 --- a/src/test/run-pass/use-import-export.rs +++ b/src/test/run-pass/use-import-export.rs @@ -1,10 +1,12 @@ mod foo { + #[legacy_exports]; fn x() -> int { return 1; } } mod bar { + #[legacy_exports]; fn y() -> int { return 1; } } diff --git a/src/test/run-pass/use-mod.rs b/src/test/run-pass/use-mod.rs index fcb50bd3436..13964081e47 100644 --- a/src/test/run-pass/use-mod.rs +++ b/src/test/run-pass/use-mod.rs @@ -1,7 +1,9 @@ use mod a::b; mod a { + #[legacy_exports]; mod b { + #[legacy_exports]; fn f() {} } } diff --git a/src/test/run-pass/use.rs b/src/test/run-pass/use.rs index 8d2357cca73..10c9fcae8e7 100644 --- a/src/test/run-pass/use.rs +++ b/src/test/run-pass/use.rs @@ -7,6 +7,7 @@ extern mod bar(name = "core", vers = "0.4"); use core::str; use x = zed::str; mod baz { + #[legacy_exports]; use bar::str; use x = core::str; } diff --git a/src/test/run-pass/warn-ctypes-inhibit.rs b/src/test/run-pass/warn-ctypes-inhibit.rs index 48cddf5661c..d6a7dd9993e 100644 --- a/src/test/run-pass/warn-ctypes-inhibit.rs +++ b/src/test/run-pass/warn-ctypes-inhibit.rs @@ -4,6 +4,7 @@ #[nolink] extern mod libc { + #[legacy_exports]; fn malloc(size: int) -> *u8; } diff --git a/src/test/run-pass/x86stdcall2.rs b/src/test/run-pass/x86stdcall2.rs index 423bafae452..deaec65dac7 100644 --- a/src/test/run-pass/x86stdcall2.rs +++ b/src/test/run-pass/x86stdcall2.rs @@ -7,6 +7,7 @@ type BOOL = u8; #[cfg(target_os = "win32")] #[abi = "stdcall"] extern mod kernel32 { + #[legacy_exports]; fn GetProcessHeap() -> HANDLE; fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID; fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL; |
