Skip to content

Commit 9806e6e

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 + 74ac35b commit 9806e6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/transmute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ 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 and safe.
163163
///
164164
/// **Known problems:** None.
165165
///

0 commit comments

Comments
 (0)