Skip to content

Commit 07134ec

Browse files
committed
---
yaml --- r: 140750 b: refs/heads/try2 c: a9f2132 h: refs/heads/master v: v3
1 parent ee358a9 commit 07134ec

File tree

22 files changed

+224
-149
lines changed

22 files changed

+224
-149
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: 2774392b41af806028d9946f42e84495d58a33d6
8+
refs/heads/try2: a9f21326062b0b455aebd2459e8406b03a048a26
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,8 +1425,6 @@ names are effectively reserved. Some significant attributes include:
14251425
* The `test` attribute, for marking functions as unit tests.
14261426
* The `allow`, `warn`, `forbid`, and `deny` attributes, for controlling lint checks. Lint checks supported
14271427
by the compiler can be found via `rustc -W help`.
1428-
* The `deriving` attribute, for automatically generating
1429-
implementations of certain traits.
14301428

14311429
Other attributes may be added or removed during development of the language.
14321430

@@ -1528,47 +1526,6 @@ A complete list of the built-in language items follows:
15281526
> **Note:** This list is likely to become out of date. We should auto-generate it
15291527
> from `librustc/middle/lang_items.rs`.
15301528
1531-
### Deriving
1532-
1533-
The `deriving` attribute allows certain traits to be automatically
1534-
implemented for data structures. For example, the following will
1535-
create an `impl` for the `Eq` and `Clone` traits for `Foo`, the type
1536-
parameter `T` will be given the `Eq` or `Clone` constraints for the
1537-
appropriate `impl`:
1538-
1539-
~~~
1540-
#[deriving(Eq, Clone)]
1541-
struct Foo<T> {
1542-
a: int,
1543-
b: T
1544-
}
1545-
~~~
1546-
1547-
The generated `impl` for `Eq` is equivalent to
1548-
1549-
~~~
1550-
# struct Foo<T> { a: int, b: T }
1551-
impl<T: Eq> Eq for Foo<T> {
1552-
fn eq(&self, other: &Foo<T>) -> bool {
1553-
self.a == other.a && self.b == other.b
1554-
}
1555-
1556-
fn ne(&self, other: &Foo<T>) -> bool {
1557-
self.a != other.a || self.b != other.b
1558-
}
1559-
}
1560-
~~~
1561-
1562-
Supported traits for `deriving` are:
1563-
1564-
* Comparison traits: `Eq`, `TotalEq`, `Ord`, `TotalOrd`.
1565-
* Serialization: `Encodable`, `Decodable`. These require `std`.
1566-
* `Clone`, to perform deep copies.
1567-
* `IterBytes`, to iterate over the bytes in a data type.
1568-
* `Rand`, to create a random instance of a data type.
1569-
* `ToStr`, to convert to a string. For a type with this instance,
1570-
`obj.to_str()` has the same output as `fmt!("%?", obj)`.
1571-
15721529
# Statements and expressions
15731530

15741531
Rust is _primarily_ an expression language. This means that most forms of

branches/try2/doc/tutorial.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,27 +2290,6 @@ let nonsense = mycircle.radius() * mycircle.area();
22902290

22912291
> ***Note:*** Trait inheritance does not actually work with objects yet
22922292
2293-
## Deriving implementations for traits
2294-
2295-
A small number of traits in `core` and `std` can have implementations
2296-
that can be automatically derived. These instances are specified by
2297-
placing the `deriving` attribute on a data type declaration. For
2298-
example, the following will mean that `Circle` has an implementation
2299-
for `Eq` and can be used with the equality operators, and that a value
2300-
of type `ABC` can be randomly generated and converted to a string:
2301-
2302-
~~~
2303-
#[deriving(Eq)]
2304-
struct Circle { radius: float }
2305-
2306-
#[deriving(Rand, ToStr)]
2307-
enum ABC { A, B, C }
2308-
~~~
2309-
2310-
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
2311-
`TotalOrd`, `Encodable` `Decodable`, `Clone`, `IterBytes`, `Rand` and
2312-
`ToStr`.
2313-
23142293
# Modules and crates
23152294

23162295
The Rust namespace is arranged in a hierarchy of modules. Each source

branches/try2/src/driver/driver.rs

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

11+
#[no_core];
12+
extern mod core(vers = "0.7-pre");
13+
1114
#[cfg(rustpkg)]
1215
extern mod this(name = "rustpkg", vers = "0.7-pre");
1316

