Skip to content

Commit 3203249

Browse files
committed
core: Un-legacy-export stackwalk, cmath
1 parent cb34138 commit 3203249

File tree

3 files changed

+28
-40
lines changed

3 files changed

+28
-40
lines changed

src/libcore/cmath.rs

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
#[forbid(deprecated_mode)];
44
#[forbid(deprecated_pattern)];
55

6-
export c_float;
7-
export c_double;
8-
96
// uncomment once #1433 is fixed
107
// FIXME (#1433): export c_float_math_consts;
118
// FIXME (#1433): export c_double_math_consts;
129

13-
export c_float_targ_consts;
14-
export c_double_targ_consts;
15-
1610
use libc::c_int;
1711
use libc::c_float;
1812
use libc::c_double;
@@ -22,8 +16,7 @@ use libc::c_double;
2216

2317
#[link_name = "m"]
2418
#[abi = "cdecl"]
25-
extern mod c_double {
26-
#[legacy_exports];
19+
pub extern mod c_double {
2720

2821
// Alpabetically sorted by link_name
2922

@@ -98,8 +91,7 @@ extern mod c_double {
9891

9992
#[link_name = "m"]
10093
#[abi = "cdecl"]
101-
extern mod c_float {
102-
#[legacy_exports];
94+
pub extern mod c_float {
10395

10496
// Alpabetically sorted by link_name
10597

@@ -167,36 +159,34 @@ extern mod c_float {
167159

168160
// FIXME obtain machine float/math constants automatically (Issue #1986)
169161

170-
mod c_float_targ_consts {
171-
#[legacy_exports];
172-
const radix: uint = 2u;
173-
const mantissa_digits: uint = 24u;
174-
const digits: uint = 6u;
175-
const min_exp: uint = -125u;
176-
const max_exp: uint = 128u;
177-
const min_10_exp: int = -37;
178-
const max_10_exp: int = 38;
162+
pub mod c_float_targ_consts {
163+
pub const radix: uint = 2u;
164+
pub const mantissa_digits: uint = 24u;
165+
pub const digits: uint = 6u;
166+
pub const min_exp: uint = -125u;
167+
pub const max_exp: uint = 128u;
168+
pub const min_10_exp: int = -37;
169+
pub const max_10_exp: int = 38;
179170
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
180171
// below.
181-
const min_value: f32 = 1.175494e-38_f32;
182-
const max_value: f32 = 3.402823e+38_f32;
183-
const epsilon: f32 = 0.000000_f32;
172+
pub const min_value: f32 = 1.175494e-38_f32;
173+
pub const max_value: f32 = 3.402823e+38_f32;
174+
pub const epsilon: f32 = 0.000000_f32;
184175
}
185176

186-
mod c_double_targ_consts {
187-
#[legacy_exports];
188-
const radix: uint = 2u;
189-
const mantissa_digits: uint = 53u;
190-
const digits: uint = 15u;
191-
const min_exp: uint = -1021u;
192-
const max_exp: uint = 1024u;
193-
const min_10_exp: int = -307;
194-
const max_10_exp: int = 308;
177+
pub mod c_double_targ_consts {
178+
pub const radix: uint = 2u;
179+
pub const mantissa_digits: uint = 53u;
180+
pub const digits: uint = 15u;
181+
pub const min_exp: uint = -1021u;
182+
pub const max_exp: uint = 1024u;
183+
pub const min_10_exp: int = -307;
184+
pub const max_10_exp: int = 308;
195185
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
196186
// below.
197-
const min_value: f64 = 2.225074e-308_f64;
198-
const max_value: f64 = 1.797693e+308_f64;
199-
const epsilon: f64 = 2.220446e-16_f64;
187+
pub const min_value: f64 = 2.225074e-308_f64;
188+
pub const max_value: f64 = 1.797693e+308_f64;
189+
pub const epsilon: f64 = 2.220446e-16_f64;
200190
}
201191

202192
/*

src/libcore/core.rc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,7 @@ mod rt;
340340
mod unicode;
341341
#[legacy_exports]
342342
mod private;
343-
#[legacy_exports]
344343
mod cmath;
345-
#[legacy_exports]
346344
mod stackwalk;
347345

348346
// Local Variables:

src/libcore/stackwalk.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ use cast::reinterpret_cast;
88
use ptr::offset;
99
use sys::size_of;
1010

11-
type Word = uint;
11+
pub type Word = uint;
1212

13-
struct Frame {
13+
pub struct Frame {
1414
fp: *Word
1515
}
1616

17-
fn Frame(fp: *Word) -> Frame {
17+
pub fn Frame(fp: *Word) -> Frame {
1818
Frame {
1919
fp: fp
2020
}
2121
}
2222

23-
fn walk_stack(visit: fn(Frame) -> bool) {
23+
pub fn walk_stack(visit: fn(Frame) -> bool) {
2424

2525
debug!("beginning stack walk");
2626

0 commit comments

Comments
 (0)