fallout in existing tests

This commit is contained in:
Niko Matsakis 2016-03-11 13:36:46 -05:00
parent 73b4f06b83
commit 56ebf2b046
8 changed files with 33 additions and 9 deletions

View File

@ -1152,9 +1152,10 @@ impl f32 {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn asinh(self) -> f32 {
match self {
NEG_INFINITY => NEG_INFINITY,
x => (x + ((x * x) + 1.0).sqrt()).ln(),
if self == NEG_INFINITY {
NEG_INFINITY
} else {
(self + ((self * self) + 1.0).sqrt()).ln()
}
}

View File

@ -1023,9 +1023,10 @@ impl f64 {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn asinh(self) -> f64 {
match self {
NEG_INFINITY => NEG_INFINITY,
x => (x + ((x * x) + 1.0).sqrt()).ln(),
if self == NEG_INFINITY {
NEG_INFINITY
} else {
(self + ((self * self) + 1.0).sqrt()).ln()
}
}

View File

@ -24,9 +24,17 @@ fn main() { //~ ERROR compilation successful
_ => {},
};
//~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
//~| WARNING floating point constants cannot be used
//~| WARNING this was previously accepted
//~| WARNING floating point constants cannot be used
//~| WARNING this was previously accepted
match [x, 1.0] {
[NAN, _] => {},
_ => {},
};
//~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
//~| WARNING floating point constants cannot be used
//~| WARNING this was previously accepted
//~| WARNING floating point constants cannot be used
//~| WARNING this was previously accepted
}

View File

@ -21,15 +21,18 @@
const CONSTANT: u64 = 3;
#[derive(PartialEq, Eq)]
struct Struct {
a: isize,
b: usize,
}
const STRUCT: Struct = Struct { a: 1, b: 2 };
#[derive(PartialEq, Eq)]
struct TupleStruct(u32);
const TUPLE_STRUCT: TupleStruct = TupleStruct(4);
#[derive(PartialEq, Eq)]
enum Enum {
Variant1(char),
Variant2 { a: u8 },

View File

@ -17,6 +17,7 @@ use empty_struct::XEmpty2 as XFoo;
struct Foo;
#[derive(PartialEq, Eq)]
enum Bar {
Var1,
Var2,

View File

@ -18,7 +18,10 @@ use empty_struct::*;
struct Empty1 {}
struct Empty2;
#[derive(PartialEq, Eq)]
struct Empty3 {}
const Empty3: Empty3 = Empty3 {};
enum E {

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(collections)]
extern crate collections;

View File

@ -9,18 +9,24 @@
// except according to those terms.
#[derive(PartialEq, Eq)]
struct NewBool(bool);
#[derive(PartialEq, Eq)]
enum Direction {
North,
East,
South,
West
}
#[derive(PartialEq, Eq)]
struct Foo {
bar: Option<Direction>,
baz: NewBool
}
#[derive(PartialEq, Eq)]
enum EnumWithStructVariants {
Variant1(bool),
Variant2 {
@ -37,7 +43,7 @@ const VARIANT2_NORTH: EnumWithStructVariants = EnumWithStructVariants::Variant2
dir: Direction::North };
pub mod glfw {
#[derive(Copy, Clone)]
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct InputState(usize);
pub const RELEASE : InputState = InputState(0);
@ -82,6 +88,7 @@ fn issue_14576() {
_ => unreachable!()
}
#[derive(PartialEq, Eq)]
enum C { D = 3, E = 4 }
const F : C = C::D;
@ -89,6 +96,7 @@ fn issue_14576() {
}
fn issue_13731() {
#[derive(PartialEq, Eq)]
enum A { AA(()) }
const B: A = A::AA(());
@ -99,6 +107,7 @@ fn issue_13731() {
fn issue_15393() {
#![allow(dead_code)]
#[derive(PartialEq, Eq)]
struct Flags {
bits: usize
}