Skip to content

Commit 091813a

Browse files
committed
---
yaml --- r: 113661 b: refs/heads/snap-stage3 c: a211907 h: refs/heads/master i: 113659: 9a8a3a9 v: v3
1 parent 6b3d448 commit 091813a

File tree

12 files changed

+54
-110
lines changed

12 files changed

+54
-110
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: abdacecdf86b4b5a4f432560445a24e1c5f4751b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1ba7bd10c9c537687ca393eca0b323569309b83a
4+
refs/heads/snap-stage3: a211907f88a8ac7a7deb3bd4c028e5dd34be95a2
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/doc/rust.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ See [Break expressions](#break-expressions) and [Continue expressions](#continue
29432943
break_expr : "break" [ lifetime ];
29442944
~~~~
29452945

2946-
A `break` expression has an optional _label_.
2946+
A `break` expression has an optional `label`.
29472947
If the label is absent, then executing a `break` expression immediately terminates the innermost loop enclosing it.
29482948
It is only permitted in the body of a loop.
29492949
If the label is present, then `break foo` terminates the loop with label `foo`,
@@ -2956,7 +2956,7 @@ but must enclose it.
29562956
continue_expr : "continue" [ lifetime ];
29572957
~~~~
29582958

2959-
A `continue` expression has an optional _label_.
2959+
A `continue` expression has an optional `label`.
29602960
If the label is absent,
29612961
then executing a `continue` expression immediately terminates the current iteration of the innermost loop enclosing it,
29622962
returning control to the loop *head*.
@@ -3115,7 +3115,7 @@ let x: List<int> = Cons(10, box Cons(11, box Nil));
31153115
31163116
match x {
31173117
Cons(a, box Cons(b, _)) => {
3118-
process_pair(a, b);
3118+
process_pair(a,b);
31193119
}
31203120
Cons(10, _) => {
31213121
process_ten();
@@ -3329,8 +3329,8 @@ order specified by the tuple type.
33293329
An example of a tuple type and its use:
33303330

33313331
~~~~
3332-
type Pair<'a> = (int, &'a str);
3333-
let p: Pair<'static> = (10, "hello");
3332+
type Pair<'a> = (int,&'a str);
3333+
let p: Pair<'static> = (10,"hello");
33343334
let (a, b) = p;
33353335
assert!(b != "world");
33363336
~~~~

branches/snap-stage3/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ fn main() {
26022602
~~~
26032603

26042604
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
2605-
`TotalOrd`, `Encodable`, `Decodable`, `Clone`,
2605+
`TotalOrd`, `Encodable` `Decodable`, `Clone`,
26062606
`Hash`, `Rand`, `Default`, `Zero`, `FromPrimitive` and `Show`.
26072607

26082608
# Crates and the module system

branches/snap-stage3/src/libcollections/bitv.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,17 +486,13 @@ impl Bitv {
486486
!self.none()
487487
}
488488

489-
pub fn init_to_vec(&self, i: uint) -> uint {
490-
return if self.get(i) { 1 } else { 0 };
491-
}
492-
493489
/**
494490
* Converts `self` to a vector of `uint` with the same length.
495491
*
496492
* Each `uint` in the resulting vector has either value `0u` or `1u`.
497493
*/
498494
pub fn to_vec(&self) -> Vec<uint> {
499-
Vec::from_fn(self.nbits, |x| self.init_to_vec(x))
495+
Vec::from_fn(self.nbits, |i| if self.get(i) { 1 } else { 0 })
500496
}
501497

502498
/**

branches/snap-stage3/src/libcore/bool.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@
1515
//! Implementations of the following traits:
1616
//!
1717
//! * `Not`
18-
//! * `BitAnd`
19-
//! * `BitOr`
20-
//! * `BitXor`
2118
//! * `Ord`
2219
//! * `TotalOrd`
2320
//! * `Eq`
24-
//! * `TotalEq`
2521
//! * `Default`
22+
//! * `Zero`
2623
//!
2724
//! A `to_bit` conversion function.
2825

branches/snap-stage3/src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//!
1818
//! * `memcpy`, `memcmp`, `memset` - These are core memory routines which are
1919
//! often generated by LLVM. Additionally, this library can make explicit
20-
//! calls to these functions. Their signatures are the same as found in C.
20+
//! calls to these funcitons. Their signatures are the same as found in C.
2121
//! These functions are often provided by the system libc, but can also be
2222
//! provided by `librlibc` which is distributed with the standard rust
2323
//! distribution.

branches/snap-stage3/src/libcore/num/mod.rs

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Numeric traits and functions for generic mathematics
1212
//!
1313
//! These are implemented for the primitive numeric types in `std::{u8, u16,
14-
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`.
14+
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64, float}`.
1515
1616
#![allow(missing_doc)]
1717

@@ -97,7 +97,7 @@ pub trait One: Mul<Self, Self> {
9797
pub trait Signed: Num + Neg<Self> {
9898
/// Computes the absolute value.
9999
///
100-
/// For `f32` and `f64`, `NaN` will be returned if the number is `NaN`.
100+
/// For float, f32, and f64, `NaN` will be returned if the number is `NaN`.
101101
fn abs(&self) -> Self;
102102

103103
/// The positive difference of two numbers.
@@ -108,17 +108,15 @@ pub trait Signed: Num + Neg<Self> {
108108

109109
/// Returns the sign of the number.
110110
///
111-
/// For `f32` and `f64`:
112-
///
113-
/// * `1.0` if the number is positive, `+0.0` or `INFINITY`
114-
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
115-
/// * `NaN` if the number is `NaN`
111+
/// For `float`, `f32`, `f64`:
112+
/// * `1.0` if the number is positive, `+0.0` or `INFINITY`
113+
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
114+
/// * `NaN` if the number is `NaN`
116115
///
117116
/// For `int`:
118-
///
119-
/// * `0` if the number is zero
120-
/// * `1` if the number is positive
121-
/// * `-1` if the number is negative
117+
/// * `0` if the number is zero
118+
/// * `1` if the number is positive
119+
/// * `-1` if the number is negative
122120
fn signum(&self) -> Self;
123121

124122
/// Returns true if the number is positive and false if the number is zero or negative.
@@ -130,7 +128,7 @@ pub trait Signed: Num + Neg<Self> {
130128

131129
/// Computes the absolute value.
132130
///
133-
/// For `f32` and `f64`, `NaN` will be returned if the number is `NaN`
131+
/// For float, f32, and f64, `NaN` will be returned if the number is `NaN`
134132
#[inline(always)]
135133
pub fn abs<T: Signed>(value: T) -> T {
136134
value.abs()
@@ -147,17 +145,15 @@ pub fn abs_sub<T: Signed>(x: T, y: T) -> T {
147145

148146
/// Returns the sign of the number.
149147
///
150-
/// For `f32` and `f64`:
151-
///
152-
/// * `1.0` if the number is positive, `+0.0` or `INFINITY`
153-
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
154-
/// * `NaN` if the number is `NaN`
148+
/// For float, f32, f64:
149+
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
150+
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
151+
/// - `NAN` if the number is `NAN`
155152
///
156153
/// For int:
157-
///
158-
/// * `0` if the number is zero
159-
/// * `1` if the number is positive
160-
/// * `-1` if the number is negative
154+
/// - `0` if the number is zero
155+
/// - `1` if the number is positive
156+
/// - `-1` if the number is negative
161157
#[inline(always)] pub fn signum<T: Signed>(value: T) -> T { value.signum() }
162158

163159
/// A trait for values which cannot be negative

branches/snap-stage3/src/libcore/result.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -508,19 +508,12 @@ impl<T, E> Result<T, E> {
508508
/// Unwraps a result, yielding the content of an `Ok`.
509509
/// If the value is an `Err` then it calls `op` with its value.
510510
#[inline]
511-
pub fn unwrap_or_else(self, op: |E| -> T) -> T {
511+
pub fn unwrap_or_handle(self, op: |E| -> T) -> T {
512512
match self {
513513
Ok(t) => t,
514514
Err(e) => op(e)
515515
}
516516
}
517-
518-
/// Deprecated name for `unwrap_or_else()`.
519-
#[deprecated = "replaced by .unwrap_or_else()"]
520-
#[inline]
521-
pub fn unwrap_or_handle(self, op: |E| -> T) -> T {
522-
self.unwrap_or_else(op)
523-
}
524517
}
525518

526519
impl<T, E: Show> Result<T, E> {
@@ -765,8 +758,8 @@ mod tests {
765758
let ok: Result<int, ~str> = Ok(100);
766759
let ok_err: Result<int, ~str> = Err("I got this.".to_owned());
767760

768-
assert_eq!(ok.unwrap_or_else(handler), 100);
769-
assert_eq!(ok_err.unwrap_or_else(handler), 50);
761+
assert_eq!(ok.unwrap_or_handle(handler), 100);
762+
assert_eq!(ok_err.unwrap_or_handle(handler), 50);
770763
}
771764

772765
#[test]
@@ -781,6 +774,6 @@ mod tests {
781774
}
782775

783776
let bad_err: Result<int, ~str> = Err("Unrecoverable mess.".to_owned());
784-
let _ : int = bad_err.unwrap_or_else(handler);
777+
let _ : int = bad_err.unwrap_or_handle(handler);
785778
}
786779
}

branches/snap-stage3/src/libstd/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Numeric traits and functions for generic mathematics
1212
//!
1313
//! These are implemented for the primitive numeric types in `std::{u8, u16,
14-
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`.
14+
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64, float}`.
1515
1616
#![allow(missing_doc)]
1717

branches/snap-stage3/src/libtest/lib.rs

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3333
html_root_url = "http://static.rust-lang.org/doc/master")]
3434

35-
#![feature(asm, macro_rules, phase)]
35+
#![feature(asm, macro_rules)]
3636
#![deny(deprecated_owned_vector)]
3737

3838
extern crate collections;
@@ -83,7 +83,7 @@ pub mod stats;
8383
// colons. This way if some test runner wants to arrange the tests
8484
// hierarchically it may.
8585

86-
#[deriving(Clone, Eq, TotalEq, Hash)]
86+
#[deriving(Clone)]
8787
pub enum TestName {
8888
StaticTestName(&'static str),
8989
DynTestName(StrBuf)
@@ -156,19 +156,6 @@ impl TestFn {
156156
}
157157
}
158158

159-
impl fmt::Show for TestFn {
160-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
161-
f.write(match *self {
162-
StaticTestFn(..) => "StaticTestFn(..)",
163-
StaticBenchFn(..) => "StaticBenchFn(..)",
164-
StaticMetricFn(..) => "StaticMetricFn(..)",
165-
DynTestFn(..) => "DynTestFn(..)",
166-
DynMetricFn(..) => "DynMetricFn(..)",
167-
DynBenchFn(..) => "DynBenchFn(..)"
168-
}.as_bytes())
169-
}
170-
}
171-
172159
/// Manager of the benchmarking runs.
173160
///
174161
/// This is feed into functions marked with `#[bench]` to allow for
@@ -183,14 +170,13 @@ pub struct Bencher {
183170

184171
// The definition of a single test. A test runner will run a list of
185172
// these.
186-
#[deriving(Clone, Show, Eq, TotalEq, Hash)]
173+
#[deriving(Clone)]
187174
pub struct TestDesc {
188175
pub name: TestName,
189176
pub ignore: bool,
190177
pub should_fail: bool,
191178
}
192179

193-
#[deriving(Show)]
194180
pub struct TestDescAndFn {
195181
pub desc: TestDesc,
196182
pub testfn: TestFn,
@@ -256,9 +242,15 @@ pub fn test_main(args: &[StrBuf], tests: Vec<TestDescAndFn> ) {
256242
pub fn test_main_static(args: &[StrBuf], tests: &[TestDescAndFn]) {
257243
let owned_tests = tests.iter().map(|t| {
258244
match t.testfn {
259-
StaticTestFn(f) => TestDescAndFn { testfn: StaticTestFn(f), desc: t.desc.clone() },
260-
StaticBenchFn(f) => TestDescAndFn { testfn: StaticBenchFn(f), desc: t.desc.clone() },
261-
_ => fail!("non-static tests passed to test::test_main_static")
245+
StaticTestFn(f) =>
246+
TestDescAndFn { testfn: StaticTestFn(f), desc: t.desc.clone() },
247+
248+
StaticBenchFn(f) =>
249+
TestDescAndFn { testfn: StaticBenchFn(f), desc: t.desc.clone() },
250+
251+
_ => {
252+
fail!("non-static tests passed to test::test_main_static");
253+
}
262254
}
263255
}).collect();
264256
test_main(args, owned_tests)
@@ -427,15 +419,8 @@ pub fn opt_shard(maybestr: Option<StrBuf>) -> Option<(uint,uint)> {
427419
None => None,
428420
Some(s) => {
429421
let mut it = s.as_slice().split('.');
430-
match (it.next().and_then(from_str::<uint>), it.next().and_then(from_str::<uint>),
431-
it.next()) {
432-
(Some(a), Some(b), None) => {
433-
if a <= 0 || a > b {
434-
fail!("tried to run shard {a}.{b}, but {a} is out of bounds \
435-
(should be between 1 and {b}", a=a, b=b)
436-
}
437-
Some((a, b))
438-
}
422+
match (it.next().and_then(from_str), it.next().and_then(from_str), it.next()) {
423+
(Some(a), Some(b), None) => Some((a, b)),
439424
_ => None,
440425
}
441426
}
@@ -754,9 +739,10 @@ pub fn fmt_bench_samples(bs: &BenchSamples) -> StrBuf {
754739
}
755740

756741
// A simple console test runner
757-
pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> ) -> io::IoResult<bool> {
758-
759-
fn callback<T: Writer>(event: &TestEvent, st: &mut ConsoleTestState<T>) -> io::IoResult<()> {
742+
pub fn run_tests_console(opts: &TestOpts,
743+
tests: Vec<TestDescAndFn> ) -> io::IoResult<bool> {
744+
fn callback<T: Writer>(event: &TestEvent,
745+
st: &mut ConsoleTestState<T>) -> io::IoResult<()> {
760746
match (*event).clone() {
761747
TeFiltered(ref filtered_tests) => st.write_run_start(filtered_tests.len()),
762748
TeWait(ref test, padding) => st.write_test_start(test, padding),
@@ -792,7 +778,6 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> ) -> io::IoR
792778
}
793779
}
794780
}
795-
796781
let mut st = try!(ConsoleTestState::new(opts, None::<StdWriter>));
797782
fn len_if_padded(t: &TestDescAndFn) -> uint {
798783
match t.testfn.padding() {
@@ -948,7 +933,9 @@ fn get_concurrency() -> uint {
948933
}
949934
}
950935

951-
pub fn filter_tests(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> Vec<TestDescAndFn> {
936+
pub fn filter_tests(
937+
opts: &TestOpts,
938+
tests: Vec<TestDescAndFn> ) -> Vec<TestDescAndFn> {
952939
let mut filtered = tests;
953940

954941
// Remove tests that don't match the test filter
@@ -986,9 +973,7 @@ pub fn filter_tests(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> Vec<TestDescA
986973
None => filtered,
987974
Some((a,b)) => {
988975
filtered.move_iter().enumerate()
989-
// note: using a - 1 so that the valid shards, for example, are
990-
// 1.2 and 2.2 instead of 0.2 and 1.2
991-
.filter(|&(i,_)| i % b == (a - 1))
976+
.filter(|&(i,_)| i % b == a)
992977
.map(|(_,t)| t)
993978
.collect()
994979
}

branches/snap-stage3/src/test/run-make/test-shard-completeness/Makefile

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

branches/snap-stage3/src/test/run-make/test-shard-completeness/main.rs

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

0 commit comments

Comments
 (0)