mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-13 15:33:53 +00:00
![Krishna Veera Reddy](/assets/img/avatar_default.png)
`transmute.stderr` file line count exceeded due to the new test cases so moving the new test cases into a separate file.
13 lines
406 B
Rust
13 lines
406 B
Rust
#[warn(clippy::transmute_float_to_int)]
|
|
|
|
fn float_to_int() {
|
|
let _: u32 = unsafe { std::mem::transmute(1f32) };
|
|
let _: i32 = unsafe { std::mem::transmute(1f32) };
|
|
let _: u64 = unsafe { std::mem::transmute(1f64) };
|
|
let _: i64 = unsafe { std::mem::transmute(1f64) };
|
|
let _: u64 = unsafe { std::mem::transmute(1.0) };
|
|
let _: u64 = unsafe { std::mem::transmute(-1.0) };
|
|
}
|
|
|
|
fn main() {}
|