Skip to content

Commit 46d6be8

Browse files
committed
---
yaml --- r: 139399 b: refs/heads/try2 c: 09255db h: refs/heads/master i: 139397: 36c481a 139395: c058f47 139391: fb42803 v: v3
1 parent 799a28c commit 46d6be8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+739
-1077
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: b1c0a6628beb612f3d847ab088e74da639f6ca7b
8+
refs/heads/try2: 09255dbe2d7a94cf6a3d8bf426e428f1a50d3e8c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/RELEASES.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ Version 0.6 (March 2013)
6262
* Pattern matching over vectors improved and expanded
6363
* Typechecking of closure types has been overhauled to
6464
improve inference and eliminate unsoundness
65-
* Macros leave scope at the end of modules, unless that module is
66-
tagged with #[macro_escape]
6765

6866
* Libraries
6967
* Added big integers to `std::bigint`

branches/try2/configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ case $CFG_OSTYPE in
308308
esac
309309

310310

311+
if [ -z "$CFG_CPUTYPE" ]
312+
then
311313
case $CFG_CPUTYPE in
312314

313315
i386 | i486 | i686 | i786 | x86)
@@ -325,6 +327,7 @@ case $CFG_CPUTYPE in
325327
*)
326328
err "unknown CPU type: $CFG_CPUTYPE"
327329
esac
330+
fi
328331

329332
# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
330333
if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]
@@ -572,7 +575,7 @@ fi
572575
CFG_PREFIX=${CFG_PREFIX%/}
573576
CFG_HOST_TRIPLES="$(echo $CFG_HOST_TRIPLES | tr ',' ' ')"
574577
CFG_TARGET_TRIPLES="$(echo $CFG_TARGET_TRIPLES | tr ',' ' ')"
575-
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed -e 's/^CC_//' -e 's/\([^=]*\).*/\1/' | xargs)"
578+
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed 's,^[^_]*_,,' | sed 's/\([^=]*\).*/\1/' | xargs)"
576579

577580
# copy host-triples to target-triples so that hosts are a subset of targets
578581
V_TEMP=""

branches/try2/src/libcore/cmp.rs

Lines changed: 61 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 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
//
@@ -21,82 +21,86 @@ and `Eq` to overload the `==` and `!=` operators.
2121
*/
2222

2323
/**
24-
* Trait for values that can be compared for equality and inequality.
24+
* Trait for values that can be compared for equality
25+
* and inequality.
2526
*
26-
* This trait allows partial equality, where types can be unordered instead of strictly equal or
27-
* unequal. For example, with the built-in floating-point types `a == b` and `a != b` will both
28-
* evaluate to false if either `a` or `b` is NaN (cf. IEEE 754-2008 section 5.11).
29-
*
30-
* Eventually, this will be implemented by default for types that implement `TotalEq`.
27+
* Eventually this may be simplified to only require
28+
* an `eq` method, with the other generated from
29+
* a default implementation. However it should
30+
* remain possible to implement `ne` separately, for
31+
* compatibility with floating-point NaN semantics
32+
* (cf. IEEE 754-2008 section 5.11).
3133
*/
3234
#[lang="eq"]
3335
pub trait Eq {
3436
fn eq(&self, other: &Self) -> bool;
3537
fn ne(&self, other: &Self) -> bool;
3638
}
3739

