]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/src/docs/transmute_float_to_int.txt
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / transmute_float_to_int.txt
CommitLineData
f2b60f7d
FG
1### What it does
2Checks for transmutes from a float to an integer.
3
4### Why is this bad?
5Transmutes are dangerous and error-prone, whereas `to_bits` is intuitive
6and safe.
7
8### Example
9```
10unsafe {
11 let _: u32 = std::mem::transmute(1f32);
12}
13
14// should be:
15let _: u32 = 1f32.to_bits();
16```