We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09928a9 commit c8bf5edCopy full SHA for c8bf5ed
library/core/tests/num/const_from.rs
@@ -7,6 +7,10 @@ fn from() {
7
const FROM: i64 = i64::from(1i32);
8
assert_eq!(FROM, 1i64);
9
10
+ // From int to float
11
+ const FROM_F64: f64 = f64::from(42u8);
12
+ assert_eq!(FROM_F64, 42f64);
13
+
14
// Upper bounded
15
const U8_FROM_U16: Result<u8, TryFromIntError> = u8::try_from(1u16);
16
assert_eq!(U8_FROM_U16, Ok(1u8));
0 commit comments