branches/try2/src/libcore/num/f32.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,10 @@ impl Float for f32 {
578578
/// Returns `true` if the number is neither zero, infinite, subnormal or NaN
579579
#[inline(always)]
580580
fn is_normal(&self) -> bool {
581-
self.classify() == FPNormal
581+
match self.classify() {
582+
FPNormal => true,
583+
_ => false,
584+
}
582585
}
583586

584587
/// Returns the floating point category of the number. If only one property is going to
@@ -588,14 +591,14 @@ impl Float for f32 {
588591
static MAN_MASK: u32 = 0x007fffff;
589592

590593
match (
591-
unsafe { ::cast::transmute::<f32,u32>(*self) } & MAN_MASK,
592594
unsafe { ::cast::transmute::<f32,u32>(*self) } & EXP_MASK,
595+
unsafe { ::cast::transmute::<f32,u32>(*self) } & MAN_MASK
593596
) {
594-
(0, 0) => FPZero,
595-
(_, 0) => FPSubnormal,
596-
(0, EXP_MASK) => FPInfinite,
597-
(_, EXP_MASK) => FPNaN,
598-
_ => FPNormal,
597+
(EXP_MASK, 0) => FPInfinite,
598+
(EXP_MASK, _) => FPNaN,
599+
(exp, _) if exp != 0 => FPNormal,
600+
_ if self.is_zero() => FPZero,
601+
_ => FPSubnormal,
599602
}
600603
}
601604

branches/try2/src/libcore/num/f64.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,10 @@ impl Float for f64 {
621621
/// Returns `true` if the number is neither zero, infinite, subnormal or NaN
622622
#[inline(always)]
623623
fn is_normal(&self) -> bool {
624-
self.classify() == FPNormal
624+
match self.classify() {
625+
FPNormal => true,
626+
_ => false,
627+
}
625628
}
626629

627630
/// Returns the floating point category of the number. If only one property is going to
@@ -631,14 +634,14 @@ impl Float for f64 {
631634
static MAN_MASK: u64 = 0x000fffffffffffff;
632635

633636
match (
634-
unsafe { ::cast::transmute::<f64,u64>(*self) } & MAN_MASK,
635637
unsafe { ::cast::transmute::<f64,u64>(*self) } & EXP_MASK,
638+
unsafe { ::cast::transmute::<f64,u64>(*self) } & MAN_MASK
636639
) {
637-
(0, 0) => FPZero,
638-
(_, 0) => FPSubnormal,
639-
(0, EXP_MASK) => FPInfinite,
640-
(_, EXP_MASK) => FPNaN,
641-
_ => FPNormal,
640+
(EXP_MASK, 0) => FPInfinite,
641+
(EXP_MASK, _) => FPNaN,
642+
(exp, _) if exp != 0 => FPNormal,
643+
_ if self.is_zero() => FPZero,
644+
_ => FPSubnormal,
642645
}
643646
}
644647

branches/try2/src/libcore/unstable/intrinsics.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ pub extern "rust-intrinsic" {
1919
pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
2020
pub fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
2121
pub fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
22+
23+
#[cfg(not(stage0))]
24+
pub fn atomic_load(src: &int) -> int;
25+
#[cfg(not(stage0))]
26+
pub fn atomic_load_acq(src: &int) -> int;
27+
28+
#[cfg(not(stage0))]
29+
pub fn atomic_store(dst: &mut int, val: int);
30+
#[cfg(not(stage0))]
31+
pub fn atomic_store_rel(dst: &mut int, val: int);
2232

2333
pub fn atomic_xchg(dst: &mut int, src: int) -> int;
2434
pub fn atomic_xchg_acq(dst: &mut int, src: int) -> int;

branches/try2/src/libcore/util.rs

Lines changed: 1 addition & 15 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
//
@@ -132,20 +132,6 @@ impl Drop for NonCopyable {
132132

133133
pub fn NonCopyable() -> NonCopyable { NonCopyable { i: () } }
134134

135-
136-
/// A type with no inhabitants
137-
pub enum Void { }
138-
139-
pub impl Void {
140-
/// A utility function for ignoring this uninhabited type
141-
fn uninhabited(&self) -> ! {
142-
match *self {
143-
// Nothing to match on
144-
}
145-
}
146-
}
147-
148-
149135
/**
150136
A utility function for indicating unreachable code. It will fail if
151137
executed. This is occasionally useful to put after loops that never

0 commit comments

Comments
 (0)