Skip to content

Commit f1ddb2a

Browse files
committed
libstd: De-export libstd. rs=deexport
1 parent d0391c5 commit f1ddb2a

File tree

15 files changed

+230
-252
lines changed

15 files changed

+230
-252
lines changed

src/libstd/arc.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,6 @@ impl<T: Const Owned> &RWReadMode<T> {
478478

479479
#[cfg(test)]
480480
mod tests {
481-
#[legacy_exports];
482-
483481
use core::prelude::*;
484482

485483
use arc::*;
@@ -493,7 +491,7 @@ mod tests {
493491
use core::vec;
494492

495493
#[test]
496-
fn manually_share_arc() {
494+
pub fn manually_share_arc() {
497495
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
498496
let arc_v = arc::ARC(v);
499497

@@ -518,7 +516,7 @@ mod tests {
518516
}
519517

520518
#[test]
521-
fn test_mutex_arc_condvar() {
519+
pub fn test_mutex_arc_condvar() {
522520
let arc = ~MutexARC(false);
523521
let arc2 = ~arc.clone();
524522
let (p,c) = pipes::oneshot();
@@ -540,7 +538,7 @@ mod tests {
540538
}
541539
}
542540
#[test] #[should_fail] #[ignore(cfg(windows))]
543-
fn test_arc_condvar_poison() {
541+
pub fn test_arc_condvar_poison() {
544542
let arc = ~MutexARC(1);
545543
let arc2 = ~arc.clone();
546544
let (p, c) = pipes::stream();
@@ -561,7 +559,7 @@ mod tests {
561559
}
562560
}
563561
#[test] #[should_fail] #[ignore(cfg(windows))]
564-
fn test_mutex_arc_poison() {
562+
pub fn test_mutex_arc_poison() {
565563
let arc = ~MutexARC(1);
566564
let arc2 = ~arc.clone();
567565
do task::try |move arc2| {
@@ -574,7 +572,7 @@ mod tests {
574572
}
575573
}
576574
#[test] #[should_fail] #[ignore(cfg(windows))]
577-
fn test_mutex_arc_unwrap_poison() {
575+
pub fn test_mutex_arc_unwrap_poison() {
578576
let arc = MutexARC(1);
579577
let arc2 = ~(&arc).clone();
580578
let (p, c) = pipes::stream();
@@ -589,7 +587,7 @@ mod tests {
589587
assert one == 1;
590588
}
591589
#[test] #[should_fail] #[ignore(cfg(windows))]
592-
fn test_rw_arc_poison_wr() {
590+
pub fn test_rw_arc_poison_wr() {
593591
let arc = ~RWARC(1);
594592
let arc2 = ~arc.clone();
595593
do task::try |move arc2| {
@@ -602,7 +600,7 @@ mod tests {
602600
}
603601
}
604602
#[test] #[should_fail] #[ignore(cfg(windows))]
605-
fn test_rw_arc_poison_ww() {
603+
pub fn test_rw_arc_poison_ww() {
606604
let arc = ~RWARC(1);
607605
let arc2 = ~arc.clone();
608606
do task::try |move arc2| {
@@ -615,7 +613,7 @@ mod tests {
615613
}
616614
}
617615
#[test] #[should_fail] #[ignore(cfg(windows))]
618-
fn test_rw_arc_poison_dw() {
616+
pub fn test_rw_arc_poison_dw() {
619617
let arc = ~RWARC(1);
620618
let arc2 = ~arc.clone();
621619
do task::try |move arc2| {
@@ -630,7 +628,7 @@ mod tests {
630628
}
631629
}
632630
#[test] #[ignore(cfg(windows))]
633-
fn test_rw_arc_no_poison_rr() {
631+
pub fn test_rw_arc_no_poison_rr() {
634632
let arc = ~RWARC(1);
635633
let arc2 = ~arc.clone();
636634
do task::try |move arc2| {
@@ -643,7 +641,7 @@ mod tests {
643641
}
644642
}
645643
#[test] #[ignore(cfg(windows))]
646-
fn test_rw_arc_no_poison_rw() {
644+
pub fn test_rw_arc_no_poison_rw() {
647645
let arc = ~RWARC(1);
648646
let arc2 = ~arc.clone();
649647
do task::try |move arc2| {
@@ -656,7 +654,7 @@ mod tests {
656654
}
657655
}
658656
#[test] #[ignore(cfg(windows))]
659-
fn test_rw_arc_no_poison_dr() {
657+
pub fn test_rw_arc_no_poison_dr() {
660658
let arc = ~RWARC(1);
661659
let arc2 = ~arc.clone();
662660
do task::try |move arc2| {
@@ -672,7 +670,7 @@ mod tests {
672670
}
673671
}
674672
#[test]
675-
fn test_rw_arc() {
673+
pub fn test_rw_arc() {
676674
let arc = ~RWARC(0);
677675
let arc2 = ~arc.clone();
678676
let (p,c) = pipes::stream();
@@ -709,7 +707,7 @@ mod tests {
709707
do arc.read |num| { assert *num == 10; }
710708
}
711709
#[test]
712-
fn test_rw_downgrade() {
710+
pub fn test_rw_downgrade() {
713711
// (1) A downgrader gets in write mode and does cond.wait.
714712
// (2) A writer gets in write mode, sets state to 42, and does signal.
715713
// (3) Downgrader wakes, sets state to 31337.

src/libstd/base64.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,10 @@ impl ~str: FromBase64 {
152152

153153
#[cfg(test)]
154154
mod tests {
155-
#[legacy_exports];
156-
157155
use core::str;
158156

159157
#[test]
160-
fn test_to_base64() {
158+
pub fn test_to_base64() {
161159
assert (~"").to_base64() == ~"";
162160
assert (~"f").to_base64() == ~"Zg==";
163161
assert (~"fo").to_base64() == ~"Zm8=";
@@ -168,7 +166,7 @@ mod tests {
168166
}
169167

170168
#[test]
171-
fn test_from_base64() {
169+
pub fn test_from_base64() {
172170
assert (~"").from_base64() == str::to_bytes(~"");
173171
assert (~"Zg==").from_base64() == str::to_bytes(~"f");
174172
assert (~"Zm8=").from_base64() == str::to_bytes(~"fo");

src/libstd/bitv.rs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,6 @@ impl Bitv: ops::Index<uint,bool> {
578578

579579
#[cfg(test)]
580580
mod tests {
581-
#[legacy_exports];
582-
583581
use core::prelude::*;
584582

585583
use bitv::*;
@@ -589,7 +587,7 @@ mod tests {
589587
use core::vec;
590588

591589
#[test]
592-
fn test_to_str() {
590+
pub fn test_to_str() {
593591
let zerolen = Bitv(0u, false);
594592
assert zerolen.to_str() == ~"";
595593

@@ -598,7 +596,7 @@ mod tests {
598596
}
599597

600598
#[test]
601-
fn test_0_elements() {
599+
pub fn test_0_elements() {
602600
let mut act;
603601
let mut exp;
604602
act = Bitv(0u, false);
@@ -607,7 +605,7 @@ mod tests {
607605
}
608606

609607
#[test]
610-
fn test_1_element() {
608+
pub fn test_1_element() {
611609
let mut act;
612610
act = Bitv(1u, false);
613611
assert act.eq_vec(~[0u]);
@@ -616,15 +614,15 @@ mod tests {
616614
}
617615

618616
#[test]
619-
fn test_2_elements() {
617+
pub fn test_2_elements() {
620618
let b = bitv::Bitv(2, false);
621619
b.set(0, true);
622620
b.set(1, false);
623621
assert b.to_str() == ~"10";
624622
}
625623

626624
#[test]
627-
fn test_10_elements() {
625+
pub fn test_10_elements() {
628626
let mut act;
629627
// all 0
630628

@@ -663,7 +661,7 @@ mod tests {
663661
}
664662

665663
#[test]
666-
fn test_31_elements() {
664+
pub fn test_31_elements() {
667665
let mut act;
668666
// all 0
669667

@@ -736,7 +734,7 @@ mod tests {
736734
}
737735

738736
#[test]
739-
fn test_32_elements() {
737+
pub fn test_32_elements() {
740738
let mut act;
741739
// all 0
742740

@@ -811,7 +809,7 @@ mod tests {
811809
}
812810

813811
#[test]
814-
fn test_33_elements() {
812+
pub fn test_33_elements() {
815813
let mut act;
816814
// all 0
817815

@@ -887,21 +885,21 @@ mod tests {
887885
}
888886

889887
#[test]
890-
fn test_equal_differing_sizes() {
888+
pub fn test_equal_differing_sizes() {
891889
let v0 = Bitv(10u, false);
892890
let v1 = Bitv(11u, false);
893891
assert !v0.equal(&v1);
894892
}
895893

896894
#[test]
897-
fn test_equal_greatly_differing_sizes() {
895+
pub fn test_equal_greatly_differing_sizes() {
898896
let v0 = Bitv(10u, false);
899897
let v1 = Bitv(110u, false);
900898
assert !v0.equal(&v1);
901899
}
902900

903901
#[test]
904-
fn test_equal_sneaky_small() {
902+
pub fn test_equal_sneaky_small() {
905903
let a = bitv::Bitv(1, false);
906904
a.set(0, true);
907905

@@ -912,7 +910,7 @@ mod tests {
912910
}
913911

914912
#[test]
915-
fn test_equal_sneaky_big() {
913+
pub fn test_equal_sneaky_big() {
916914
let a = bitv::Bitv(100, false);
917915
for uint::range(0, 100) |i| {
918916
a.set(i, true);
@@ -927,14 +925,14 @@ mod tests {
927925
}
928926

929927
#[test]
930-
fn test_from_bytes() {
928+
pub fn test_from_bytes() {
931929
let bitv = from_bytes([0b10110110, 0b00000000, 0b11111111]);
932930
let str = ~"10110110" + ~"00000000" + ~"11111111";
933931
assert bitv.to_str() == str;
934932
}
935933

936934
#[test]
937-
fn test_to_bytes() {
935+
pub fn test_to_bytes() {
938936
let bv = Bitv(3, true);
939937
bv.set(1, false);
940938
assert bv.to_bytes() == ~[0b10100000];
@@ -946,18 +944,18 @@ mod tests {
946944
}
947945

948946
#[test]
949-
fn test_from_bools() {
947+
pub fn test_from_bools() {
950948
assert from_bools([true, false, true, true]).to_str() == ~"1011";
951949
}
952950

953951
#[test]
954-
fn test_to_bools() {
952+
pub fn test_to_bools() {
955953
let bools = ~[false, false, true, false, false, true, true, false];
956954
assert from_bytes([0b00100110]).to_bools() == bools;
957955
}
958956

959957
#[test]
960-
fn test_small_difference() {
958+
pub fn test_small_difference() {
961959
let b1 = Bitv(3, false);
962960
let b2 = Bitv(3, false);
963961
b1.set(0, true);
@@ -971,7 +969,7 @@ mod tests {
971969
}
972970

973971
#[test]
974-
fn test_big_difference() {
972+
pub fn test_big_difference() {
975973
let b1 = Bitv(100, false);
976974
let b2 = Bitv(100, false);
977975
b1.set(0, true);

src/libstd/comm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@ pub fn DuplexStream<T: Owned, U: Owned>()
8787

8888
#[cfg(test)]
8989
mod test {
90-
#[legacy_exports];
9190
use comm::DuplexStream;
9291

9392
#[test]
94-
fn DuplexStream1() {
93+
pub fn DuplexStream1() {
9594
let (left, right) = DuplexStream();
9695

9796
left.send(~"abc");

src/libstd/dbg.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ use core::sys;
1717

1818
#[abi = "cdecl"]
1919
extern mod rustrt {
20-
#[legacy_exports];
21-
unsafe fn debug_tydesc(td: *sys::TypeDesc);
22-
unsafe fn debug_opaque(td: *sys::TypeDesc, x: *());
23-
unsafe fn debug_box(td: *sys::TypeDesc, x: *());
24-
unsafe fn debug_tag(td: *sys::TypeDesc, x: *());
25-
unsafe fn debug_fn(td: *sys::TypeDesc, x: *());
26-
unsafe fn debug_ptrcast(td: *sys::TypeDesc, x: *()) -> *();
27-
unsafe fn rust_dbg_breakpoint();
20+
pub unsafe fn debug_tydesc(td: *sys::TypeDesc);
21+
pub unsafe fn debug_opaque(td: *sys::TypeDesc, x: *());
22+
pub unsafe fn debug_box(td: *sys::TypeDesc, x: *());
23+
pub unsafe fn debug_tag(td: *sys::TypeDesc, x: *());
24+
pub unsafe fn debug_fn(td: *sys::TypeDesc, x: *());
25+
pub unsafe fn debug_ptrcast(td: *sys::TypeDesc, x: *()) -> *();
26+
pub unsafe fn rust_dbg_breakpoint();
2827
}
2928

3029
pub fn debug_tydesc<T>() {

0 commit comments

Comments
 (0)