Skip to content

Commit 797c59b

Browse files
committed
---
yaml --- r: 149084 b: refs/heads/try2 c: d2d1129 h: refs/heads/master v: v3
1 parent 5603134 commit 797c59b

File tree

14 files changed

+46
-70
lines changed

14 files changed

+46
-70
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1dc6359a0abd414ed2414da2cfd3751f364a59bf
8+
refs/heads/try2: d2d1129ad071653e32709706bb16606506ca227a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
################################################################################
5151

5252
TARGET_CRATES := std extra green rustuv native flate arena glob term semver \
53-
uuid serialize sync getopts collections
53+
uuid serialize sync getopts collections num
5454
HOST_CRATES := syntax rustc rustdoc fourcc
5555
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5656
TOOLS := compiletest rustdoc rustc
@@ -75,6 +75,7 @@ DEPS_sync := std
7575
DEPS_getopts := std
7676
DEPS_collections := std serialize
7777
DEPS_fourcc := syntax std
78+
DEPS_num := std extra
7879

7980
TOOL_DEPS_compiletest := extra green rustuv getopts
8081
TOOL_DEPS_rustdoc := rustdoc green rustuv

branches/try2/src/doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ li {list-style-type: none; }
3838
* [The Rust compiler, `librustc`](rustc/index.html)
3939

4040
* [The `arena` allocation library](arena/index.html)
41+
* [The `num` arbitrary precision numerics library](num/index.html)
4142
* [The `collections` library](collections/index.html)
4243
* [The `flate` compression library](flate/index.html)
4344
* [The `fourcc` four-character code library](fourcc/index.html)

branches/try2/src/doc/tutorial.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,12 +3026,12 @@ In Rust terminology, we need a way to refer to other crates.
30263026
For that, Rust offers you the `extern mod` declaration:
30273027

30283028
~~~
3029-
extern mod extra;
3030-
// extra ships with Rust, you'll find more details further down.
3029+
extern mod num;
3030+
// `num` ships with Rust (much like `extra`; more details further down).
30313031
30323032
fn main() {
30333033
// The rational number '1/2':
3034-
let one_half = ::extra::rational::Ratio::new(1, 2);
3034+
let one_half = ::num::rational::Ratio::new(1, 2);
30353035
}
30363036
~~~
30373037

@@ -3056,10 +3056,10 @@ of both `use` and local declarations.
30563056
Which can result in something like this:
30573057