38-
/// Trait for equality comparisons where `a == b` and `a != b` are strict inverses.
39-
pub trait TotalEq {
40-
fn equals(&self, other: &Self) -> bool;
40+
#[deriving(Eq)]
41+
pub enum Ordering { Less, Equal, Greater }
42+
43+
/// Trait for types that form a total order
44+
pub trait TotalOrd {
45+
fn cmp(&self, other: &Self) -> Ordering;
4146
}
4247

43-
macro_rules! totaleq_impl(
44-
($t:ty) => {
45-
impl TotalEq for $t {
46-
#[inline(always)]
47-
fn equals(&self, other: &$t) -> bool { *self == *other }
48-
}
49-
}
50-
)
48+
#[inline(always)]
49+
fn icmp<T: Ord>(a: &T, b: &T) -> Ordering {
50+
if *a < *b { Less }
51+
else if *a > *b { Greater }
52+
else { Equal }
53+
}
5154

52-
totaleq_impl!(bool)
55+
impl TotalOrd for u8 {
56+
#[inline(always)]
57+
fn cmp(&self, other: &u8) -> Ordering { icmp(self, other) }
58+
}
5359

54-
totaleq_impl!(u8)
55-
totaleq_impl!(u16)
56-
totaleq_impl!(u32)
57-
totaleq_impl!(u64)
60+
impl TotalOrd for u16 {
61+
#[inline(always)]
62+
fn cmp(&self, other: &u16) -> Ordering { icmp(self, other) }
63+
}
5864

59-
totaleq_impl!(i8)
60-
totaleq_impl!(i16)
61-
totaleq_impl!(i32)
62-
totaleq_impl!(i64)
65+
impl TotalOrd for u32 {
66+
#[inline(always)]
67+
fn cmp(&self, other: &u32) -> Ordering { icmp(self, other) }
68+
}
6369

64-
totaleq_impl!(int)
65-
totaleq_impl!(uint)
70+
impl TotalOrd for u64 {
71+
#[inline(always)]
72+
fn cmp(&self, other: &u64) -> Ordering { icmp(self, other) }
73+
}
6674

67-
#[deriving(Eq)]
68-
pub enum Ordering { Less, Equal, Greater }
75+
impl TotalOrd for i8 {
76+
#[inline(always)]
77+
fn cmp(&self, other: &i8) -> Ordering { icmp(self, other) }
78+
}
6979

70-
/// Trait for types that form a total order
71-
pub trait TotalOrd: TotalEq {
72-
fn cmp(&self, other: &Self) -> Ordering;
80+
impl TotalOrd for i16 {
81+
#[inline(always)]
82+
fn cmp(&self, other: &i16) -> Ordering { icmp(self, other) }
7383
}
7484

75-
macro_rules! totalord_impl(
76-
($t:ty) => {
77-
impl TotalOrd for $t {
78-
#[inline(always)]
79-
fn cmp(&self, other: &$t) -> Ordering {
80-
if *self < *other { Less }
81-
else if *self > *other { Greater }
82-
else { Equal }
83-
}
84-
}
85-
}
86-
)
85+
impl TotalOrd for i32 {
86+
#[inline(always)]
87+
fn cmp(&self, other: &i32) -> Ordering { icmp(self, other) }
88+
}
8789

88-
totalord_impl!(u8)
89-
totalord_impl!(u16)
90-
totalord_impl!(u32)
91-
totalord_impl!(u64)
90+
impl TotalOrd for i64 {
91+
#[inline(always)]
92+
fn cmp(&self, other: &i64) -> Ordering { icmp(self, other) }
93+
}
9294

93-
totalord_impl!(i8)
94-
totalord_impl!(i16)
95-
totalord_impl!(i32)
96-
totalord_impl!(i64)
95+
impl TotalOrd for int {
96+
#[inline(always)]
97+
fn cmp(&self, other: &int) -> Ordering { icmp(self, other) }
98+
}
9799

98-
totalord_impl!(int)
99-
totalord_impl!(uint)
100+
impl TotalOrd for uint {
101+
#[inline(always)]
102+
fn cmp(&self, other: &uint) -> Ordering { icmp(self, other) }
103+
}
100104

101105
/**
102106
* Trait for values that can be compared for a sort-order.
@@ -167,17 +171,11 @@ pub fn max<T:Ord>(v1: T, v2: T) -> T {
167171
#[cfg(test)]
168172
mod test {
169173
#[test]
170-
fn test_int_totalord() {
174+
fn test_int() {
171175
assert_eq!(5.cmp(&10), Less);
172176
assert_eq!(10.cmp(&5), Greater);
173177
assert_eq!(5.cmp(&5), Equal);
174178
assert_eq!((-5).cmp(&12), Less);
175179
assert_eq!(12.cmp(-5), Greater);
176180
}
177-
178-
#[test]
179-
fn test_int_totaleq() {
180-
fail_unless!(5.equals(&5));
181-
fail_unless!(!2.equals(&17));
182-
}
183181
}

branches/try2/src/libcore/hashmap.rs

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

11-
//! An unordered map and set type implemented as hash tables
12-
//!
13-
//! The tables use a keyed hash with new random keys generated for each container, so the ordering
14-
//! of a set of keys in a hash table is randomized.
11+
//! Sendable hash maps.
1512
1613
/// Open addressing with linear probing.
1714
pub mod linear {

branches/try2/src/libcore/nil.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 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
//
@@ -15,7 +15,7 @@ Functions for the unit type.
1515
*/
1616

1717
#[cfg(notest)]
18-
use prelude::*;
18+
use cmp::{Eq, Ord, TotalOrd, Ordering, Equal};
1919

2020
#[cfg(notest)]
2121
impl Eq for () {
@@ -42,9 +42,3 @@ impl TotalOrd for () {
4242
#[inline(always)]
4343
fn cmp(&self, _other: &()) -> Ordering { Equal }
4444
}
45-
46-
#[cfg(notest)]
47-
impl TotalEq for () {
48-
#[inline(always)]
49-
fn equals(&self, _other: &()) -> bool { true }
50-
}

branches/try2/src/libcore/ops.rs

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

11-
//! Traits for the built-in operators
11+
// Core operators
1212

1313
#[lang="drop"]
1414
pub trait Drop {

branches/try2/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub use result::{Result, Ok, Err};
2424
/* Reexported types and traits */
2525

2626
pub use clone::Clone;
27-
pub use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
27+
pub use cmp::{Eq, Ord, TotalOrd, Ordering, Less, Equal, Greater};
2828
pub use container::{Container, Mutable, Map, Set};
2929
pub use hash::Hash;
3030
pub use iter::{BaseIter, ReverseIter, MutableIter, ExtendedIter, EqIter};

branches/try2/src/libcore/rt/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp:
126126
type Registers = [uint, ..22];
127127

128128
#[cfg(target_arch = "x86_64")]
129-
fn new_regs() -> ~Registers { ~([0, .. 22]) }
129+
fn new_regs() -> ~Registers { ~[0, .. 22] }
130130

131131
#[cfg(target_arch = "x86_64")]
132132
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {

branches/try2/src/libcore/stackwalk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn breakpoint() {
8080
}
8181
}
8282

83-
fn frame_address(f: &fn(x: *u8)) {
83+
fn frame_address(f: &fn(++x: *u8)) {
8484
unsafe {
8585
rusti::frame_address(f)
8686
}
@@ -95,7 +95,7 @@ pub mod rustrt {
9595
pub mod rusti {
9696
#[abi = "rust-intrinsic"]
9797
pub extern {
98-
pub fn frame_address(f: &once fn(x: *u8));
98+
pub fn frame_address(f: &once fn(++x: *u8));
9999
}
100100
}
101101

branches/try2/src/libcore/str.rs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use at_vec;
2121
use cast;
2222
use char;
2323
use clone::Clone;
24-
use cmp::{Equiv, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
24+
use cmp::{Equiv, TotalOrd, Ordering, Less, Equal, Greater};
2525
use libc;
2626
use option::{None, Option, Some};
2727
use ptr;
@@ -930,30 +930,6 @@ impl Eq for @str {
930930
fn ne(&self, other: &@str) -> bool { !(*self).eq(other) }
931931
}
932932
933-
#[cfg(notest)]
934-
impl<'self> TotalEq for &'self str {
935-
#[inline(always)]
936-
fn equals(&self, other: & &'self str) -> bool {
937-
eq_slice((*self), (*other))
938-
}
939-
}
940-
941-
#[cfg(notest)]
942-
impl TotalEq for ~str {
943-
#[inline(always)]
944-
fn equals(&self, other: &~str) -> bool {
945-
eq_slice((*self), (*other))
946-
}
947-
}
948-
949-
#[cfg(notest)]
950-
impl TotalEq for @str {
951-
#[inline(always)]
952-
fn equals(&self, other: &@str) -> bool {
953-
eq_slice((*self), (*other))
954-
}
955-
}
956-
957933
#[cfg(notest)]
958934
impl Ord for ~str {
959935
#[inline(always)]

0 commit comments

Comments
 (0)