Skip to content

Commit 07d066b

Browse files
committed
---
yaml --- r: 28275 b: refs/heads/try c: 4370738 h: refs/heads/master i: 28273: 8f249b6 28271: 59d9743 v: v3
1 parent a9caa80 commit 07d066b

39 files changed

+207
-161
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: ff4b754958cc3acc32dcb9231aafceff692a4f95
5+
refs/heads/try: 437073868e590ff8d1aae7a6fad1d8c49056f0b0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/libcore/at_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Shared Vectors
22
3-
import ptr::addr_of;
3+
use ptr::addr_of;
44

55
export init_op;
66
export capacity;

branches/try/src/libcore/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
//! Boolean logic
88
9-
import cmp::Eq;
9+
use cmp::Eq;
1010

1111
export not, and, or, xor, implies;
1212
export eq, ne, is_true, is_false;

branches/try/src/libcore/box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#[forbid(deprecated_mode)];
55
#[forbid(deprecated_pattern)];
66

7-
import cmp::{Eq, Ord};
7+
use cmp::{Eq, Ord};
88

99
export ptr_eq;
1010

branches/try/src/libcore/char.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#[forbid(deprecated_mode)];
55
#[forbid(deprecated_pattern)];
66

7-
import cmp::Eq;
7+
use cmp::Eq;
88

99
/*
1010
Lu Uppercase_Letter an uppercase letter
@@ -47,9 +47,9 @@ export is_alphabetic,
4747
to_digit, cmp,
4848
escape_default, escape_unicode;
4949

50-
import is_alphabetic = unicode::derived_property::Alphabetic;
51-
import is_XID_start = unicode::derived_property::XID_Start;
52-
import is_XID_continue = unicode::derived_property::XID_Continue;
50+
use is_alphabetic = unicode::derived_property::Alphabetic;
51+
use is_XID_start = unicode::derived_property::XID_Start;
52+
use is_XID_continue = unicode::derived_property::XID_Continue;
5353

5454

5555
/**

branches/try/src/libcore/cmath.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export c_double;
1212
export c_float_targ_consts;
1313
export c_double_targ_consts;
1414

15-
import libc::c_int;
16-
import libc::c_float;
17-
import libc::c_double;
15+
use libc::c_int;
16+
use libc::c_float;
17+
use libc::c_double;
1818

1919
// function names are almost identical to C's libmath, a few have been
2020
// renamed, grep for "rename:"
@@ -65,6 +65,9 @@ extern mod c_double {
6565
// renamed: to be consitent with log as ln
6666
#[link_name="log1p"] pure fn ln1p(n: c_double) -> c_double;
6767
pure fn log10(n: c_double) -> c_double;
68+
#[cfg(target_os="linux")]
69+
#[cfg(target_os="macos")]
70+
#[cfg(target_os="win32")]
6871
pure fn log2(n: c_double) -> c_double;
6972
#[link_name="ilogb"] pure fn ilog_radix(n: c_double) -> c_int;
7073
pure fn modf(n: c_double, &iptr: c_double) -> c_double;
@@ -140,6 +143,9 @@ extern mod c_float {
140143
#[link_name="logf"] pure fn ln(n: c_float) -> c_float;
141144
#[link_name="logbf"] pure fn log_radix(n: c_float) -> c_float;
142145
#[link_name="log1pf"] pure fn ln1p(n: c_float) -> c_float;
146+
#[cfg(target_os="linux")]
147+
#[cfg(target_os="macos")]
148+
#[cfg(target_os="win32")]
143149
#[link_name="log2f"] pure fn log2(n: c_float) -> c_float;
144150
#[link_name="log10f"] pure fn log10(n: c_float) -> c_float;
145151
#[link_name="ilogbf"] pure fn ilog_radix(n: c_float) -> c_int;

branches/try/src/libcore/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
* ~~~
2828
*/
2929

30-
import either::Either;
31-
import libc::size_t;
30+
use either::Either;
31+
use libc::size_t;
3232

3333
export Port;
3434
export Chan;

branches/try/src/libcore/core.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
// Export various ubiquitous types, constructors, methods.
44

5-
import option::{Some, None};
6-
import Option = option::Option;
5+
use option::{Some, None};
6+
use Option = option::Option;
77
// XXX: snapshot rustc is generating code that wants lower-case option
88
#[cfg(stage0)]
9-
import option = option::Option;
9+
use option = option::Option;
1010

11-
import result::{Result, Ok, Err};
11+
use result::{Result, Ok, Err};
1212

13-
import Path = path::Path;
14-
import GenericPath = path::GenericPath;
15-
import WindowsPath = path::WindowsPath;
16-
import PosixPath = path::PosixPath;
13+
use Path = path::Path;
14+
use GenericPath = path::GenericPath;
15+
use WindowsPath = path::WindowsPath;
16+
use PosixPath = path::PosixPath;
1717

