Skip to content

Commit 2a65842

Browse files
committed
test: De-export aux, bench, compile-fail, and run-fail. rs=deexporting
1 parent 77f2aac commit 2a65842

File tree

85 files changed

+218
-409
lines changed

Some content is hidden

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

85 files changed

+218
-409
lines changed

src/test/auxiliary/cci_borrow_lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_exports];
12-
13-
fn foo(x: &uint) -> uint {
11+
pub fn foo(x: &uint) -> uint {
1412
*x
1513
}

src/test/auxiliary/cci_class.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,17 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_exports];
12-
mod kitties {
13-
#[legacy_exports];
11+
pub mod kitties {
12+
pub struct cat {
13+
priv mut meows : uint,
1414

15-
struct cat {
16-
priv mut meows : uint,
17-
18-
how_hungry : int,
19-
20-
}
15+
how_hungry : int,
16+
}
2117

22-
fn cat(in_x : uint, in_y : int) -> cat {
18+
pub fn cat(in_x : uint, in_y : int) -> cat {
2319
cat {
2420
meows: in_x,
2521
how_hungry: in_y
2622
}
2723
}
28-
2924
}

src/test/auxiliary/cci_class_2.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,23 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_exports];
11+
pub mod kitties {
12+
pub struct cat {
13+
priv mut meows : uint,
1214

13-
mod kitties {
14-
#[legacy_exports];
15+
how_hungry : int,
1516

16-
struct cat {
17-
priv mut meows : uint,
18-
19-
how_hungry : int,
20-
21-
}
17+
}
2218

23-
impl cat {
19+
pub impl cat {
2420
fn speak() {}
2521
}
26-
fn cat(in_x : uint, in_y : int) -> cat {
22+
23+
pub fn cat(in_x : uint, in_y : int) -> cat {
2724
cat {
2825
meows: in_x,
2926
how_hungry: in_y
3027
}
3128
}
32-
3329
}
30+

src/test/auxiliary/cci_class_3.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,22 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_exports];
11+
pub mod kitties {
12+
pub struct cat {
13+
priv mut meows : uint,
1214

13-
mod kitties {
14-
#[legacy_exports];
15-
16-
struct cat {
17-
priv mut meows : uint,
18-
19-
how_hungry : int,
20-
}
15+
how_hungry : int,
16+
}
2117

22-
impl cat {
18+
pub impl cat {
2319
fn speak() { self.meows += 1u; }
2420
fn meow_count() -> uint { self.meows }
2521
}
2622

27-
fn cat(in_x : uint, in_y : int) -> cat {
23+
pub fn cat(in_x : uint, in_y : int) -> cat {
2824
cat {
2925
meows: in_x,
3026
how_hungry: in_y
3127
}
3228
}
33-
34-
3529
}

src/test/auxiliary/cci_class_4.rs

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,31 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_exports];
12-
mod kitties {
13-
#[legacy_exports];
11+
pub mod kitties {
12+
pub struct cat {
13+
priv mut meows : uint,
1414

15-
struct cat {
16-
priv mut meows : uint,
17-
18-
mut how_hungry : int,
19-
name : ~str,
20-
}
21-
22-
impl cat {
15+
mut how_hungry : int,
16+
name : ~str,
17+
}
2318

24-
fn speak() { self.meow(); }
19+
pub impl cat {
20+
fn speak() { self.meow(); }
2521

26-
fn eat() -> bool {
27-
if self.how_hungry > 0 {
28-
error!("OM NOM NOM");
29-
self.how_hungry -= 2;
30-
return true;
31-
}
32-
else {
33-
error!("Not hungry!");
34-
return false;
22+
fn eat() -> bool {
23+
if self.how_hungry > 0 {
24+
error!("OM NOM NOM");
25+
self.how_hungry -= 2;
26+
return true;
27+
}
28+
else {
29+
error!("Not hungry!");
30+
return false;
31+
}
32+
}
3533
}
36-
}
37-
}
3834

39-
priv impl cat {
35+
pub impl cat {
4036
fn meow() {
4137
error!("Meow");
4238
self.meows += 1u;
@@ -46,12 +42,11 @@ impl cat {
4642
}
4743
}
4844

49-
fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
45+
pub fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
5046
cat {
5147
meows: in_x,
5248
how_hungry: in_y,
5349
name: in_name
5450
}
5551
}
56-
5752
}

src/test/auxiliary/cci_class_5.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
mod kitties {
12-
11+
pub mod kitties {
1312
pub struct cat {
1413
priv mut meows : uint,
1514
how_hungry : int,
1615
}
1716

18-
impl cat {
17+
pub impl cat {
1918
priv fn nap() { for uint::range(1, 10000u) |_i|{}}
2019
}
2120

@@ -26,4 +25,4 @@ mod kitties {
2625
}
2726
}
2827

29-
}
28+
}

src/test/auxiliary/cci_class_6.rs

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,27 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_exports];
11+
pub mod kitties {
12+
pub struct cat<U> {
13+
priv mut info : ~[U],
14+
priv mut meows : uint,
1215

13-
mod kitties {
14-
#[legacy_exports];
15-
16-
struct cat<U> {
17-
priv mut info : ~[U],
18-
priv mut meows : uint,
19-
20-
how_hungry : int,
21-
}
16+
how_hungry : int,
17+
}
2218

23-
impl<U> cat<U> {
19+
pub impl<U> cat<U> {
2420
fn speak<T>(stuff: ~[T]) {
2521
self.meows += stuff.len();
2622
}
2723
fn meow_count() -> uint { self.meows }
2824
}
2925

30-
fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> {
31-
cat {
32-
meows: in_x,
33-
how_hungry: in_y,
34-
info: move in_info
26+
pub fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> {
27+
cat {
28+
meows: in_x,
29+
how_hungry: in_y,
30+
info: move in_info
31+
}
3532
}
3633
}
3734

38-
39-
}

src/test/auxiliary/cci_class_trait.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
mod animals {
12-
#[legacy_exports];
13-
14-
trait noisy {
15-
fn speak();
16-
}
17-
11+
pub mod animals {
12+
pub trait noisy {
13+
fn speak();
14+
}
1815
}

src/test/auxiliary/cci_intrinsic.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_exports];
1211
#[abi = "rust-intrinsic"]
13-
extern mod rusti {
14-
#[legacy_exports];
12+
pub extern mod rusti {
1513
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
1614
fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
1715
fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
@@ -30,7 +28,7 @@ extern mod rusti {
3028
}
3129

3230
#[inline(always)]
33-
fn atomic_xchg(dst: &mut int, src: int) -> int {
31+
pub fn atomic_xchg(dst: &mut int, src: int) -> int {
3432
unsafe {
3533
rusti::atomic_xchg(dst, src)
3634
}

src/test/auxiliary/cci_iter_lib.rs

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

1111
#[link(name="cci_iter_lib", vers="0.0")];
1212
#[legacy_modes];
13-
#[legacy_exports];
1413

1514
#[inline]
16-
fn iter<T>(v: ~[T], f: fn(T)) {
15+
pub fn iter<T>(v: ~[T], f: fn(T)) {
1716
let mut i = 0u;
1817
let n = vec::len(v);
1918
while i < n {

src/test/auxiliary/cci_nested_lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@
99
// except according to those terms.
1010

1111
#[legacy_modes];
12-
#[legacy_exports];
1312

1413
use dvec::DVec;
1514

16-
struct Entry<A,B> {key: A, value: B}
15+
pub struct Entry<A,B> {key: A, value: B}
1716

18-
struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> }
17+
pub struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> }
1918

20-
fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) {
19+
pub fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) {
2120
lst.data.push(Entry{key:k, value:v});
2221
}
2322

24-
fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
23+
pub fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
2524
let eq_fn = lst.eq_fn;
2625
for lst.data.each |entry| {
2726
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 {
3029
}
3130

3231
#[inline]
33-
fn new_int_alist<B: Copy>() -> alist<int, B> {
32+
pub fn new_int_alist<B: Copy>() -> alist<int, B> {
3433
fn eq_int(&&a: int, &&b: int) -> bool { a == b }
3534
return alist {eq_fn: eq_int, data: DVec()};
3635
}
3736

3837
#[inline]
39-
fn new_int_alist_2<B: Copy>() -> alist<int, B> {
38+
pub fn new_int_alist_2<B: Copy>() -> alist<int, B> {
4039
#[inline]
4140
fn eq_int(&&a: int, &&b: int) -> bool { a == b }
4241
return alist {eq_fn: eq_int, data: DVec()};

src/test/auxiliary/cci_no_inline_lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
// except according to those terms.
1010

1111
#[link(name="cci_no_inline_lib", vers="0.0")];
12-
#[legacy_exports];
1312

1413
// same as cci_iter_lib, more-or-less, but not marked inline
15-
fn iter(v: ~[uint], f: fn(uint)) {
14+
pub fn iter(v: ~[uint], f: fn(uint)) {
1615
let mut i = 0u;
1716
let n = vec::len(v);
1817
while i < n {
1918
f(v[i]);
2019
i += 1u;
2120
}
2221
}
22+

0 commit comments

Comments
 (0)