]> git.lizzy.rs Git - rust.git/commitdiff
use u128::MAX symbolic name
authorRalf Jung <post@ralfj.de>
Sat, 18 Apr 2020 08:11:45 +0000 (10:11 +0200)
committerRalf Jung <post@ralfj.de>
Sat, 18 Apr 2020 08:11:45 +0000 (10:11 +0200)
tests/compile-fail/intrinsics/float_to_int_64_too_big4.rs

index d5b24347b94194210b55db3aecac4a8abd7a95af..e9623dba947f393b52063129c5b823bc525704ff 100644 (file)
@@ -6,5 +6,5 @@
 }
 
 fn main() {
-    unsafe { float_to_int_unchecked::<f64, u128>(340282366920938463463374607431768211455.0f64); } //~ ERROR: cannot be represented in target type `u128`
+    unsafe { float_to_int_unchecked::<f64, u128>(u128::MAX as f64); } //~ ERROR: cannot be represented in target type `u128`
 }