18-
import tuple::{TupleOps, ExtendedTupleOps};
19-
import str::{StrSlice, UniqueStr};
20-
import vec::{ConstVector, CopyableVector, ImmutableVector};
21-
import vec::{ImmutableEqVector, ImmutableCopyableVector};
22-
import iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
23-
import iter::{CopyableOrderedIter, Times, TimesIx};
24-
import num::Num;
25-
import ptr::Ptr;
26-
import to_str::ToStr;
18+
use tuple::{TupleOps, ExtendedTupleOps};
19+
use str::{StrSlice, UniqueStr};
20+
use vec::{ConstVector, CopyableVector, ImmutableVector};
21+
use vec::{ImmutableEqVector, ImmutableCopyableVector};
22+
use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
23+
use iter::{CopyableOrderedIter, Times, TimesIx};
24+
use num::Num;
25+
use ptr::Ptr;
26+
use to_str::ToStr;
2727

2828
export Path, WindowsPath, PosixPath, GenericPath;
2929
export Option, Some, None, unreachable;
@@ -44,11 +44,11 @@ export ToStr;
4444
// The compiler has special knowlege of these so we must not duplicate them
4545
// when compiling for testing
4646
#[cfg(notest)]
47-
import ops::{Const, Copy, Send, Owned};
47+
use ops::{Const, Copy, Send, Owned};
4848
#[cfg(notest)]
49-
import ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
49+
use ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
5050
#[cfg(notest)]
51-
import ops::{Shl, Shr, Index};
51+
use ops::{Shl, Shr, Index};
5252

5353
#[cfg(notest)]
5454
export Const, Copy, Send, Owned;
@@ -61,11 +61,11 @@ export Shl, Shr, Index;
6161
use coreops(name = "core", vers = "0.4");
6262

6363
#[cfg(test)]
64-
import coreops::ops::{Const, Copy, Send, Owned};
64+
use coreops::ops::{Const, Copy, Send, Owned};
6565
#[cfg(test)]
66-
import coreops::ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
66+
use coreops::ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
6767
#[cfg(test)]
68-
import coreops::ops::{Shl, Shr, Index};
68+
use coreops::ops::{Shl, Shr, Index};
6969

7070

7171
// Export the log levels as global constants. Higher levels mean

branches/try/src/libcore/dvec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
//
1010
// Note that recursive use is not permitted.
1111

12-
import unsafe::reinterpret_cast;
13-
import ptr::null;
12+
use unsafe::reinterpret_cast;
13+
use ptr::null;
1414

1515
export DVec;
1616
export from_elem;

branches/try/src/libcore/either.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
//! A type that represents one of two alternatives
66
7-
import cmp::Eq;
8-
import result::Result;
7+
use cmp::Eq;
8+
use result::Result;
99

