Skip to content

Commit

Permalink
Auto merge of #3783 - Enet4:patch-1, r=Manishearth
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Feb 18, 2019
2 parents 1620e92 + 8994466 commit 2139fbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clippy_lints/src/transmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ declare_clippy_lint! {

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

0 comments on commit 2139fbd

Please sign in to comment.