about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-02-18 20:05:54 +0000
committerbors <bors@rust-lang.org>2019-02-18 20:05:54 +0000
commit2139fbdbe13dd97f44526b0834a8745c5319a8bd (patch)
tree18e56573af2e733d46cc6f190846f1c30838c82b
parent1620e92dd6a59b9663a7085d28134f0201f94596 (diff)
parent8994466bfe8152f4b48aebda5324c57d7b370f10 (diff)
downloadrust-2139fbdbe13dd97f44526b0834a8745c5319a8bd.tar.gz
rust-2139fbdbe13dd97f44526b0834a8745c5319a8bd.zip
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.
-rw-r--r--clippy_lints/src/transmute.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/clippy_lints/src/transmute.rs b/clippy_lints/src/transmute.rs
index 56e1aa4a4e1..f39dc6f9b68 100644
--- a/clippy_lints/src/transmute.rs
+++ b/clippy_lints/src/transmute.rs
@@ -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.
 ///