Skip to content

Commit 56ebf2b

Browse files
committed
fallout in existing tests
1 parent 73b4f06 commit 56ebf2b

8 files changed

+33
-9
lines changed

src/libstd/num/f32.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1152,9 +1152,10 @@ impl f32 {
11521152
#[stable(feature = "rust1", since = "1.0.0")]
11531153
#[inline]
11541154
pub fn asinh(self) -> f32 {
1155-
match self {
1156-
NEG_INFINITY => NEG_INFINITY,
1157-
x => (x + ((x * x) + 1.0).sqrt()).ln(),
1155+
if self == NEG_INFINITY {
1156+
NEG_INFINITY
1157+
} else {
1158+
(self + ((self * self) + 1.0).sqrt()).ln()
11581159
}
11591160
}
11601161

src/libstd/num/f64.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,10 @@ impl f64 {
10231023
#[stable(feature = "rust1", since = "1.0.0")]
10241024
#[inline]
10251025
pub fn asinh(self) -> f64 {
1026-
match self {
1027-
NEG_INFINITY => NEG_INFINITY,
1028-
x => (x + ((x * x) + 1.0).sqrt()).ln(),
1026+
if self == NEG_INFINITY {
1027+
NEG_INFINITY
1028+
} else {
1029+
(self + ((self * self) + 1.0).sqrt()).ln()
10291030
}
10301031
}
10311032

src/test/compile-fail/issue-6804.rs

+8
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ fn main() { //~ ERROR compilation successful
2424
_ => {},
2525
};
2626
//~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
27+
//~| WARNING floating point constants cannot be used
28+
//~| WARNING this was previously accepted
29+
//~| WARNING floating point constants cannot be used
30+
//~| WARNING this was previously accepted
2731
match [x, 1.0] {
2832
[NAN, _] => {},
2933
_ => {},
3034
};
3135
//~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
36+
//~| WARNING floating point constants cannot be used
37+
//~| WARNING this was previously accepted
38+
//~| WARNING floating point constants cannot be used
39+
//~| WARNING this was previously accepted
3240
}

src/test/debuginfo/constant-in-match-pattern.rs

+3
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@
2121

2222
const CONSTANT: u64 = 3;
2323

24+
#[derive(PartialEq, Eq)]
2425
struct Struct {
2526
a: isize,
2627
b: usize,
2728
}
2829
const STRUCT: Struct = Struct { a: 1, b: 2 };
2930

31+
#[derive(PartialEq, Eq)]
3032
struct TupleStruct(u32);
3133
const TUPLE_STRUCT: TupleStruct = TupleStruct(4);
3234

35+
#[derive(PartialEq, Eq)]
3336
enum Enum {
3437
Variant1(char),
3538
Variant2 { a: u8 },

src/test/run-pass/associated-const-match-patterns.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use empty_struct::XEmpty2 as XFoo;
1717

1818
struct Foo;
1919

20+
#[derive(PartialEq, Eq)]
2021
enum Bar {
2122
Var1,
2223
Var2,

src/test/run-pass/empty-struct-braces.rs

+3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ use empty_struct::*;
1818

1919
struct Empty1 {}
2020
struct Empty2;
21+
22+
#[derive(PartialEq, Eq)]
2123
struct Empty3 {}
24+
2225
const Empty3: Empty3 = Empty3 {};
2326

2427
enum E {

src/test/run-pass/issue-12860.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// pretty-expanded FIXME #23616
12-
1311
#![feature(collections)]
1412

1513
extern crate collections;

src/test/run-pass/match-arm-statics.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,24 @@
99
// except according to those terms.
1010

1111

12+
#[derive(PartialEq, Eq)]
1213
struct NewBool(bool);
1314

15+
#[derive(PartialEq, Eq)]
1416
enum Direction {
1517
North,
1618
East,
1719
South,
1820
West
1921
}
22+
23+
#[derive(PartialEq, Eq)]
2024
struct Foo {
2125
bar: Option<Direction>,
2226
baz: NewBool
2327
}
28+
29+
#[derive(PartialEq, Eq)]
2430
enum EnumWithStructVariants {
2531
Variant1(bool),
2632
Variant2 {
@@ -37,7 +43,7 @@ const VARIANT2_NORTH: EnumWithStructVariants = EnumWithStructVariants::Variant2
3743
dir: Direction::North };
3844

3945
pub mod glfw {
40-
#[derive(Copy, Clone)]
46+
#[derive(Copy, Clone, PartialEq, Eq)]
4147
pub struct InputState(usize);
4248

4349
pub const RELEASE : InputState = InputState(0);
@@ -82,13 +88,15 @@ fn issue_14576() {
8288
_ => unreachable!()
8389
}
8490

91+
#[derive(PartialEq, Eq)]
8592
enum C { D = 3, E = 4 }
8693
const F : C = C::D;
8794

8895
assert_eq!(match C::D { F => 1, _ => 2, }, 1);
8996
}
9097

9198
fn issue_13731() {
99+
#[derive(PartialEq, Eq)]
92100
enum A { AA(()) }
93101
const B: A = A::AA(());
94102

@@ -99,6 +107,7 @@ fn issue_13731() {
99107

100108
fn issue_15393() {
101109
#![allow(dead_code)]
110+
#[derive(PartialEq, Eq)]
102111
struct Flags {
103112
bits: usize
104113
}

0 commit comments

Comments
 (0)