--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, i32>(f32::INFINITY); } //~ ERROR: cannot be represented in target type `i32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, i32>(f32::NEG_INFINITY); } //~ ERROR: cannot be represented in target type `i32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, u32>(f32::NAN); } //~ ERROR: cannot be represented in target type `u32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, u32>(-f32::NAN); } //~ ERROR: cannot be represented in target type `u32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, u32>(-1.000000001f32); } //~ ERROR: cannot be represented in target type `u32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, i32>(2147483648.0f32); } //~ ERROR: cannot be represented in target type `i32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, u32>((u32::MAX-127) as f32); } //~ ERROR: cannot be represented in target type `u32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f32, i32>(-2147483904.0f32); } //~ ERROR: cannot be represented in target type `i32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, u128>(f64::INFINITY); } //~ ERROR: cannot be represented in target type `u128`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, u128>(f64::NEG_INFINITY); } //~ ERROR: cannot be represented in target type `u128`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, i128>(f64::NEG_INFINITY); } //~ ERROR: cannot be represented in target type `i128`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, u32>(f64::NAN); } //~ ERROR: cannot be represented in target type `u32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, u128>(-1.0000000000001f64); } //~ ERROR: cannot be represented in target type `u128`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, i32>(2147483648.0f64); } //~ ERROR: cannot be represented in target type `i32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, i64>(9223372036854775808.0f64); } //~ ERROR: cannot be represented in target type `i64`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, u64>(18446744073709551616.0f64); } //~ ERROR: cannot be represented in target type `u64`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, u128>(340282366920938463463374607431768211455.0f64); } //~ ERROR: cannot be represented in target type `u128`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, i128>(240282366920938463463374607431768211455.0f64); } //~ ERROR: cannot be represented in target type `i128`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, i32>(-2147483649.0f64); } //~ ERROR: cannot be represented in target type `i32`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, i64>(-9223372036854777856.0f64); } //~ ERROR: cannot be represented in target type `i64`
+}
--- /dev/null
+#![feature(intrinsics)]
+
+// Directly call intrinsic to avoid debug assertions in libstd
+extern "rust-intrinsic" {
+ fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
+}
+
+fn main() {
+ unsafe { float_to_int_unchecked::<f64, i128>(-240282366920938463463374607431768211455.0f64); } //~ ERROR: cannot be represented in target type `i128`
+}