Skip to content

Commit 86041c4

Browse files
committed
De-export std::{dbg,sha1,md4,tempfile,term}. Part of #3583.
1 parent 438bdd6 commit 86041c4

File tree

6 files changed

+36
-49
lines changed

6 files changed

+36
-49
lines changed

src/libstd/dbg.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
55
use cast::reinterpret_cast;
66

7-
export debug_tydesc;
8-
export debug_opaque;
9-
export debug_box;
10-
export debug_tag;
11-
export debug_fn;
12-
export ptr_cast;
13-
export breakpoint;
147

158
#[abi = "cdecl"]
169
extern mod rustrt {
@@ -24,34 +17,34 @@ extern mod rustrt {
2417
fn rust_dbg_breakpoint();
2518
}
2619

27-
fn debug_tydesc<T>() {
20+
pub fn debug_tydesc<T>() {
2821
rustrt::debug_tydesc(sys::get_type_desc::<T>());
2922
}
3023

31-
fn debug_opaque<T>(+x: T) {
24+
pub fn debug_opaque<T>(+x: T) {
3225
rustrt::debug_opaque(sys::get_type_desc::<T>(), ptr::addr_of(x) as *());
3326
}
3427

35-
fn debug_box<T>(x: @T) {
28+
pub fn debug_box<T>(x: @T) {
3629
rustrt::debug_box(sys::get_type_desc::<T>(), ptr::addr_of(x) as *());
3730
}
3831

39-
fn debug_tag<T>(+x: T) {
32+
pub fn debug_tag<T>(+x: T) {
4033
rustrt::debug_tag(sys::get_type_desc::<T>(), ptr::addr_of(x) as *());
4134
}
4235

43-
fn debug_fn<T>(+x: T) {
36+
pub fn debug_fn<T>(+x: T) {
4437
rustrt::debug_fn(sys::get_type_desc::<T>(), ptr::addr_of(x) as *());
4538
}
4639

47-
unsafe fn ptr_cast<T, U>(x: @T) -> @U {
40+
pub unsafe fn ptr_cast<T, U>(x: @T) -> @U {
4841
reinterpret_cast(
4942
&rustrt::debug_ptrcast(sys::get_type_desc::<T>(),
5043
reinterpret_cast(&x)))
5144
}
5245

5346
/// Triggers a debugger breakpoint
54-
fn breakpoint() {
47+
pub fn breakpoint() {
5548
rustrt::rust_dbg_breakpoint();
5649
}
5750

src/libstd/md4.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[forbid(deprecated_mode)];
22
#[forbid(deprecated_pattern)];
33

4-
fn md4(msg: &[u8]) -> {a: u32, b: u32, c: u32, d: u32} {
4+
pub fn md4(msg: &[u8]) -> {a: u32, b: u32, c: u32, d: u32} {
55
// subtle: if orig_len is merely uint, then the code below
66
// which performs shifts by 32 bits or more has undefined
77
// results.
@@ -85,7 +85,7 @@ fn md4(msg: &[u8]) -> {a: u32, b: u32, c: u32, d: u32} {
8585
return {a: a, b: b, c: c, d: d};
8686
}
8787

88-
fn md4_str(msg: &[u8]) -> ~str {
88+
pub fn md4_str(msg: &[u8]) -> ~str {
8989
let {a, b, c, d} = md4(msg);
9090
fn app(a: u32, b: u32, c: u32, d: u32, f: fn(u32)) {
9191
f(a); f(b); f(c); f(d);
@@ -103,7 +103,7 @@ fn md4_str(msg: &[u8]) -> ~str {
103103
result
104104
}
105105

106-
fn md4_text(msg: &str) -> ~str { md4_str(str::to_bytes(msg)) }
106+
pub fn md4_text(msg: &str) -> ~str { md4_str(str::to_bytes(msg)) }
107107

108108
#[test]
109109
fn test_md4() {

src/libstd/sha1.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* implementation, which is written for clarity, not speed. At some
2121
* point this will want to be rewritten.
2222
*/
23-
export sha1;
2423

2524
/// The SHA-1 interface
2625
trait Sha1 {
@@ -53,7 +52,7 @@ const k3: u32 = 0xCA62C1D6u32;
5352

5453

5554
/// Construct a `sha` object
56-
fn sha1() -> Sha1 {
55+
pub fn sha1() -> Sha1 {
5756
type Sha1State =
5857
{h: ~[mut u32],
5958
mut len_low: u32,

src/libstd/std.rc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,14 @@ mod treemap;
110110
mod ebml;
111111
#[legacy_exports]
112112
mod ebml2;
113-
#[legacy_exports]
114113
mod dbg;
115114
#[legacy_exports]
116115
mod getopts;
117116
#[legacy_exports]
118117
mod json;
119-
#[legacy_exports]
120118
mod sha1;
121-
#[legacy_exports]
122119
mod md4;
123-
#[legacy_exports]
124120
mod tempfile;
125-
#[legacy_exports]
126121
mod term;
127122
#[legacy_exports]
128123
mod time;

src/libstd/tempfile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use core::option;
77
use option::{None, Some};
88

9-
fn mkdtemp(tmpdir: &Path, suffix: &str) -> Option<Path> {
9+
pub fn mkdtemp(tmpdir: &Path, suffix: &str) -> Option<Path> {
1010
let r = rand::Rng();
1111
let mut i = 0u;
1212
while (i < 1000u) {

src/libstd/term.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ use core::Option;
66

77
// FIXME (#2807): Windows support.
88

9-
const color_black: u8 = 0u8;
10-
const color_red: u8 = 1u8;
11-
const color_green: u8 = 2u8;
12-
const color_yellow: u8 = 3u8;
13-
const color_blue: u8 = 4u8;
14-
const color_magenta: u8 = 5u8;
15-
const color_cyan: u8 = 6u8;
16-
const color_light_gray: u8 = 7u8;
17-
const color_light_grey: u8 = 7u8;
18-
const color_dark_gray: u8 = 8u8;
19-
const color_dark_grey: u8 = 8u8;
20-
const color_bright_red: u8 = 9u8;
21-
const color_bright_green: u8 = 10u8;
22-
const color_bright_yellow: u8 = 11u8;
23-
const color_bright_blue: u8 = 12u8;
24-
const color_bright_magenta: u8 = 13u8;
25-
const color_bright_cyan: u8 = 14u8;
26-
const color_bright_white: u8 = 15u8;
9+
pub const color_black: u8 = 0u8;
10+
pub const color_red: u8 = 1u8;
11+
pub const color_green: u8 = 2u8;
12+
pub const color_yellow: u8 = 3u8;
13+
pub const color_blue: u8 = 4u8;
14+
pub const color_magenta: u8 = 5u8;
15+
pub const color_cyan: u8 = 6u8;
16+
pub const color_light_gray: u8 = 7u8;
17+
pub const color_light_grey: u8 = 7u8;
18+
pub const color_dark_gray: u8 = 8u8;
19+
pub const color_dark_grey: u8 = 8u8;
20+
pub const color_bright_red: u8 = 9u8;
21+
pub const color_bright_green: u8 = 10u8;
22+
pub const color_bright_yellow: u8 = 11u8;
23+
pub const color_bright_blue: u8 = 12u8;
24+
pub const color_bright_magenta: u8 = 13u8;
25+
pub const color_bright_cyan: u8 = 14u8;
26+
pub const color_bright_white: u8 = 15u8;
2727

28-
fn esc(writer: io::Writer) { writer.write(~[0x1bu8, '[' as u8]); }
28+
pub fn esc(writer: io::Writer) { writer.write(~[0x1bu8, '[' as u8]); }
2929

3030
/// Reset the foreground and background colors to default
31-
fn reset(writer: io::Writer) {
31+
pub fn reset(writer: io::Writer) {
3232
esc(writer);
3333
writer.write(~['0' as u8, 'm' as u8]);
3434
}
3535

3636
/// Returns true if the terminal supports color
37-
fn color_supported() -> bool {
37+
pub fn color_supported() -> bool {
3838
let supported_terms = ~[~"xterm-color", ~"xterm",
3939
~"screen-bce", ~"xterm-256color"];
4040
return match os::getenv(~"TERM") {
@@ -48,7 +48,7 @@ fn color_supported() -> bool {
4848
};
4949
}
5050

51-
fn set_color(writer: io::Writer, first_char: u8, color: u8) {
51+
pub fn set_color(writer: io::Writer, first_char: u8, color: u8) {
5252
assert (color < 16u8);
5353
esc(writer);
5454
let mut color = color;
@@ -57,12 +57,12 @@ fn set_color(writer: io::Writer, first_char: u8, color: u8) {
5757
}
5858

5959
/// Set the foreground color
60-
fn fg(writer: io::Writer, color: u8) {
60+
pub fn fg(writer: io::Writer, color: u8) {
6161
return set_color(writer, '3' as u8, color);
6262
}
6363

6464
/// Set the background color
65-
fn bg(writer: io::Writer, color: u8) {
65+
pub fn bg(writer: io::Writer, color: u8) {
6666
return set_color(writer, '4' as u8, color);
6767
}
6868

0 commit comments

Comments
 (0)