Skip to content

Commit 8d2a148

Browse files
committed
---
yaml --- r: 30797 b: refs/heads/incoming c: c91821d h: refs/heads/master i: 30795: 6e17fca v: v3
1 parent 7ad849b commit 8d2a148

File tree

9 files changed

+124
-163
lines changed

9 files changed

+124
-163
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 25715bd59eb339fd37f979a425651802702b4618
9+
refs/heads/incoming: c91821d356b87dcbede651a1130ea758bf6a5265
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/cleanup.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ use repr::BoxRepr;
1010
use sys::TypeDesc;
1111
use cast::transmute;
1212

13-
export annihilate;
14-
1513
/**
1614
* Runtime structures
1715
*

branches/incoming/src/libcore/cmath.rs

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

6-
// uncomment once #1433 is fixed
7-
// FIXME (#1433): export c_float_math_consts;
8-
// FIXME (#1433): export c_double_math_consts;
9-
106
use libc::c_int;
117
use libc::c_float;
128
use libc::c_double;
@@ -193,66 +189,62 @@ pub mod c_double_targ_consts {
193189
194190
FIXME use these once they can be parsed (see Issue #1433)
195191
196-
mod c_float_math_consts {
197-
#[legacy_exports];
198-
const pi: c_float = 0x1.921fb6p+1_f32;
199-
const div_1_pi: c_float = 0x1.45f306p-2_f32;
200-
const div_2_pi: c_float = 0x1.45f306p-1_f32;
201-
const div_pi_2: c_float = 0x1.921fb6p+0_f32;
202-
const div_pi_4: c_float = 0x1.921fb6p-1_f32;
203-
const div_2_sqrtpi: c_float = 0x1.20dd76p+0_f32;
204-
const e: c_float = 0x1.5bf0a8p+1_f32;
205-
const log2_e: c_float = 0x1.715476p+0_f32;
206-
const log10_e: c_float = 0x1.bcb7b2p-2_f32;
207-
const ln_2: c_float = 0x1.62e43p-1_f32;
208-
const ln_10: c_float = 0x1.26bb1cp+1_f32;
209-
const sqrt2: c_float = 0x1.6a09e6p+0_f32;
210-
const div_1_sqrt2: c_float = 0x1.6a09e6p-1_f32;
192+
pub mod c_float_math_consts {
193+
pub const pi: c_float = 0x1.921fb6p+1_f32;
194+
pub const div_1_pi: c_float = 0x1.45f306p-2_f32;
195+
pub const div_2_pi: c_float = 0x1.45f306p-1_f32;
196+
pub const div_pi_2: c_float = 0x1.921fb6p+0_f32;
197+
pub const div_pi_4: c_float = 0x1.921fb6p-1_f32;
198+
pub const div_2_sqrtpi: c_float = 0x1.20dd76p+0_f32;
199+
pub const e: c_float = 0x1.5bf0a8p+1_f32;
200+
pub const log2_e: c_float = 0x1.715476p+0_f32;
201+
pub const log10_e: c_float = 0x1.bcb7b2p-2_f32;
202+
pub const ln_2: c_float = 0x1.62e43p-1_f32;
203+
pub const ln_10: c_float = 0x1.26bb1cp+1_f32;
204+
pub const sqrt2: c_float = 0x1.6a09e6p+0_f32;
205+
pub const div_1_sqrt2: c_float = 0x1.6a09e6p-1_f32;
211206
}
212207
213-
mod c_double_math_consts {
214-
#[legacy_exports];
215-
const pi: c_double = 0x1.921fb54442d18p+1_f64;
216-
const div_1_pi: c_double = 0x1.45f306dc9c883p-2_f64;
217-
const div_2_pi: c_double = 0x1.45f306dc9c883p-1_f64;
218-
const div_pi_2: c_double = 0x1.921fb54442d18p+0_f64;
219-
const div_pi_4: c_double = 0x1.921fb54442d18p-1_f64;
220-
const div_2_sqrtpi: c_double = 0x1.20dd750429b6dp+0_f64;
221-
const e: c_double = 0x1.5bf0a8b145769p+1_f64;
222-
const log2_e: c_double = 0x1.71547652b82fep+0_f64;
223-
const log10_e: c_double = 0x1.bcb7b1526e50ep-2_f64;
224-
const ln_2: c_double = 0x1.62e42fefa39efp-1_f64;
225-
const ln_10: c_double = 0x1.26bb1bbb55516p+1_f64;
226-
const sqrt2: c_double = 0x1.6a09e667f3bcdp+0_f64;
227-
const div_1_sqrt2: c_double = 0x1.6a09e667f3bcdp-1_f64;
208+
pub mod c_double_math_consts {
209+
pub const pi: c_double = 0x1.921fb54442d18p+1_f64;
210+
pub const div_1_pi: c_double = 0x1.45f306dc9c883p-2_f64;
211+
pub const div_2_pi: c_double = 0x1.45f306dc9c883p-1_f64;
212+
pub const div_pi_2: c_double = 0x1.921fb54442d18p+0_f64;
213+
pub const div_pi_4: c_double = 0x1.921fb54442d18p-1_f64;
214+
pub const div_2_sqrtpi: c_double = 0x1.20dd750429b6dp+0_f64;
215+
pub const e: c_double = 0x1.5bf0a8b145769p+1_f64;
216+
pub const log2_e: c_double = 0x1.71547652b82fep+0_f64;
217+
pub const log10_e: c_double = 0x1.bcb7b1526e50ep-2_f64;
218+
pub const ln_2: c_double = 0x1.62e42fefa39efp-1_f64;
219+
pub const ln_10: c_double = 0x1.26bb1bbb55516p+1_f64;
220+
pub const sqrt2: c_double = 0x1.6a09e667f3bcdp+0_f64;
221+
pub const div_1_sqrt2: c_double = 0x1.6a09e667f3bcdp-1_f64;
228222
}
229223
230-
mod c_float_targ_consts {
231-
#[legacy_exports];
232-
const radix: uint = 2u;
233-
const mantissa_digits: uint = 24u;
234-
const digits: uint = 6u;
235-
const min_exp: int = -125;
236-
const max_exp: int = 128;
237-
const min_10_exp: int = -37;
238-
const max_10_exp: int = 38;
239-
const min_value: c_float = 0x1p-126_f32;
240-
const max_value: c_float = 0x1.fffffep+127_f32;
241-
const epsilon: c_float = 0x1p-23_f32;
224+
pub mod c_float_targ_consts {
225+
pub const radix: uint = 2u;
226+
pub const mantissa_digits: uint = 24u;
227+
pub const digits: uint = 6u;
228+
pub const min_exp: int = -125;
229+
pub const max_exp: int = 128;
230+
pub const min_10_exp: int = -37;
231+
pub const max_10_exp: int = 38;
232+
pub const min_value: c_float = 0x1p-126_f32;
233+
pub const max_value: c_float = 0x1.fffffep+127_f32;
234+
pub const epsilon: c_float = 0x1p-23_f32;
242235
}
243236
244-
mod c_double_targ_consts {
245-
#[legacy_exports];
246-
const radix: uint = 2u;
247-
const mantissa_digits: uint = 53u;
248-
const digits: uint = 15u;
249-
const min_exp: int = -1021;
250-
const max_exp: int = 1024;
251-
const min_10_exp: int = -307;
252-
const max_10_exp: int = 308;
253-
const min_value: c_double = 0x1p-1022_f64;
254-
const max_value: c_double = 0x1.fffffffffffffp+1023_f64;
255-
const epsilon: c_double = 0x1p-52_f64;
237+
pub mod c_double_targ_consts {
238+
pub const radix: uint = 2u;
239+
pub const mantissa_digits: uint = 53u;
240+
pub const digits: uint = 15u;
241+
pub const min_exp: int = -1021;
242+
pub const max_exp: int = 1024;
243+
pub const min_10_exp: int = -307;
244+
pub const max_10_exp: int = 308;
245+
pub const min_value: c_double = 0x1p-1022_f64;
246+
pub const max_value: c_double = 0x1.fffffffffffffp+1023_f64;
247+
pub const epsilon: c_double = 0x1p-52_f64;
256248
}
257249
258250
*/