1010
/// The either type
1111
enum Either<T, U> {

branches/try/src/libcore/extfmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ debug!("hello, %s!", "world");
2626
2727
*/
2828

29-
import cmp::Eq;
30-
import option::{Some, None};
29+
use cmp::Eq;
30+
use option::{Some, None};
3131

3232

3333
/*

branches/try/src/libcore/f32.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
77
// PORT
88

9-
import cmath::c_float::*;
10-
import cmath::c_float_targ_consts::*;
9+
use cmath::c_float::*;
10+
use cmath::c_float_targ_consts::*;
1111

1212
export add, sub, mul, div, rem, lt, le, eq, ne, ge, gt;
1313
export is_positive, is_negative, is_nonpositive, is_nonnegative;
@@ -152,10 +152,25 @@ pure fn signbit(x: f32) -> int {
152152
if is_negative(x) { return 1; } else { return 0; }
153153
}
154154

155+
#[cfg(target_os="linux")]
156+
#[cfg(target_os="macos")]
157+
#[cfg(target_os="win32")]
155158
pure fn logarithm(n: f32, b: f32) -> f32 {
156159
return log2(n) / log2(b);
157160
}
158161

162+
#[cfg(target_os="freebsd")]
163+
pure fn logarithm(n: f32, b: f32) -> f32 {
164+
// FIXME (#2000): check if it is good to use log2 instead of ln here;
165+
// in theory should be faster since the radix is 2
166+
return ln(n) / ln(b);
167+
}
168+
169+
#[cfg(target_os="freebsd")]
170+
pure fn log2(n: f32) -> f32 {
171+
return ln(n) / consts::ln_2;
172+
}
173+
159174
impl f32: num::Num {
160175
pure fn add(&&other: f32) -> f32 { return self + other; }
161176
pure fn sub(&&other: f32) -> f32 { return self - other; }

branches/try/src/libcore/f64.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
77
// PORT
88

9-
import cmath::c_double::*;
10-
import cmath::c_double_targ_consts::*;
9+
use cmath::c_double::*;
10+
use cmath::c_double_targ_consts::*;
1111

1212
// Even though this module exports everything defined in it,
1313
// because it contains re-exports, we also have to explicitly
@@ -179,10 +179,25 @@ pure fn signbit(x: f64) -> int {
179179
if is_negative(x) { return 1; } else { return 0; }
180180
}
181181

182+
#[cfg(target_os="linux")]
183+
#[cfg(target_os="macos")]
184+
#[cfg(target_os="win32")]
182185
pure fn logarithm(n: f64, b: f64) -> f64 {
183186
return log2(n) / log2(b);
184187
}
185188

189+
#[cfg(target_os="freebsd")]
190+
pure fn logarithm(n: f64, b: f64) -> f64 {
191+
// FIXME (#2000): check if it is good to use log2 instead of ln here; in
192+
// theory should be faster since the radix is 2
193+
return ln(n) / ln(b);
194+
}
195+
196+
#[cfg(target_os="freebsd")]
197+
pure fn log2(n: f64) -> f64 {
198+
return ln(n) / consts::ln_2;
199+
}
200+
186201
impl f64: num::Num {
187202
pure fn add(&&other: f64) -> f64 { return self + other; }
188203
pure fn sub(&&other: f64) -> f64 { return self - other; }

branches/try/src/libcore/flate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import libc::{c_void, size_t, c_int};
1+
use libc::{c_void, size_t, c_int};
22

33
extern mod rustrt {
44

branches/try/src/libcore/float.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ export j0, j1, jn, y0, y1, yn;
3030

3131
// PORT this must match in width according to architecture
3232

33-
import m_float = f64;
34-
35-
import f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
36-
import f64::logarithm;
37-
import f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
38-
import f64::{erf, erfc, exp, expm1, exp2, abs_sub};
39-
import f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp};
40-
import f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
41-
import f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
42-
import f64::signbit;
43-
import f64::{j0, j1, jn, y0, y1, yn};
44-
import cmp::{Eq, Ord};
45-
import num::from_int;
33+
use m_float = f64;
34+
35+
use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
36+
use f64::logarithm;
37+
use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
38+
use f64::{erf, erfc, exp, expm1, exp2, abs_sub};
39+
use f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp};
40+
use f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
41+
use f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
42+
use f64::signbit;
43+
use f64::{j0, j1, jn, y0, y1, yn};
44+
use cmp::{Eq, Ord};
45+
use num::from_int;
4646

4747
const NaN: float = 0.0/0.0;
4848

branches/try/src/libcore/future.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
* ~~~
1616
*/
1717

18-
import either::Either;
19-
import pipes::recv;
20-
import unsafe::copy_lifetime;
18+
use either::Either;
19+
use pipes::recv;
20+
use unsafe::copy_lifetime;
2121

2222
export Future;
2323
export extensions;

branches/try/src/libcore/hash.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* CPRNG like rand::rng.
1414
*/
1515

16-
import io::Writer;
17-
import io::WriterUtil;
18-
import to_bytes::IterBytes;
16+
use io::Writer;
17+
use io::WriterUtil;
18+
use to_bytes::IterBytes;
1919

2020
export Streaming, State, Hash, HashUtil;
2121
export default_state;

branches/try/src/libcore/int-template.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#[forbid(deprecated_mode)];
33
#[forbid(deprecated_pattern)];
44

5-
import T = inst::T;
6-
import cmp::{Eq, Ord};
7-
import from_str::FromStr;
8-
import num::from_int;
5+
use T = inst::T;
6+
use cmp::{Eq, Ord};
7+
use from_str::FromStr;
8+
use num::from_int;
99

1010
export min_value, max_value;
1111
export min, max;

branches/try/src/libcore/io.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Module: io
44
Basic input/output
55
*/
66

7-
import result::Result;
7+
use result::Result;
88

9-
import cmp::Eq;
10-
import dvec::DVec;
11-
import libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
12-
import libc::consts::os::posix88::*;
13-
import libc::consts::os::extra::*;
9+
use cmp::Eq;
10+
use dvec::DVec;
11+
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
12+
use libc::consts::os::posix88::*;
13+
use libc::consts::os::extra::*;
1414

1515
#[allow(non_camel_case_types)] // not sure what to do about this
1616
type fd_t = c_int;

branches/try/src/libcore/iter-trait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// workaround our lack of traits and lack of macros. See core.{rc,rs} for
33
// how this file is used.
44

5-
import cmp::{Eq, Ord};
6-
import inst::{IMPL_T, EACH, SIZE_HINT};
5+
use cmp::{Eq, Ord};
6+
use inst::{IMPL_T, EACH, SIZE_HINT};
77
export extensions;
88

99
impl<A> IMPL_T<A>: iter::BaseIter<A> {

0 commit comments

Comments
 (0)