diff options
Diffstat (limited to 'src')
85 files changed, 218 insertions, 409 deletions
diff --git a/src/test/auxiliary/cci_borrow_lib.rs b/src/test/auxiliary/cci_borrow_lib.rs index 5aa5a519966..96af3203066 100644 --- a/src/test/auxiliary/cci_borrow_lib.rs +++ b/src/test/auxiliary/cci_borrow_lib.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; - -fn foo(x: &uint) -> uint { +pub fn foo(x: &uint) -> uint { *x } diff --git a/src/test/auxiliary/cci_class.rs b/src/test/auxiliary/cci_class.rs index 80685382040..3d39aeffa0a 100644 --- a/src/test/auxiliary/cci_class.rs +++ b/src/test/auxiliary/cci_class.rs @@ -8,22 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; -mod kitties { - #[legacy_exports]; +pub mod kitties { + pub struct cat { + priv mut meows : uint, -struct cat { - priv mut meows : uint, - - how_hungry : int, - -} + how_hungry : int, + } - fn cat(in_x : uint, in_y : int) -> cat { + pub fn cat(in_x : uint, in_y : int) -> cat { cat { meows: in_x, how_hungry: in_y } } - } diff --git a/src/test/auxiliary/cci_class_2.rs b/src/test/auxiliary/cci_class_2.rs index a4595cd9a63..47cbed741cd 100644 --- a/src/test/auxiliary/cci_class_2.rs +++ b/src/test/auxiliary/cci_class_2.rs @@ -8,26 +8,23 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; +pub mod kitties { + pub struct cat { + priv mut meows : uint, -mod kitties { - #[legacy_exports]; + how_hungry : int, -struct cat { - priv mut meows : uint, - - how_hungry : int, - -} + } - impl cat { + pub impl cat { fn speak() {} } - fn cat(in_x : uint, in_y : int) -> cat { + + pub fn cat(in_x : uint, in_y : int) -> cat { cat { meows: in_x, how_hungry: in_y } } - } + diff --git a/src/test/auxiliary/cci_class_3.rs b/src/test/auxiliary/cci_class_3.rs index 80efc577050..ae224684c84 100644 --- a/src/test/auxiliary/cci_class_3.rs +++ b/src/test/auxiliary/cci_class_3.rs @@ -8,28 +8,22 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; +pub mod kitties { + pub struct cat { + priv mut meows : uint, -mod kitties { - #[legacy_exports]; - -struct cat { - priv mut meows : uint, - - how_hungry : int, -} + how_hungry : int, + } - impl cat { + pub impl cat { fn speak() { self.meows += 1u; } fn meow_count() -> uint { self.meows } } - fn cat(in_x : uint, in_y : int) -> cat { + pub fn cat(in_x : uint, in_y : int) -> cat { cat { meows: in_x, how_hungry: in_y } } - - } diff --git a/src/test/auxiliary/cci_class_4.rs b/src/test/auxiliary/cci_class_4.rs index 658842b372f..127562309ce 100644 --- a/src/test/auxiliary/cci_class_4.rs +++ b/src/test/auxiliary/cci_class_4.rs @@ -8,35 +8,31 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; -mod kitties { - #[legacy_exports]; +pub mod kitties { + pub struct cat { + priv mut meows : uint, -struct cat { - priv mut meows : uint, - - mut how_hungry : int, - name : ~str, -} - -impl cat { + mut how_hungry : int, + name : ~str, + } - fn speak() { self.meow(); } + pub impl cat { + fn speak() { self.meow(); } - fn eat() -> bool { - if self.how_hungry > 0 { - error!("OM NOM NOM"); - self.how_hungry -= 2; - return true; - } - else { - error!("Not hungry!"); - return false; + fn eat() -> bool { + if self.how_hungry > 0 { + error!("OM NOM NOM"); + self.how_hungry -= 2; + return true; + } + else { + error!("Not hungry!"); + return false; + } + } } - } -} - priv impl cat { + pub impl cat { fn meow() { error!("Meow"); self.meows += 1u; @@ -46,12 +42,11 @@ impl cat { } } - fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { + pub fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { cat { meows: in_x, how_hungry: in_y, name: in_name } } - } diff --git a/src/test/auxiliary/cci_class_5.rs b/src/test/auxiliary/cci_class_5.rs index ad5106083b8..e2564a55279 100644 --- a/src/test/auxiliary/cci_class_5.rs +++ b/src/test/auxiliary/cci_class_5.rs @@ -8,14 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -mod kitties { - +pub mod kitties { pub struct cat { priv mut meows : uint, how_hungry : int, } - impl cat { + pub impl cat { priv fn nap() { for uint::range(1, 10000u) |_i|{}} } @@ -26,4 +25,4 @@ mod kitties { } } -} \ No newline at end of file +} diff --git a/src/test/auxiliary/cci_class_6.rs b/src/test/auxiliary/cci_class_6.rs index 5b592086582..f4b27e04c13 100644 --- a/src/test/auxiliary/cci_class_6.rs +++ b/src/test/auxiliary/cci_class_6.rs @@ -8,32 +8,27 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; +pub mod kitties { + pub struct cat<U> { + priv mut info : ~[U], + priv mut meows : uint, -mod kitties { - #[legacy_exports]; - -struct cat<U> { - priv mut info : ~[U], - priv mut meows : uint, - - how_hungry : int, -} + how_hungry : int, + } - impl<U> cat<U> { + pub impl<U> cat<U> { fn speak<T>(stuff: ~[T]) { self.meows += stuff.len(); } fn meow_count() -> uint { self.meows } } -fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> { - cat { - meows: in_x, - how_hungry: in_y, - info: move in_info + pub fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> { + cat { + meows: in_x, + how_hungry: in_y, + info: move in_info + } } } - -} diff --git a/src/test/auxiliary/cci_class_trait.rs b/src/test/auxiliary/cci_class_trait.rs index a8abeb67ebc..0363e1afd60 100644 --- a/src/test/auxiliary/cci_class_trait.rs +++ b/src/test/auxiliary/cci_class_trait.rs @@ -8,11 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -mod animals { - #[legacy_exports]; - -trait noisy { - fn speak(); -} - +pub mod animals { + pub trait noisy { + fn speak(); + } } diff --git a/src/test/auxiliary/cci_intrinsic.rs b/src/test/auxiliary/cci_intrinsic.rs index b016ab51091..7d126a78dc2 100644 --- a/src/test/auxiliary/cci_intrinsic.rs +++ b/src/test/auxiliary/cci_intrinsic.rs @@ -8,10 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; #[abi = "rust-intrinsic"] -extern mod rusti { - #[legacy_exports]; +pub extern mod rusti { fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int; fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int; fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int; @@ -30,7 +28,7 @@ extern mod rusti { } #[inline(always)] -fn atomic_xchg(dst: &mut int, src: int) -> int { +pub fn atomic_xchg(dst: &mut int, src: int) -> int { unsafe { rusti::atomic_xchg(dst, src) } diff --git a/src/test/auxiliary/cci_iter_lib.rs b/src/test/auxiliary/cci_iter_lib.rs index ab6fea4cc75..6e2c36578ff 100644 --- a/src/test/auxiliary/cci_iter_lib.rs +++ b/src/test/auxiliary/cci_iter_lib.rs @@ -10,10 +10,9 @@ #[link(name="cci_iter_lib", vers="0.0")]; #[legacy_modes]; -#[legacy_exports]; #[inline] -fn iter<T>(v: ~[T], f: fn(T)) { +pub fn iter<T>(v: ~[T], f: fn(T)) { let mut i = 0u; let n = vec::len(v); while i < n { diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs index d20653e429a..b3557801b32 100644 --- a/src/test/auxiliary/cci_nested_lib.rs +++ b/src/test/auxiliary/cci_nested_lib.rs @@ -9,19 +9,18 @@ // except according to those terms. #[legacy_modes]; -#[legacy_exports]; use dvec::DVec; -struct Entry<A,B> {key: A, value: B} +pub struct Entry<A,B> {key: A, value: B} -struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> } +pub struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> } -fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) { +pub fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) { lst.data.push(Entry{key:k, value:v}); } -fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B { +pub fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B { let eq_fn = lst.eq_fn; for lst.data.each |entry| { if eq_fn(entry.key, k) { return entry.value; } @@ -30,13 +29,13 @@ fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B { } #[inline] -fn new_int_alist<B: Copy>() -> alist<int, B> { +pub fn new_int_alist<B: Copy>() -> alist<int, B> { fn eq_int(&&a: int, &&b: int) -> bool { a == b } return alist {eq_fn: eq_int, data: DVec()}; } #[inline] -fn new_int_alist_2<B: Copy>() -> alist<int, B> { +pub fn new_int_alist_2<B: Copy>() -> alist<int, B> { #[inline] fn eq_int(&&a: int, &&b: int) -> bool { a == b } return alist {eq_fn: eq_int, data: DVec()}; diff --git a/src/test/auxiliary/cci_no_inline_lib.rs b/src/test/auxiliary/cci_no_inline_lib.rs index 17cbf06267e..0b0492f13b8 100644 --- a/src/test/auxiliary/cci_no_inline_lib.rs +++ b/src/test/auxiliary/cci_no_inline_lib.rs @@ -9,10 +9,9 @@ // except according to those terms. #[link(name="cci_no_inline_lib", vers="0.0")]; -#[legacy_exports]; // same as cci_iter_lib, more-or-less, but not marked inline -fn iter(v: ~[uint], f: fn(uint)) { +pub fn iter(v: ~[uint], f: fn(uint)) { let mut i = 0u; let n = vec::len(v); while i < n { @@ -20,3 +19,4 @@ fn iter(v: ~[uint], f: fn(uint)) { i += 1u; } } + diff --git a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs index fb0e6055727..1a27bce1e02 100644 --- a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs +++ b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs @@ -10,40 +10,31 @@ #[link(name = "crate_method_reexport_grrrrrrr2")]; -export rust; - use name_pool::add; mod name_pool { - #[legacy_exports]; - - type name_pool = (); + pub type name_pool = (); - trait add { + pub trait add { fn add(s: ~str); } - impl name_pool: add { + pub impl name_pool: add { fn add(s: ~str) { } } } -mod rust { - #[legacy_exports]; - +pub mod rust { use name_pool::add; - export add; - export rt; - export cx; - type rt = @(); + pub type rt = @(); - trait cx { + pub trait cx { fn cx(); } - impl rt: cx { + pub impl rt: cx { fn cx() { } } diff --git a/src/test/auxiliary/crateresolve1-1.rs b/src/test/auxiliary/crateresolve1-1.rs index d3dd0776f9c..818d4da52ed 100644 --- a/src/test/auxiliary/crateresolve1-1.rs +++ b/src/test/auxiliary/crateresolve1-1.rs @@ -12,6 +12,5 @@ vers = "0.1")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 10 } +pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/crateresolve1-2.rs b/src/test/auxiliary/crateresolve1-2.rs index cb9a20a8ff6..6edbcbfdb85 100644 --- a/src/test/auxiliary/crateresolve1-2.rs +++ b/src/test/auxiliary/crateresolve1-2.rs @@ -12,6 +12,5 @@ vers = "0.2")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 20 } +pub fn f() -> int { 20 } diff --git a/src/test/auxiliary/crateresolve1-3.rs b/src/test/auxiliary/crateresolve1-3.rs index a96be3044af..ce23867c2c7 100644 --- a/src/test/auxiliary/crateresolve1-3.rs +++ b/src/test/auxiliary/crateresolve1-3.rs @@ -12,6 +12,5 @@ vers = "0.3")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 30 } +pub fn f() -> int { 30 } diff --git a/src/test/auxiliary/crateresolve2-1.rs b/src/test/auxiliary/crateresolve2-1.rs index edb5d116374..4d0694f473b 100644 --- a/src/test/auxiliary/crateresolve2-1.rs +++ b/src/test/auxiliary/crateresolve2-1.rs @@ -12,6 +12,5 @@ vers = "0.1")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 10 } +pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/crateresolve2-2.rs b/src/test/auxiliary/crateresolve2-2.rs index 7c2da0c4c9b..4ae0ce0109f 100644 --- a/src/test/auxiliary/crateresolve2-2.rs +++ b/src/test/auxiliary/crateresolve2-2.rs @@ -12,6 +12,5 @@ vers = "0.2")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 20 } +pub fn f() -> int { 20 } diff --git a/src/test/auxiliary/crateresolve2-3.rs b/src/test/auxiliary/crateresolve2-3.rs index 5deb8c6f29b..6d401b50f8c 100644 --- a/src/test/auxiliary/crateresolve2-3.rs +++ b/src/test/auxiliary/crateresolve2-3.rs @@ -12,6 +12,5 @@ vers = "0.3")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 30 } +pub fn f() -> int { 30 } diff --git a/src/test/auxiliary/crateresolve3-1.rs b/src/test/auxiliary/crateresolve3-1.rs index 6396d876981..b890508f744 100644 --- a/src/test/auxiliary/crateresolve3-1.rs +++ b/src/test/auxiliary/crateresolve3-1.rs @@ -12,6 +12,5 @@ vers = "0.1")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 10 } +pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/crateresolve3-2.rs b/src/test/auxiliary/crateresolve3-2.rs index dbb508ce7df..f11dc8eb3a0 100644 --- a/src/test/auxiliary/crateresolve3-2.rs +++ b/src/test/auxiliary/crateresolve3-2.rs @@ -12,6 +12,5 @@ vers = "0.2")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn g() -> int { 20 } +pub fn g() -> int { 20 } diff --git a/src/test/auxiliary/crateresolve4a-1.rs b/src/test/auxiliary/crateresolve4a-1.rs index 66642e132dd..fcb167de453 100644 --- a/src/test/auxiliary/crateresolve4a-1.rs +++ b/src/test/auxiliary/crateresolve4a-1.rs @@ -10,6 +10,5 @@ #[link(name = "crateresolve4a", vers = "0.1")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 10 } +pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/crateresolve4a-2.rs b/src/test/auxiliary/crateresolve4a-2.rs index 1e16832ed53..6b933631c19 100644 --- a/src/test/auxiliary/crateresolve4a-2.rs +++ b/src/test/auxiliary/crateresolve4a-2.rs @@ -10,6 +10,5 @@ #[link(name = "crateresolve4a", vers= "0.2")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn g() -> int { 20 } +pub fn g() -> int { 20 } diff --git a/src/test/auxiliary/crateresolve4b-1.rs b/src/test/auxiliary/crateresolve4b-1.rs index 909e543f4fd..50de9c89625 100644 --- a/src/test/auxiliary/crateresolve4b-1.rs +++ b/src/test/auxiliary/crateresolve4b-1.rs @@ -12,8 +12,7 @@ // aux-build:crateresolve4a-2.rs #[link(name = "crateresolve4b", vers = "0.1")]; #[crate_type = "lib"]; -#[legacy_exports]; extern mod crateresolve4a(vers="0.2"); -fn f() -> int { crateresolve4a::g() } +pub fn f() -> int { crateresolve4a::g() } diff --git a/src/test/auxiliary/crateresolve4b-2.rs b/src/test/auxiliary/crateresolve4b-2.rs index 47d53dc7cfc..af02498ae7c 100644 --- a/src/test/auxiliary/crateresolve4b-2.rs +++ b/src/test/auxiliary/crateresolve4b-2.rs @@ -12,8 +12,7 @@ // aux-build:crateresolve4a-2.rs #[link(name = "crateresolve4b", vers = "0.2")]; #[crate_type = "lib"]; -#[legacy_exports]; extern mod crateresolve4a(vers="0.1"); -fn g() -> int { crateresolve4a::f() } +pub fn g() -> int { crateresolve4a::f() } diff --git a/src/test/auxiliary/crateresolve5-1.rs b/src/test/auxiliary/crateresolve5-1.rs index e07f24c2fb7..c11e39706f5 100644 --- a/src/test/auxiliary/crateresolve5-1.rs +++ b/src/test/auxiliary/crateresolve5-1.rs @@ -12,18 +12,17 @@ vers = "0.1")]; #[crate_type = "lib"]; -#[legacy_exports]; -struct NameVal { name: ~str, val: int } +pub struct NameVal { name: ~str, val: int } -fn struct_nameval() -> NameVal { +pub fn struct_nameval() -> NameVal { NameVal { name: ~"crateresolve5", val: 10 } } -enum e { +pub enum e { e_val } -fn nominal() -> e { e_val } +pub fn nominal() -> e { e_val } -fn f() -> int { 10 } +pub fn f() -> int { 10 } diff --git a/src/test/auxiliary/crateresolve5-2.rs b/src/test/auxiliary/crateresolve5-2.rs index be7e993d29c..bc57328ac80 100644 --- a/src/test/auxiliary/crateresolve5-2.rs +++ b/src/test/auxiliary/crateresolve5-2.rs @@ -12,17 +12,16 @@ vers = "0.2")]; #[crate_type = "lib"]; -#[legacy_exports]; -struct NameVal { name: ~str, val: int } -fn struct_nameval() -> NameVal { +pub struct NameVal { name: ~str, val: int } +pub fn struct_nameval() -> NameVal { NameVal { name: ~"crateresolve5", val: 10 } } -enum e { +pub enum e { e_val } -fn nominal() -> e { e_val } +pub fn nominal() -> e { e_val } -fn f() -> int { 20 } +pub fn f() -> int { 20 } diff --git a/src/test/auxiliary/crateresolve7x.rs b/src/test/auxiliary/crateresolve7x.rs index ac82a132af4..3e773622b99 100644 --- a/src/test/auxiliary/crateresolve7x.rs +++ b/src/test/auxiliary/crateresolve7x.rs @@ -13,15 +13,12 @@ // aux-build:crateresolve_calories-2.rs // These both have the same version but differ in other metadata -#[legacy_exports]; -mod a { - #[legacy_exports]; +pub mod a { extern mod cr_1 (name = "crateresolve_calories", vers = "0.1", calories="100"); - fn f() -> int { cr_1::f() } + pub fn f() -> int { cr_1::f() } } -mod b { - #[legacy_exports]; +pub mod b { extern mod cr_2 (name = "crateresolve_calories", vers = "0.1", calories="200"); - fn f() -> int { cr_2::f() } + pub fn f() -> int { cr_2::f() } } diff --git a/src/test/auxiliary/crateresolve_calories-1.rs b/src/test/auxiliary/crateresolve_calories-1.rs index 0e1686c1513..827517bf276 100644 --- a/src/test/auxiliary/crateresolve_calories-1.rs +++ b/src/test/auxiliary/crateresolve_calories-1.rs @@ -13,6 +13,5 @@ calories = "100")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 100 } +pub fn f() -> int { 100 } diff --git a/src/test/auxiliary/crateresolve_calories-2.rs b/src/test/auxiliary/crateresolve_calories-2.rs index d7cb6027a16..8dc5182c984 100644 --- a/src/test/auxiliary/crateresolve_calories-2.rs +++ b/src/test/auxiliary/crateresolve_calories-2.rs @@ -13,6 +13,5 @@ calories = "200")]; #[crate_type = "lib"]; -#[legacy_exports]; -fn f() -> int { 200 } +pub fn f() -> int { 200 } diff --git a/src/test/auxiliary/extern-crosscrate-source.rs b/src/test/auxiliary/extern-crosscrate-source.rs index 9fda4b133b8..7a99b390636 100644 --- a/src/test/auxiliary/extern-crosscrate-source.rs +++ b/src/test/auxiliary/extern-crosscrate-source.rs @@ -12,22 +12,20 @@ vers = "0.1")]; #[crate_type = "lib"]; -#[legacy_exports]; -extern mod rustrt { - #[legacy_exports]; - fn rust_dbg_call(cb: *u8, - data: libc::uintptr_t) -> libc::uintptr_t; +pub extern mod rustrt { + pub fn rust_dbg_call(cb: *u8, + data: libc::uintptr_t) -> libc::uintptr_t; } -fn fact(n: uint) -> uint { +pub fn fact(n: uint) -> uint { unsafe { debug!("n = %?", n); rustrt::rust_dbg_call(cb, n) } } -extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { +pub extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { if data == 1u { data } else { diff --git a/src/test/auxiliary/foreign_lib.rs b/src/test/auxiliary/foreign_lib.rs index 13070a2a49b..eb3397a8a5f 100644 --- a/src/test/auxiliary/foreign_lib.rs +++ b/src/test/auxiliary/foreign_lib.rs @@ -9,9 +9,7 @@ // except according to those terms. #[link(name="foreign_lib", vers="0.0")]; -#[legacy_exports]; -extern mod rustrt { - #[legacy_exports]; - fn last_os_error() -> ~str; -} \ No newline at end of file +pub extern mod rustrt { + pub fn last_os_error() -> ~str; +} diff --git a/src/test/auxiliary/issue-2380.rs b/src/test/auxiliary/issue-2380.rs index b29a3828b76..c0b824618a4 100644 --- a/src/test/auxiliary/issue-2380.rs +++ b/src/test/auxiliary/issue-2380.rs @@ -10,11 +10,10 @@ #[link(name = "a", vers = "0.0")]; #[crate_type = "lib"]; -#[legacy_exports]; -trait i<T> { } +pub trait i<T> { } -fn f<T>() -> i<T> { +pub fn f<T>() -> i<T> { impl<T> (): i<T> { } () as i::<T> diff --git a/src/test/auxiliary/issue-3012-1.rs b/src/test/auxiliary/issue-3012-1.rs index 83c95e034dd..618b9391ba1 100644 --- a/src/test/auxiliary/issue-3012-1.rs +++ b/src/test/auxiliary/issue-3012-1.rs @@ -10,27 +10,21 @@ #[link(name="socketlib", vers="0.0")]; #[crate_type = "lib"]; -#[legacy_exports]; -mod socket { - #[legacy_exports]; - -export socket_handle; - -struct socket_handle { - sockfd: libc::c_int, -} +pub mod socket { + pub struct socket_handle { + sockfd: libc::c_int, + } -impl socket_handle : Drop { - fn finalize(&self) { - /* c::close(self.sockfd); */ + pub impl socket_handle : Drop { + fn finalize(&self) { + /* c::close(self.sockfd); */ + } } -} - fn socket_handle(x: libc::c_int) -> socket_handle { + pub fn socket_handle(x: libc::c_int) -> socket_handle { socket_handle { sockfd: x } } - } diff --git a/src/test/auxiliary/issue_2316_b.rs b/src/test/auxiliary/issue_2316_b.rs index 9e148d3bef2..ed8e69cb4da 100644 --- a/src/test/auxiliary/issue_2316_b.rs +++ b/src/test/auxiliary/issue_2316_b.rs @@ -10,18 +10,12 @@ extern mod issue_2316_a; -mod cloth { - #[legacy_exports]; - -use issue_2316_a::*; - -export calico, gingham, flannel; -export fabric; - -enum fabric { - gingham, flannel, calico -} +pub mod cloth { + use issue_2316_a::*; + pub enum fabric { + gingham, flannel, calico + } } diff --git a/src/test/auxiliary/issue_2723_a.rs b/src/test/auxiliary/issue_2723_a.rs index e17a5706155..5afb2161b41 100644 --- a/src/test/auxiliary/issue_2723_a.rs +++ b/src/test/auxiliary/issue_2723_a.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports]; -unsafe fn f(xs: ~[int]) { - xs.map(|_x| { unsafe fn q() { fail; } }); -} \ No newline at end of file +pub unsafe fn f(xs: ~[int]) { + xs.map(|_x| { unsafe fn q() { fail; } }); +} diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs index c915820a45a..67d3391ed13 100644 --- a/src/test/bench/shootout-nbody.rs +++ b/src/test/bench/shootout-nbody.rs @@ -22,8 +22,7 @@ use core::os; // an llvm intrinsic. #[nolink] extern mod libc { - #[legacy_exports]; - fn sqrt(n: float) -> float; + pub fn sqrt(n: float) -> float; } fn main() { diff --git a/src/test/compile-fail/attr-bad-meta.rs b/src/test/compile-fail/attr-bad-meta.rs index 649865aed37..dbf2929afe4 100644 --- a/src/test/compile-fail/attr-bad-meta.rs +++ b/src/test/compile-fail/attr-bad-meta.rs @@ -12,5 +12,4 @@ // asterisk is bogus #[attr*] -mod m { - #[legacy_exports]; } +mod m {} diff --git a/src/test/compile-fail/bad-expr-path.rs b/src/test/compile-fail/bad-expr-path.rs index 7ed6836495c..576f9ef677e 100644 --- a/src/test/compile-fail/bad-expr-path.rs +++ b/src/test/compile-fail/bad-expr-path.rs @@ -10,7 +10,6 @@ // error-pattern: unresolved name: m1::a -mod m1 { - #[legacy_exports]; } +mod m1 {} 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 eea162c13b8..5545bbf68f0 100644 --- a/src/test/compile-fail/bad-expr-path2.rs +++ b/src/test/compile-fail/bad-expr-path2.rs @@ -11,9 +11,7 @@ // error-pattern: unresolved name: m1::a mod m1 { - #[legacy_exports]; - mod a { - #[legacy_exports]; } + pub mod a {} } 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 1571b98467f..130954d3a66 100644 --- a/src/test/compile-fail/crateresolve2.rs +++ b/src/test/compile-fail/crateresolve2.rs @@ -16,8 +16,7 @@ extern mod crateresolve2(vers = "0.1"); mod m { - #[legacy_exports]; - extern mod crateresolve2(vers = "0.2"); + pub extern mod crateresolve2(vers = "0.2"); } fn main() { diff --git a/src/test/compile-fail/empty-linkname.rs b/src/test/compile-fail/empty-linkname.rs index 587b59f93b3..7a36decf151 100644 --- a/src/test/compile-fail/empty-linkname.rs +++ b/src/test/compile-fail/empty-linkname.rs @@ -12,5 +12,4 @@ #[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 719a365a800..f5f89bd0298 100644 --- a/src/test/compile-fail/empty-linkname2.rs +++ b/src/test/compile-fail/empty-linkname2.rs @@ -14,5 +14,4 @@ #[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 d31a0ca2086..2ba2ef1c05a 100644 --- a/src/test/compile-fail/export-fully-qualified.rs +++ b/src/test/compile-fail/export-fully-qualified.rs @@ -15,11 +15,7 @@ // want to change eventually. mod foo { - #[legacy_exports]; - - export bar; - - fn bar() { foo::baz(); } + pub fn bar() { foo::baz(); } fn baz() { } } diff --git a/src/test/compile-fail/export-import.rs b/src/test/compile-fail/export-import.rs index 1a4132cf03a..a7578f6104f 100644 --- a/src/test/compile-fail/export-import.rs +++ b/src/test/compile-fail/export-import.rs @@ -13,10 +13,7 @@ use m::unexported; mod m { - #[legacy_exports]; - export exported; - - fn exported() { } + pub fn exported() { } fn unexported() { } } diff --git a/src/test/compile-fail/export-tag-variant.rs b/src/test/compile-fail/export-tag-variant.rs index 5add7850010..629699ca6a4 100644 --- a/src/test/compile-fail/export-tag-variant.rs +++ b/src/test/compile-fail/export-tag-variant.rs @@ -11,10 +11,7 @@ // error-pattern: unresolved name mod foo { - #[legacy_exports]; - export x; - - fn x() { } + pub fn x() { } enum y { y1, } } diff --git a/src/test/compile-fail/export.rs b/src/test/compile-fail/export.rs index f3d283e0132..dec65d4b4f8 100644 --- a/src/test/compile-fail/export.rs +++ b/src/test/compile-fail/export.rs @@ -10,9 +10,7 @@ // error-pattern: unresolved name mod foo { - #[legacy_exports]; - export x; - fn x(y: int) { log(debug, y); } + pub 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 8335e392ef9..61d623cf99a 100644 --- a/src/test/compile-fail/export2.rs +++ b/src/test/compile-fail/export2.rs @@ -11,19 +11,13 @@ // error-pattern: unresolved name mod foo { - #[legacy_exports]; - export x; - - fn x() { bar::x(); } + pub fn x() { bar::x(); } } mod bar { - #[legacy_exports]; - export y; - fn x() { debug!("x"); } - fn y() { } + pub fn y() { } } fn main() { foo::x(); } diff --git a/src/test/compile-fail/foreign-unsafe-fn-called.rs b/src/test/compile-fail/foreign-unsafe-fn-called.rs index 4b2ff6b100c..7132881ccf6 100644 --- a/src/test/compile-fail/foreign-unsafe-fn-called.rs +++ b/src/test/compile-fail/foreign-unsafe-fn-called.rs @@ -12,8 +12,7 @@ #[abi = "cdecl"] extern mod test { - #[legacy_exports]; - unsafe fn free(); + pub unsafe fn free(); } fn main() { diff --git a/src/test/compile-fail/foreign-unsafe-fn.rs b/src/test/compile-fail/foreign-unsafe-fn.rs index a9d2014bcdb..ce293d588f3 100644 --- a/src/test/compile-fail/foreign-unsafe-fn.rs +++ b/src/test/compile-fail/foreign-unsafe-fn.rs @@ -12,8 +12,7 @@ #[abi = "cdecl"] extern mod test { - #[legacy_exports]; - unsafe fn free(); + pub unsafe fn free(); } fn main() { diff --git a/src/test/compile-fail/fully-qualified-type-name2.rs b/src/test/compile-fail/fully-qualified-type-name2.rs index e9dfc26bd48..986d19669b9 100644 --- a/src/test/compile-fail/fully-qualified-type-name2.rs +++ b/src/test/compile-fail/fully-qualified-type-name2.rs @@ -11,13 +11,11 @@ // Test that we use fully-qualified type names in error messages. mod x { - #[legacy_exports]; - enum foo { } + pub enum foo { } } mod y { - #[legacy_exports]; - enum foo { } + pub enum foo { } } fn bar(x: x::foo) -> y::foo { diff --git a/src/test/compile-fail/import-from-missing.rs b/src/test/compile-fail/import-from-missing.rs index 6d1818e0b61..ecfec6c27d9 100644 --- a/src/test/compile-fail/import-from-missing.rs +++ b/src/test/compile-fail/import-from-missing.rs @@ -12,8 +12,7 @@ use spam::{ham, eggs}; mod spam { - #[legacy_exports]; - fn ham() { } + pub fn ham() { } } fn main() { ham(); eggs(); } diff --git a/src/test/compile-fail/import-from-rename.rs b/src/test/compile-fail/import-from-rename.rs index 872a7d81347..f7212779263 100644 --- a/src/test/compile-fail/import-from-rename.rs +++ b/src/test/compile-fail/import-from-rename.rs @@ -13,9 +13,8 @@ use baz = foo::{bar}; mod foo { - #[legacy_exports]; - fn bar() {} + pub fn bar() {} } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/import-glob-0.rs b/src/test/compile-fail/import-glob-0.rs index 6fd59ded8e9..250f9989740 100644 --- a/src/test/compile-fail/import-glob-0.rs +++ b/src/test/compile-fail/import-glob-0.rs @@ -13,15 +13,10 @@ use module_of_many_things::*; mod module_of_many_things { - #[legacy_exports]; - export f1; - export f2; - export f4; - - fn f1() { debug!("f1"); } - fn f2() { debug!("f2"); } + pub fn f1() { debug!("f1"); } + pub fn f2() { debug!("f2"); } fn f3() { debug!("f3"); } - fn f4() { debug!("f4"); } + pub fn f4() { debug!("f4"); } } diff --git a/src/test/compile-fail/import-glob-circular.rs b/src/test/compile-fail/import-glob-circular.rs index f7dc3962151..a6a17342245 100644 --- a/src/test/compile-fail/import-glob-circular.rs +++ b/src/test/compile-fail/import-glob-circular.rs @@ -11,27 +11,18 @@ // error-pattern: unresolved mod circ1 { - #[legacy_exports]; - use circ1::*; - export f1; - export f2; - export common; - fn f1() { debug!("f1"); } - fn common() -> uint { return 0u; } + pub use circ2::f2; + pub fn f1() { debug!("f1"); } + pub fn common() -> uint { return 0u; } } mod circ2 { - #[legacy_exports]; - use circ2::*; - export f1; - export f2; - export common; - fn f2() { debug!("f2"); } - fn common() -> uint { return 1u; } + pub use circ1::f1; + pub fn f2() { debug!("f2"); } + pub fn common() -> uint { return 1u; } } 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 deleted file mode 100644 index 56ea50a5509..00000000000 --- a/src/test/compile-fail/import-glob-export.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -// error-pattern:unresolved name - -use m1::*; - -mod m1 { - #[legacy_exports]; - export f1; - fn f1() { } - fn f2() { } -} - -fn main() { f2(); } diff --git a/src/test/compile-fail/import-glob-rename.rs b/src/test/compile-fail/import-glob-rename.rs index 6f049e75497..5016cab7723 100644 --- a/src/test/compile-fail/import-glob-rename.rs +++ b/src/test/compile-fail/import-glob-rename.rs @@ -13,9 +13,8 @@ use baz = foo::*; mod foo { - #[legacy_exports]; - fn bar() {} + pub fn bar() {} } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/import-loop-2.rs b/src/test/compile-fail/import-loop-2.rs index fc85b66f435..b7bbe11a4dc 100644 --- a/src/test/compile-fail/import-loop-2.rs +++ b/src/test/compile-fail/import-loop-2.rs @@ -11,15 +11,11 @@ // error-pattern:import mod a { - #[legacy_exports]; - import b::x; - export x; + pub use b::x; } mod b { - #[legacy_exports]; - import a::x; - export x; + pub use a::x; fn main() { let y = x; } } diff --git a/src/test/compile-fail/import-loop.rs b/src/test/compile-fail/import-loop.rs index 5127a1a802c..f9b57f00776 100644 --- a/src/test/compile-fail/import-loop.rs +++ b/src/test/compile-fail/import-loop.rs @@ -13,9 +13,7 @@ use y::x; mod y { - #[legacy_exports]; - import x; - export x; + pub use y::x; } fn main() { } diff --git a/src/test/compile-fail/import.rs b/src/test/compile-fail/import.rs index c22d715583a..7a332868051 100644 --- a/src/test/compile-fail/import.rs +++ b/src/test/compile-fail/import.rs @@ -12,7 +12,6 @@ use zed::bar; use zed::baz; mod zed { - #[legacy_exports]; - fn bar() { debug!("bar"); } + pub 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 5e5d49c23d4..c04bce49d4a 100644 --- a/src/test/compile-fail/import2.rs +++ b/src/test/compile-fail/import2.rs @@ -10,10 +10,8 @@ // error-pattern: unresolved use baz::zed::bar; -mod baz { - #[legacy_exports]; } +mod baz {} mod zed { - #[legacy_exports]; - fn bar() { debug!("bar3"); } + pub 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 d451d42d99e..3029d24af8a 100644 --- a/src/test/compile-fail/import4.rs +++ b/src/test/compile-fail/import4.rs @@ -10,9 +10,7 @@ // error-pattern: import -mod a { - #[legacy_exports]; import foo = b::foo; export foo; } -mod b { - #[legacy_exports]; import foo = a::foo; export foo; } +mod a { pub use b::foo; } +mod b { pub use a::foo; } fn main(args: ~[str]) { debug!("loop"); } diff --git a/src/test/compile-fail/issue-1655.rs b/src/test/compile-fail/issue-1655.rs index 78b0e9b8ddc..37cfc642405 100644 --- a/src/test/compile-fail/issue-1655.rs +++ b/src/test/compile-fail/issue-1655.rs @@ -10,7 +10,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 084286cbd68..56f0c5e3dd0 100644 --- a/src/test/compile-fail/issue-2123.rs +++ b/src/test/compile-fail/issue-2123.rs @@ -11,7 +11,6 @@ use x = m::f; //~ ERROR failed to resolve import mod m { - #[legacy_exports]; } fn main() { diff --git a/src/test/compile-fail/issue-2848.rs b/src/test/compile-fail/issue-2848.rs index 1647be4495d..572ceb48fcd 100644 --- a/src/test/compile-fail/issue-2848.rs +++ b/src/test/compile-fail/issue-2848.rs @@ -9,8 +9,7 @@ // except according to those terms. mod bar { - #[legacy_exports]; - enum foo { + pub enum foo { alpha, beta, charlie diff --git a/src/test/compile-fail/issue-2937.rs b/src/test/compile-fail/issue-2937.rs index a1c0a15c969..ba4e25ea952 100644 --- a/src/test/compile-fail/issue-2937.rs +++ b/src/test/compile-fail/issue-2937.rs @@ -12,7 +12,6 @@ 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 c863127d7b0..1acfb753a4f 100644 --- a/src/test/compile-fail/issue-3099-b.rs +++ b/src/test/compile-fail/issue-3099-b.rs @@ -8,10 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports] -mod a {} +pub mod a {} -#[legacy_exports] -mod a {} //~ ERROR duplicate definition of type a +pub mod a {} //~ ERROR duplicate definition of type a fn main() {} diff --git a/src/test/compile-fail/keyword.rs b/src/test/compile-fail/keyword.rs index 6e7ec2a3ed5..2df56a0ab7c 100644 --- a/src/test/compile-fail/keyword.rs +++ b/src/test/compile-fail/keyword.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[legacy_exports] -mod break { +pub 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 b1d8425f68b..3dccbe7a112 100644 --- a/src/test/compile-fail/nolink-with-link-args.rs +++ b/src/test/compile-fail/nolink-with-link-args.rs @@ -16,7 +16,6 @@ the compiler output. */ #[link_args = "aFdEfSeVEEE"] #[nolink] -extern mod m1 { - #[legacy_exports]; } +extern mod m1 {} -fn main() { } \ No newline at end of file +fn main() { } diff --git a/src/test/compile-fail/private-impl-method.rs b/src/test/compile-fail/private-impl-method.rs index 8d5b13d4c7e..1ab8d25bb30 100644 --- a/src/test/compile-fail/private-impl-method.rs +++ b/src/test/compile-fail/private-impl-method.rs @@ -9,12 +9,11 @@ // except according to those terms. mod a { - #[legacy_exports]; - struct Foo { + pub struct Foo { x: int } - impl Foo { + pub impl Foo { priv fn foo() {} } } diff --git a/src/test/compile-fail/private-item-simple.rs b/src/test/compile-fail/private-item-simple.rs index e73950701f2..e8038df188b 100644 --- a/src/test/compile-fail/private-item-simple.rs +++ b/src/test/compile-fail/private-item-simple.rs @@ -9,7 +9,6 @@ // except according to those terms. 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 35b2de9c448..363a5fd0d2b 100644 --- a/src/test/compile-fail/private-method.rs +++ b/src/test/compile-fail/private-method.rs @@ -11,25 +11,23 @@ // error-pattern:method `nap` is private mod kitties { - #[legacy_exports]; -struct cat { - priv mut meows : uint, + pub struct cat { + priv mut meows : uint, - how_hungry : int, - -} + how_hungry : int, + } -impl cat { - priv fn nap() { uint::range(1u, 10000u, |_i| false)} -} + pub impl cat { + priv fn nap() { uint::range(1u, 10000u, |_i| false)} + } -fn cat(in_x : uint, in_y : int) -> cat { - cat { - meows: in_x, - how_hungry: in_y + pub fn cat(in_x : uint, in_y : int) -> cat { + cat { + meows: in_x, + how_hungry: in_y + } } } -} fn main() { let nyan : kitties::cat = kitties::cat(52u, 99); diff --git a/src/test/compile-fail/private-struct-field-ctor.rs b/src/test/compile-fail/private-struct-field-ctor.rs index cd03524cbc0..43e7427dd74 100644 --- a/src/test/compile-fail/private-struct-field-ctor.rs +++ b/src/test/compile-fail/private-struct-field-ctor.rs @@ -9,8 +9,7 @@ // except according to those terms. mod a { - #[legacy_exports]; - struct Foo { + pub 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 94b44f782a4..864c9bd98d7 100644 --- a/src/test/compile-fail/private-struct-field-pattern.rs +++ b/src/test/compile-fail/private-struct-field-pattern.rs @@ -11,12 +11,11 @@ use a::Foo; mod a { - #[legacy_exports]; - struct Foo { + pub struct Foo { priv x: int } - fn make() -> Foo { + pub fn make() -> Foo { Foo { x: 3 } } } diff --git a/src/test/compile-fail/private-struct-field.rs b/src/test/compile-fail/private-struct-field.rs index 978e67c4162..48e0d85d2a7 100644 --- a/src/test/compile-fail/private-struct-field.rs +++ b/src/test/compile-fail/private-struct-field.rs @@ -9,12 +9,11 @@ // except according to those terms. mod cat { - #[legacy_exports]; - struct Cat { + pub struct Cat { priv meows: uint } - fn new_cat() -> Cat { + pub fn new_cat() -> Cat { Cat { meows: 52 } } } diff --git a/src/test/compile-fail/private-variant.rs b/src/test/compile-fail/private-variant.rs index 3466f0a8951..3285997523a 100644 --- a/src/test/compile-fail/private-variant.rs +++ b/src/test/compile-fail/private-variant.rs @@ -9,8 +9,7 @@ // except according to those terms. mod a { - #[legacy_exports]; - enum Waffle { + pub enum Waffle { Belgian, Brussels, priv Liege diff --git a/src/test/compile-fail/redundant-link-args.rs b/src/test/compile-fail/redundant-link-args.rs index 02f10af2698..1dc6a93a73f 100644 --- a/src/test/compile-fail/redundant-link-args.rs +++ b/src/test/compile-fail/redundant-link-args.rs @@ -19,11 +19,9 @@ #[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 3f596360c0c..a8bbc24ffd4 100644 --- a/src/test/compile-fail/regions-glb-free-free.rs +++ b/src/test/compile-fail/regions-glb-free-free.rs @@ -9,23 +9,22 @@ // except according to those terms. mod argparse { - #[legacy_exports]; extern mod std; use either::{Either, Left, Right}; - struct Flag { + pub struct Flag { name: &str, desc: &str, max_count: uint, mut value: uint } - fn flag(name: &r/str, desc: &r/str) -> Flag/&r { + pub fn flag(name: &r/str, desc: &r/str) -> Flag/&r { Flag { name: name, desc: desc, max_count: 1, value: 0 } } - impl Flag { + pub impl Flag { fn set_desc(self, s: &str) -> Flag { Flag { //~ ERROR cannot infer an appropriate lifetime name: self.name, diff --git a/src/test/compile-fail/unused-imports-warn.rs b/src/test/compile-fail/unused-imports-warn.rs index f1d8f2c2201..61503159a2f 100644 --- a/src/test/compile-fail/unused-imports-warn.rs +++ b/src/test/compile-fail/unused-imports-warn.rs @@ -13,18 +13,15 @@ use cal = bar::c::cc; mod foo { - #[legacy_exports]; - type point = {x: int, y: int}; - type square = {p: point, h: uint, w: uint}; + pub type point = {x: int, y: int}; + pub type square = {p: point, h: uint, w: uint}; } mod bar { - #[legacy_exports]; - mod c { - #[legacy_exports]; + pub mod c { use foo::point; use foo::square; - fn cc(p: point) -> str { return 2 * (p.x + p.y); } + pub 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 ab02cea33ef..4f4d13a2675 100644 --- a/src/test/compile-fail/warn-ctypes-err-attr.rs +++ b/src/test/compile-fail/warn-ctypes-err-attr.rs @@ -13,9 +13,8 @@ #[nolink] extern mod libc { - #[legacy_exports]; - fn malloc(size: int) -> *u8; + pub fn malloc(size: int) -> *u8; } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/warn-ctypes.rs b/src/test/compile-fail/warn-ctypes.rs index 700d83fc1ad..f3d43e1fa3d 100644 --- a/src/test/compile-fail/warn-ctypes.rs +++ b/src/test/compile-fail/warn-ctypes.rs @@ -12,9 +12,8 @@ // error-pattern:found rust type #[nolink] extern mod libc { - #[legacy_exports]; - fn malloc(size: int) -> *u8; + pub fn malloc(size: int) -> *u8; } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/warn-foreign-int-types.rs b/src/test/compile-fail/warn-foreign-int-types.rs index 7bf33a58762..1c312de7726 100644 --- a/src/test/compile-fail/warn-foreign-int-types.rs +++ b/src/test/compile-fail/warn-foreign-int-types.rs @@ -10,9 +10,8 @@ //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); + pub fn strlen(str: *u8) -> uint; + pub fn foo(x: int, y: uint); } fn main() { diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index 9904700948d..f84f428bd4e 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -13,9 +13,8 @@ // 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; + pub fn rust_dbg_call(cb: *u8, + data: libc::uintptr_t) -> libc::uintptr_t; } extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index fde7a2da2e9..2b8a8b13eac 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -18,8 +18,7 @@ extern mod std; extern mod rustrt { - #[legacy_exports]; - fn last_os_error() -> ~str; + pub fn last_os_error() -> ~str; } fn getbig_call_c_and_fail(i: int) { diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/run-fail/run-unexported-tests.rs index 871142c3ac9..8d229a191b7 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/run-fail/run-unexported-tests.rs @@ -14,10 +14,7 @@ extern mod std; mod m { - #[legacy_exports]; - export exported; - - fn exported() { } + pub fn exported() { } #[test] fn unexported() { fail ~"runned an unexported test"; } |