branches/incoming/src/libcore/future.rs

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,8 @@ use either::Either;
1919
use pipes::recv;
2020
use cast::copy_lifetime;
2121

22-
export Future;
23-
export extensions;
24-
export from_value;
25-
export from_port;
26-
export from_fn;
27-
export get;
28-
export with;
29-
export spawn;
30-
31-
// for task.rs
32-
export future_pipe;
33-
3422
#[doc = "The future type"]
35-
struct Future<A> {
23+
pub struct Future<A> {
3624
/*priv*/ mut state: FutureState<A>,
3725

3826
// FIXME(#2829) -- futures should not be copyable, because they close
@@ -67,7 +55,7 @@ impl<A> Future<A> {
6755
}
6856
}
6957

70-
fn from_value<A>(+val: A) -> Future<A> {
58+
pub fn from_value<A>(+val: A) -> Future<A> {
7159
/*!
7260
* Create a future from a value
7361
*
@@ -78,7 +66,8 @@ fn from_value<A>(+val: A) -> Future<A> {
7866
Future {state: Forced(~(move val))}
7967
}
8068

81-
fn from_port<A:Send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
69+
pub fn from_port<A:Send>(+port: future_pipe::client::waiting<A>) ->
70+
Future<A> {
8271
/*!
8372
* Create a future from a port
8473
*
@@ -97,7 +86,7 @@ fn from_port<A:Send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
9786
}
9887
}
9988

100-
fn from_fn<A>(+f: ~fn() -> A) -> Future<A> {
89+
pub fn from_fn<A>(+f: ~fn() -> A) -> Future<A> {
10190
/*!
10291
* Create a future from a function.
10392
*
@@ -109,7 +98,7 @@ fn from_fn<A>(+f: ~fn() -> A) -> Future<A> {
10998
Future {state: Pending(move f)}
11099
}
111100

112-
fn spawn<A:Send>(+blk: fn~() -> A) -> Future<A> {
101+
pub fn spawn<A:Send>(+blk: fn~() -> A) -> Future<A> {
113102
/*!
114103
* Create a future from a unique closure.
115104
*
@@ -122,7 +111,7 @@ fn spawn<A:Send>(+blk: fn~() -> A) -> Future<A> {
122111
}))
123112
}
124113

125-
fn get_ref<A>(future: &r/Future<A>) -> &r/A {
114+
pub fn get_ref<A>(future: &r/Future<A>) -> &r/A {
126115
/*!
127116
* Executes the future's closure and then returns a borrowed
128117
* pointer to the result. The borrowed pointer lasts as long as
@@ -160,13 +149,13 @@ fn get_ref<A>(future: &r/Future<A>) -> &r/A {
160149
}
161150
}
162151

163-
fn get<A:Copy>(future: &Future<A>) -> A {
152+
pub fn get<A:Copy>(future: &Future<A>) -> A {
164153
//! Get the value of the future
165154
166155
*get_ref(future)
167156
}
168157

169-
fn with<A,B>(future: &Future<A>, blk: fn((&A)) -> B) -> B {
158+
pub fn with<A,B>(future: &Future<A>, blk: fn((&A)) -> B) -> B {
170159
//! Work with the value without copying it
171160
172161
blk(get_ref(future))
@@ -179,74 +168,73 @@ proto! future_pipe (
179168
)
180169

181170
#[allow(non_implicitly_copyable_typarams)]
182-
mod test {
183-
#[legacy_exports];
171+
pub mod test {
184172
#[test]
185-
fn test_from_value() {
173+
pub fn test_from_value() {
186174
let f = from_value(~"snail");
187175
assert get(&f) == ~"snail";
188176
}
189177

190178
#[test]
191-
fn test_from_port() {
179+
pub fn test_from_port() {
192180
let (po, ch) = future_pipe::init();
193181
future_pipe::server::completed(ch, ~"whale");
194182
let f = from_port(po);
195183
assert get(&f) == ~"whale";
196184
}
197185

198186
#[test]
199-
fn test_from_fn() {
187+
pub fn test_from_fn() {
200188
let f = from_fn(|| ~"brail");
201189
assert get(&f) == ~"brail";
202190
}
203191

204192
#[test]
205-
fn test_interface_get() {
193+
pub fn test_interface_get() {
206194
let f = from_value(~"fail");
207195
assert f.get() == ~"fail";
208196
}
209197

210198
#[test]
211-
fn test_with() {
199+
pub fn test_with() {
212200
let f = from_value(~"nail");
213201
assert with(&f, |v| copy *v) == ~"nail";
214202
}
215203

216204
#[test]
217-
fn test_get_ref_method() {
205+
pub fn test_get_ref_method() {
218206
let f = from_value(22);
219207
assert *f.get_ref() == 22;
220208
}
221209

222210
#[test]
223-
fn test_get_ref_fn() {
211+
pub fn test_get_ref_fn() {
224212
let f = from_value(22);
225213
assert *get_ref(&f) == 22;
226214
}
227215

228216
#[test]
229-
fn test_interface_with() {
217+
pub fn test_interface_with() {
230218
let f = from_value(~"kale");
231219
assert f.with(|v| copy *v) == ~"kale";
232220
}
233221

234222
#[test]
235-
fn test_spawn() {
223+
pub fn test_spawn() {
236224
let f = spawn(|| ~"bale");
237225
assert get(&f) == ~"bale";
238226
}
239227

240228
#[test]
241229
#[should_fail]
242230
#[ignore(cfg(target_os = "win32"))]
243-
fn test_futurefail() {
231+
pub fn test_futurefail() {
244232
let f = spawn(|| fail);
245233
let _x: ~str = get(&f);
246234
}
247235

248236
#[test]
249-
fn test_sendable_future() {
237+
pub fn test_sendable_future() {
250238
let expected = ~"schlorf";
251239
let f = do spawn |copy expected| { copy expected };
252240
do task::spawn {

branches/incoming/src/libcore/gc.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ use libc::size_t;
3434
use libc::uintptr_t;
3535
use send_map::linear::LinearMap;
3636

37-
export Word;
38-
export gc;
39-
export cleanup_stack_for_failure;
40-
4137
// Mirrors rust_stack.h stk_seg
4238
struct StackSegment {
4339
prev: *StackSegment,
@@ -268,7 +264,7 @@ unsafe fn walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) {
268264
}
269265
}
270266

271-
fn gc() {
267+
pub fn gc() {
272268
unsafe {
273269
// Abort when GC is disabled.
274270
if get_safe_point_count() == 0 {
@@ -301,7 +297,7 @@ fn expect_sentinel() -> bool { false }
301297
// This should only be called from fail, as it will drop the roots
302298
// which are *live* on the stack, rather than dropping those that are
303299
// dead.
304-
fn cleanup_stack_for_failure() {
300+
pub fn cleanup_stack_for_failure() {
305301
unsafe {
306302
// Abort when GC is disabled.
307303
if get_safe_point_count() == 0 {

0 commit comments

Comments
 (0)