Skip to content

Commit 2139fbd

Browse files
committed
Auto merge of #3783 - Enet4:patch-1, r=Manishearth
Update why transmute_int_to_float is bad As suggested in #3550, this PR changes the reason why using `transmute` from an integer to a float is not recommended. Effectively, `from_bits` uses `transmute` underneath, but the former is preferred.
2 parents 1620e92 + 8994466 commit 2139fbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_lints/src/transmute.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ declare_clippy_lint! {
159159

160160
/// **What it does:** Checks for transmutes from an integer to a float.
161161
///
162-
/// **Why is this bad?** This might result in an invalid in-memory representation of a float.
162+
/// **Why is this bad?** Transmutes are dangerous and error-prone, whereas `from_bits` is intuitive
163+
/// and safe.
163164
///
164165
/// **Known problems:** None.
165166
///

0 commit comments

Comments
 (0)