Skip to content

Commit 71666eb

Browse files
committed
---
yaml --- r: 140745 b: refs/heads/try2 c: 8a5561b h: refs/heads/master i: 140743: 6efd1da v: v3
1 parent 7555e57 commit 71666eb

File tree

6 files changed

+31
-25
lines changed

6 files changed

+31
-25
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: 2a9a4a81e15fbd8146ce8fe5842c46ad615cbcf6
8+
refs/heads/try2: 8a5561bc18b45f3a8930a05c3523d4f341b2462f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,7 @@ 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-
match self.classify() {
582-
FPNormal => true,
583-
_ => false,
584-
}
581+
self.classify() == FPNormal
585582
}
586583

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

593590
match (
591+
unsafe { ::cast::transmute::<f32,u32>(*self) } & MAN_MASK,
594592
unsafe { ::cast::transmute::<f32,u32>(*self) } & EXP_MASK,
595-
unsafe { ::cast::transmute::<f32,u32>(*self) } & MAN_MASK
596593
) {
597-
(EXP_MASK, 0) => FPInfinite,
598-
(EXP_MASK, _) => FPNaN,
599-
(exp, _) if exp != 0 => FPNormal,
600-
_ if self.is_zero() => FPZero,
601-
_ => FPSubnormal,
594+
(0, 0) => FPZero,
595+
(_, 0) => FPSubnormal,
596+
(0, EXP_MASK) => FPInfinite,
597+
(_, EXP_MASK) => FPNaN,
598+
_ => FPNormal,
602599
}
603600
}
604601

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,7 @@ 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-
match self.classify() {
625-
FPNormal => true,
626-
_ => false,
627-
}
624+
self.classify() == FPNormal
628625
}
629626

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

636633
match (
634+
unsafe { ::cast::transmute::<f64,u64>(*self) } & MAN_MASK,
637635
unsafe { ::cast::transmute::<f64,u64>(*self) } & EXP_MASK,
638-
unsafe { ::cast::transmute::<f64,u64>(*self) } & MAN_MASK
639636
) {
640-
(EXP_MASK, 0) => FPInfinite,
641-
(EXP_MASK, _) => FPNaN,
642-
(exp, _) if exp != 0 => FPNormal,
643-
_ if self.is_zero() => FPZero,
644-
_ => FPSubnormal,
637+
(0, 0) => FPZero,
638+
(_, 0) => FPSubnormal,
639+
(0, EXP_MASK) => FPInfinite,
640+
(_, EXP_MASK) => FPNaN,
641+
_ => FPNormal,
645642
}
646643
}
647644

branches/try2/src/libcore/util.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 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,6 +132,20 @@ 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+
135149
/**
136150
A utility function for indicating unreachable code. It will fail if
137151
executed. This is occasionally useful to put after loops that never

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,6 @@ pub impl Resolver {
19091909
}
19101910

19111911
if self.unresolved_imports == prev_unresolved_imports {
1912-
self.session.err(~"failed to resolve imports");
19131912
self.report_unresolved_imports(module_root);
19141913
break;
19151914
}

branches/try2/src/test/compile-fail/issue-2937.rs

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

11-
// error-pattern:failed to resolve imports
12-
use x = m::f;
11+
use x = m::f; //~ ERROR failed to resolve import
1312

1413
mod m {
1514
}

0 commit comments

Comments
 (0)