Skip to content

Commit 0792ebe

Browse files
committed
Finish de-exporting int-template and the int modules.
1 parent 3efe499 commit 0792ebe

File tree

7 files changed

+18
-48
lines changed

7 files changed

+18
-48
lines changed

src/libcore/core.rc

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,54 +84,38 @@ export private;
8484
// Built-in-type support modules
8585

8686
/// Operations and constants for `int`
87-
#[legacy_exports]
8887
#[path = "int-template"]
8988
mod int {
90-
#[legacy_exports];
91-
use inst::{ pow };
92-
export pow;
89+
pub use inst::{ pow };
9390
#[path = "int.rs"]
94-
#[legacy_exports]
9591
mod inst;
9692
}
9793

9894
/// Operations and constants for `i8`
99-
#[legacy_exports]
10095
#[path = "int-template"]
10196
mod i8 {
102-
#[legacy_exports];
10397
#[path = "i8.rs"]
104-
#[legacy_exports]
10598
mod inst;
10699
}
107100

108101
/// Operations and constants for `i16`
109-
#[legacy_exports]
110102
#[path = "int-template"]
111103
mod i16 {
112-
#[legacy_exports];
113104
#[path = "i16.rs"]
114-
#[legacy_exports]
115105
mod inst;
116106
}
117107

118108
/// Operations and constants for `i32`
119-
#[legacy_exports]
120109
#[path = "int-template"]
121110
mod i32 {
122-
#[legacy_exports];
123111
#[path = "i32.rs"]
124-
#[legacy_exports]
125112
mod inst;
126113
}
127114

128115
/// Operations and constants for `i64`
129-
#[legacy_exports]
130116
#[path = "int-template"]
131117
mod i64 {
132-
#[legacy_exports];
133118
#[path = "i64.rs"]
134-
#[legacy_exports]
135119
mod inst;
136120
}
137121

src/libcore/int-template.rs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@ use cmp::{Eq, Ord};
77
use from_str::FromStr;
88
use num::from_int;
99

10-
export min_value, max_value;
11-
export min, max;
12-
export add, sub, mul, div, rem;
13-
export lt, le, eq, ne, ge, gt;
14-
export is_positive, is_negative;
15-
export is_nonpositive, is_nonnegative;
16-
export range;
17-
export compl;
18-
export abs;
19-
export parse_bytes, from_str, to_str, to_str_bytes, str;
20-
export num, ord, eq, times, timesi;
21-
export bits, bytes;
22-
export str;
23-
2410
pub const bits : uint = inst::bits;
2511
pub const bytes : uint = (inst::bits / 8);
2612

@@ -190,7 +176,7 @@ pub fn str(i: T) -> ~str { return to_str(i, 10u); }
190176
// FIXME: Has alignment issues on windows and 32-bit linux (#2609)
191177
#[test]
192178
#[ignore]
193-
pub fn test_from_str() {
179+
fn test_from_str() {
194180
assert from_str(~"0") == Some(0 as T);
195181
assert from_str(~"3") == Some(3 as T);
196182
assert from_str(~"10") == Some(10 as T);
@@ -210,7 +196,7 @@ pub fn test_from_str() {
210196
// FIXME: Has alignment issues on windows and 32-bit linux (#2609)
211197
#[test]
212198
#[ignore]
213-
pub fn test_parse_bytes() {
199+
fn test_parse_bytes() {
214200
use str::to_bytes;
215201
assert parse_bytes(to_bytes(~"123"), 10u) == Some(123 as T);
216202
assert parse_bytes(to_bytes(~"1001"), 2u) == Some(9 as T);
@@ -235,7 +221,7 @@ pub fn test_parse_bytes() {
235221
}
236222

237223
#[test]
238-
pub fn test_to_str() {
224+
fn test_to_str() {
239225
assert (to_str(0 as T, 10u) == ~"0");
240226
assert (to_str(1 as T, 10u) == ~"1");
241227
assert (to_str(-1 as T, 10u) == ~"-1");
@@ -244,7 +230,7 @@ pub fn test_to_str() {
244230
}
245231

246232
#[test]
247-
pub fn test_interfaces() {
233+
fn test_interfaces() {
248234
fn test<U:num::Num cmp::Eq>(+ten: U) {
249235
assert (ten.to_int() == 10);
250236

@@ -263,7 +249,7 @@ pub fn test_interfaces() {
263249
}
264250

265251
#[test]
266-
pub fn test_times() {
252+
fn test_times() {
267253
use iter::Times;
268254
let ten = 10 as T;
269255
let mut accum = 0;
@@ -274,7 +260,7 @@ pub fn test_times() {
274260
#[test]
275261
#[should_fail]
276262
#[ignore(cfg(windows))]
277-
pub fn test_times_negative() {
263+
fn test_times_negative() {
278264
use iter::Times;
279265
for (-10).times { log(error, ~"nope!"); }
280266
}

src/libcore/int-template/i16.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
type T = i16;
2-
const bits: uint = u16::bits;
1+
pub type T = i16;
2+
pub const bits: uint = u16::bits;

src/libcore/int-template/i32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
type T = i32;
2-
const bits: uint = u32::bits;
1+
pub type T = i32;
2+
pub const bits: uint = u32::bits;

src/libcore/int-template/i64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
type T = i64;
2-
const bits: uint = u64::bits;
1+
pub type T = i64;
2+
pub const bits: uint = u64::bits;

src/libcore/int-template/i8.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
type T = i8;
2-
const bits: uint = u8::bits;
1+
pub type T = i8;
2+
pub const bits: uint = u8::bits;

src/libcore/int-template/int.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
type T = int;
2-
const bits: uint = uint::bits;
1+
pub type T = int;
2+
pub const bits: uint = uint::bits;
33

44
/// Returns `base` raised to the power of `exponent`
5-
fn pow(base: int, exponent: uint) -> int {
5+
pub fn pow(base: int, exponent: uint) -> int {
66
if exponent == 0u { return 1; } //Not mathemtically true if ~[base == 0]
77
if base == 0 { return 0; }
88
let mut my_pow = exponent;

0 commit comments

Comments
 (0)