Skip to content

Commit 592c2e1

Browse files
committed
test: Remove export from the tests, language, and libraries. rs=deexporting
1 parent 2a65842 commit 592c2e1

File tree

81 files changed

+232
-528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+232
-528
lines changed

src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
#[link(name = "crate_method_reexport_grrrrrrr2")];
1212

13-
use name_pool::add;
13+
pub use name_pool::add;
1414

15-
mod name_pool {
15+
pub mod name_pool {
1616
pub type name_pool = ();
1717

1818
pub trait add {
@@ -26,7 +26,7 @@ mod name_pool {
2626
}
2727

2828
pub mod rust {
29-
use name_pool::add;
29+
pub use name_pool::add;
3030

3131
pub type rt = @();
3232

src/test/run-pass/alt-path.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212

1313
mod m1 {
14-
#[legacy_exports];
15-
enum foo { foo1, foo2, }
14+
pub enum foo { foo1, foo2, }
1615
}
1716

1817
fn bar(x: m1::foo) { match x { m1::foo1 => { } m1::foo2 => { } } }

src/test/run-pass/attr-before-view-item2.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
// error-pattern:expected item
1212

1313
mod m {
14-
#[legacy_exports];
15-
#[foo = "bar"]
16-
extern mod std;
14+
#[foo = "bar"]
15+
extern mod std;
1716
}
1817

1918
fn main() {

src/test/run-pass/binops.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ fn test_ptr() {
8282
#[abi = "cdecl"]
8383
#[nolink]
8484
extern mod test {
85-
#[legacy_exports];
86-
fn rust_get_sched_id() -> libc::intptr_t;
87-
fn get_task_id() -> libc::intptr_t;
85+
pub fn rust_get_sched_id() -> libc::intptr_t;
86+
pub fn get_task_id() -> libc::intptr_t;
8887
}
8988

9089
struct p {

src/test/run-pass/c-stack-as-value.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
#[abi = "cdecl"]
1212
extern mod rustrt {
13-
#[legacy_exports];
14-
fn get_task_id() -> libc::intptr_t;
13+
pub fn get_task_id() -> libc::intptr_t;
1514
}
1615

1716
fn main() {

src/test/run-pass/c-stack-returning-int64.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ extern mod std;
1313
#[abi = "cdecl"]
1414
#[nolink]
1515
extern mod libc {
16-
#[legacy_exports];
17-
fn atol(x: *u8) -> int;
18-
fn atoll(x: *u8) -> i64;
16+
pub fn atol(x: *u8) -> int;
17+
pub fn atoll(x: *u8) -> i64;
1918
}
2019

2120
fn atol(s: ~str) -> int {

src/test/run-pass/cci_borrow.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
// xfail-fast - check-fast doesn't understand aux-build
1212
// aux-build:cci_borrow_lib.rs
1313

14-
#[legacy_exports];
15-
1614
extern mod cci_borrow_lib;
1715
use cci_borrow_lib::foo;
1816

19-
fn main() {
17+
pub fn main() {
2018
let p = @22u;
2119
let r = foo(p);
2220
debug!("r=%u", r);

src/test/run-pass/cci_capture_clause.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// This test makes sure we can do cross-crate inlining on functions
1515
// that use capture clauses.
1616

17-
#[legacy_exports];
18-
1917
extern mod cci_capture_clause;
2018

21-
fn main() {
19+
pub fn main() {
2220
cci_capture_clause::foo(()).recv()
2321
}

src/test/run-pass/cci_nested_exe.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@
1111
// xfail-fast - check-fast doesn't understand aux-build
1212
// aux-build:cci_nested_lib.rs
1313

14-
#[legacy_modes];
15-
#[legacy_exports];
16-
1714
extern mod cci_nested_lib;
1815
use cci_nested_lib::*;
1916

20-
fn main() {
17+
pub fn main() {
2118
let lst = new_int_alist();
2219
alist_add(lst, 22, ~"hi");
2320
alist_add(lst, 44, ~"ho");

src/test/run-pass/cci_no_inline_exe.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
// xfail-fast - check-fast doesn't understand aux-build
1212
// aux-build:cci_no_inline_lib.rs
1313

14-
#[legacy_exports];
15-
1614
extern mod cci_no_inline_lib;
1715
use cci_no_inline_lib::iter;
1816

19-
fn main() {
17+
pub fn main() {
2018
// Check that a cross-crate call function not marked as inline
2119
// does not, in fact, get inlined. Also, perhaps more
2220
// importantly, checks that our scheme of using

src/test/run-pass/class-exports.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,21 @@
1616
use kitty::*;
1717

1818
mod kitty {
19-
#[legacy_exports];
20-
export cat;
21-
struct cat {
22-
meows: uint,
23-
name: ~str,
24-
}
19+
pub struct cat {
20+
meows: uint,
21+
name: ~str,
22+
}
2523

26-
impl cat {
27-
fn get_name() -> ~str { copy self.name }
28-
}
24+
pub impl cat {
25+
fn get_name() -> ~str { copy self.name }
26+
}
2927

30-
fn cat(in_name: ~str) -> cat {
28+
pub fn cat(in_name: ~str) -> cat {
3129
cat {
3230
name: in_name,
3331
meows: 0u
3432
}
3533
}
36-
3734
}
3835

3936
fn main() {

src/test/run-pass/conditional-compile.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ const b: bool = true;
2222
#[cfg(bogus)]
2323
#[abi = "cdecl"]
2424
extern mod rustrt {
25-
#[legacy_exports];
2625
// This symbol doesn't exist and would be a link error if this
2726
// module was translated
28-
fn bogus();
27+
pub fn bogus();
2928
}
3029

3130
#[abi = "cdecl"]
32-
extern mod rustrt {
33-
#[legacy_exports]; }
31+
extern mod rustrt {}
3432

3533
#[cfg(bogus)]
3634
type t = int;
@@ -66,21 +64,18 @@ fn r(i:int) -> r {
6664

6765
#[cfg(bogus)]
6866
mod m {
69-
#[legacy_exports];
7067
// This needs to parse but would fail in typeck. Since it's not in
7168
// the current config it should not be typechecked.
72-
fn bogus() { return 0; }
69+
pub fn bogus() { return 0; }
7370
}
7471

7572
mod m {
76-
#[legacy_exports];
77-
7873
// Submodules have slightly different code paths than the top-level
7974
// module, so let's make sure this jazz works here as well
8075
#[cfg(bogus)]
81-
fn f() { }
76+
pub fn f() { }
8277

83-
fn f() { }
78+
pub fn f() { }
8479
}
8580

8681
// Since the bogus configuration isn't defined main will just be
@@ -111,23 +106,19 @@ fn test_in_fn_ctxt() {
111106
}
112107

113108
mod test_foreign_items {
114-
#[legacy_exports];
115109
#[abi = "cdecl"]
116-
extern mod rustrt {
117-
#[legacy_exports];
110+
pub extern mod rustrt {
118111
#[cfg(bogus)]
119-
fn rust_getcwd() -> ~str;
120-
fn rust_getcwd() -> ~str;
112+
pub fn rust_getcwd() -> ~str;
113+
pub fn rust_getcwd() -> ~str;
121114
}
122115
}
123116

124117
mod test_use_statements {
125-
#[legacy_exports];
126118
#[cfg(bogus)]
127119
use flippity_foo;
128120

129-
extern mod rustrt {
130-
#[legacy_exports];
121+
pub extern mod rustrt {
131122
#[cfg(bogus)]
132123
use flippity_foo;
133124
}

src/test/run-pass/crateresolve2.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,18 @@
1414
// aux-build:crateresolve2-3.rs
1515

1616
mod a {
17-
#[legacy_exports];
1817
extern mod crateresolve2(vers = "0.1");
19-
fn f() { assert crateresolve2::f() == 10; }
18+
pub fn f() { assert crateresolve2::f() == 10; }
2019
}
2120

2221
mod b {
23-
#[legacy_exports];
2422
extern mod crateresolve2(vers = "0.2");
25-
fn f() { assert crateresolve2::f() == 20; }
23+
pub fn f() { assert crateresolve2::f() == 20; }
2624
}
2725

2826
mod c {
29-
#[legacy_exports];
3027
extern mod crateresolve2(vers = "0.3");
31-
fn f() { assert crateresolve2::f() == 30; }
28+
pub fn f() { assert crateresolve2::f() == 30; }
3229
}
3330

3431
fn main() {

src/test/run-pass/crateresolve3.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616
// as long as no name collision on invoked functions.
1717

1818
mod a {
19-
#[legacy_exports];
2019
extern mod crateresolve3(vers = "0.1");
21-
fn f() { assert crateresolve3::f() == 10; }
20+
pub fn f() { assert crateresolve3::f() == 10; }
2221
}
2322

2423
mod b {
25-
#[legacy_exports];
2624
extern mod crateresolve3(vers = "0.2");
27-
fn f() { assert crateresolve3::g() == 20; }
25+
pub fn f() { assert crateresolve3::g() == 20; }
2826
}
2927

3028
fn main() {

src/test/run-pass/crateresolve4.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,17 @@
1414
// aux-build:crateresolve4b-1.rs
1515
// aux-build:crateresolve4b-2.rs
1616

17-
#[legacy_exports];
18-
19-
mod a {
20-
#[legacy_exports];
17+
pub mod a {
2118
extern mod crateresolve4b(vers = "0.1");
22-
fn f() { assert crateresolve4b::f() == 20; }
19+
pub fn f() { assert crateresolve4b::f() == 20; }
2320
}
2421

25-
mod b {
26-
#[legacy_exports];
22+
pub mod b {
2723
extern mod crateresolve4b(vers = "0.2");
28-
fn f() { assert crateresolve4b::g() == 10; }
24+
pub fn f() { assert crateresolve4b::g() == 10; }
2925
}
3026

31-
fn main() {
27+
pub fn main() {
3228
a::f();
3329
b::f();
3430
}

src/test/run-pass/export-abstract-tag.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
// sort of ADT.
1313

1414
mod foo {
15-
#[legacy_exports];
16-
export t;
17-
export f;
15+
pub enum t { t1, }
1816

19-
enum t { t1, }
20-
21-
fn f() -> t { return t1; }
17+
pub fn f() -> t { return t1; }
2218
}
2319

2420
fn main() { let v: foo::t = foo::f(); }

src/test/run-pass/export-glob-imports-target.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
// Modified to not use export since it's going away. --pcw
1717

1818
mod foo {
19-
#[legacy_exports];
2019
use foo::bar::*;
21-
mod bar {
22-
#[legacy_exports];
23-
const a : int = 10;
20+
pub mod bar {
21+
pub const a : int = 10;
2422
}
25-
fn zum() {
23+
pub fn zum() {
2624
let b = a;
2725
}
2826
}

src/test/run-pass/export-glob.rs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/test/run-pass/export-multi.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ use m::f;
1414
use m::g;
1515

1616
mod m {
17-
#[legacy_exports];
18-
export f, g;
19-
20-
fn f() { }
21-
fn g() { }
17+
pub fn f() { }
18+
pub fn g() { }
2219
}
2320

2421
fn main() { f(); g(); m::f(); m::g(); }

src/test/run-pass/export-non-interference.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
// except according to those terms.
1010

1111

12-
export foo;
13-
export main;
14-
1512
enum list_cell<T> { cons(@list_cell<T>), nil }
1613

17-
fn main() { }
14+
pub fn main() { }

0 commit comments

Comments
 (0)