30583058
~~~
3059-
extern mod extra;
3059+
extern mod num;
30603060
30613061
use farm::dog;
3062-
use extra::rational::Ratio;
3062+
use num::rational::Ratio;
30633063
30643064
mod farm {
30653065
pub fn dog() { println!("woof"); }
@@ -3224,9 +3224,9 @@ See the [API documentation][stddoc] for details.
32243224

32253225
## The extra library
32263226

3227-
Rust also ships with the [extra library], an accumulation of useful things,
3227+
Rust ships with crates such as the [extra library], an accumulation of useful things,
32283228
that are however not important enough to deserve a place in the standard
3229-
library. You can use them by linking to `extra` with an `extern mod extra;`.
3229+
library. You can link to a library such as `extra` with an `extern mod extra;`.
32303230

32313231
[extra library]: extra/index.html
32323232

branches/try2/src/libextra/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ pub mod time;
6262
pub mod base64;
6363
pub mod workcache;
6464
pub mod enum_set;
65-
#[path="num/bigint.rs"]
66-
pub mod bigint;
67-
#[path="num/rational.rs"]
68-
pub mod rational;
69-
#[path="num/complex.rs"]
70-
pub mod complex;
7165
pub mod stats;
7266
pub mod hex;
7367

branches/try2/src/libextra/num/bigint.rs renamed to branches/try2/src/libnum/bigint.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ A `BigUint` is represented as an array of `BigDigit`s.
1616
A `BigInt` is a combination of `BigUint` and `Sign`.
1717
*/
1818

19-
#[allow(missing_doc)];
20-
#[allow(non_uppercase_statics)];
21-
2219
use std::cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
2320
use std::num;
2421
use std::num::{Zero, One, ToStrRadix, FromStrRadix, Orderable};
@@ -48,7 +45,7 @@ pub type BigDigit = u32;
4845
pub static ZERO_BIG_DIGIT: BigDigit = 0;
4946

5047
pub mod BigDigit {
51-
use bigint::BigDigit;
48+
use super::BigDigit;
5249

5350
#[cfg(target_word_size = "32")]
5451
pub static bits: uint = 16;
@@ -1433,8 +1430,8 @@ impl BigInt {
14331430
14341431
#[cfg(test)]
14351432
mod biguint_tests {
1436-
use super::*;
1437-
use super::RandBigInt;
1433+
use super::{BigDigit, BigUint, ToBigUint};
1434+
use super::{Plus, BigInt, RandBigInt, ToBigInt};
14381435
14391436
use std::cmp::{Less, Equal, Greater};
14401437
use std::i64;
@@ -2090,8 +2087,8 @@ mod biguint_tests {
20902087

20912088
#[cfg(test)]
20922089
mod bigint_tests {
2093-
use super::*;
2094-
use super::RandBigInt;
2090+
use super::{BigDigit, BigUint, ToBigUint};
2091+
use super::{Sign, Minus, Zero, Plus, BigInt, RandBigInt, ToBigInt};
20952092

20962093
use std::cmp::{Less, Equal, Greater};
20972094
use std::i64;
@@ -2591,7 +2588,7 @@ mod bigint_tests {
25912588

25922589
#[cfg(test)]
25932590
mod bench {
2594-
use super::*;
2591+
use super::{BigInt, BigUint};
25952592
use std::iter;
25962593
use std::mem::replace;
25972594
use std::num::{FromPrimitive, Zero, One};

branches/try2/src/libextra/num/complex.rs renamed to branches/try2/src/libnum/complex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<T: ToStrRadix + Num + Ord> ToStrRadix for Cmplx<T> {
191191
mod test {
192192
#[allow(non_uppercase_statics)];
193193

194-
use super::*;
194+
use super::{Complex64, Cmplx};
195195
use std::num::{Zero,One,Real};
196196

197197
pub static _0_0i : Complex64 = Cmplx { re: 0.0, im: 0.0 };
@@ -285,7 +285,7 @@ mod test {
285285
}
286286

287287
mod arith {
288-
use super::*;
288+
use super::{_0_0i, _1_0i, _1_1i, _0_1i, _neg1_1i, _05_05i, all_consts};
289289
use std::num::Zero;
290290

291291
#[test]

branches/try2/src/test/run-pass/phase-use-ignored.rs renamed to branches/try2/src/libnum/lib.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//xfail-fast
11+
#[feature(macro_rules)];
1212

13-
#[feature(phase)];
13+
#[crate_id = "num#0.10-pre"];
14+
#[crate_type = "rlib"];
15+
#[crate_type = "dylib"];
16+
#[license = "MIT/ASL2"];
1417

15-
#[phase(syntax)]
16-
use std::mem;
17-
18-
fn main() {}
18+
extern mod extra;
1919

20+
pub mod bigint;
21+
pub mod rational;
22+
pub mod complex;

branches/try2/src/libextra/num/rational.rs renamed to branches/try2/src/libnum/rational.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -10,11 +10,10 @@
1010

1111
//! Rational numbers
1212
13-
1413
use std::cmp;
1514
use std::from_str::FromStr;
1615
use std::num::{Zero,One,ToStrRadix,FromStrRadix,Round};
17-
use super::bigint::{BigInt, BigUint, Sign, Plus, Minus};
16+
use bigint::{BigInt, BigUint, Sign, Plus, Minus};
1817

1918
/// Represents the ratio between 2 numbers.
2019
#[deriving(Clone)]
@@ -349,7 +348,7 @@ impl<T: FromStrRadix + Clone + Integer + Ord>
349348
#[cfg(test)]
350349
mod test {
351350

352-
use super::*;
351+
use super::{Ratio, Rational, BigRational};
353352
use std::num::{Zero,One,FromStrRadix,FromPrimitive};
354353
use std::from_str::FromStr;
355354

@@ -449,8 +448,8 @@ mod test {
449448

450449

451450
mod arith {
452-
use super::*;
453-
use super::super::*;
451+
use super::{_0, _1, _2, _1_2, _3_2, _neg1_2, to_big};
452+
use super::super::{Ratio, Rational, BigRational};
454453

455454

456455
#[test]

branches/try2/src/libsyntax/ext/expand.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -394,20 +394,15 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
394394
pub fn expand_view_item(vi: &ast::ViewItem,
395395
fld: &mut MacroExpander)
396396
-> ast::ViewItem {
397-
match vi.node {
398-
ast::ViewItemExternMod(..) => {
399-
let should_load = vi.attrs.iter().any(|attr| {
400-
attr.name().get() == "phase" &&
401-
attr.meta_item_list().map_or(false, |phases| {
402-
attr::contains_name(phases, "syntax")
403-
})
404-
});
397+
let should_load = vi.attrs.iter().any(|attr| {
398+
attr.name().get() == "phase" &&
399+
attr.meta_item_list().map_or(false, |phases| {
400+
attr::contains_name(phases, "syntax")
401+
})
402+
});
405403

406-
if should_load {
407-
load_extern_macros(vi, fld);
408-
}
409-
}
410-
ast::ViewItemUse(_) => {}
404+
if should_load {
405+
load_extern_macros(vi, fld);
411406
}
412407

413408
noop_fold_view_item(vi, fld)

branches/try2/src/libsyntax/parse/token.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ declare_special_idents_and_keywords! {
492492
(53, Typeof, "typeof");
493493
(54, Unsized, "unsized");
494494
(55, Yield, "yield");
495-
(56, Do, "do");
496495
}
497496
}
498497

branches/try2/src/test/bench/shootout-pidigits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern mod extra;
11+
extern mod num;
1212

1313
use std::from_str::FromStr;
1414
use std::num::One;
1515
use std::num::Zero;
1616
use std::num::FromPrimitive;
17-
use extra::bigint::BigInt;
17+
use num::bigint::BigInt;
1818

1919
struct Context {
2020
numer: BigInt,

branches/try2/src/test/compile-fail/keyword-do-as-identifier.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

branches/try2/src/test/run-pass/temporary-lifetime-for-conditions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl Drop for Temporary {
2323
}
2424

2525
impl Temporary {
26-
fn do_stuff(&self) -> bool {true}
26+
fn do(&self) -> bool {true}
2727
}
2828

2929
fn borrow() -> ~Temporary { ~Temporary }
@@ -35,7 +35,7 @@ pub fn main() {
3535
// This loop's condition
3636
// should call `Temporary`'s
3737
// `drop` 6 times.
38-
while borrow().do_stuff() {
38+
while borrow().do() {
3939
i += 1;
4040
if i > 5 {
4141
break;
@@ -44,7 +44,7 @@ pub fn main() {
4444

4545
// This if condition should
4646
// call it 1 time
47-
if borrow().do_stuff() {
47+
if borrow().do() {
4848
unsafe { assert_eq!(DROPPED, 7) }
4949
}
5050
}

0 commit comments

Comments
 (0)