about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-04-17 01:51:04 +0800
committerkennytm <kennytm@gmail.com>2018-04-17 03:34:33 +0800
commit87cd53e63f4677d5bf4a542162449bc278b0aaa0 (patch)
tree9cf04c22f935c6adba30d13d7b678203ba12427c
parent34ee31d6f2b7d7003ef8f623cd2c0b1fc1e010bb (diff)
parentcbabb1be329b80f012223b230384cba8134820f6 (diff)
downloadrust-87cd53e63f4677d5bf4a542162449bc278b0aaa0.tar.gz
rust-87cd53e63f4677d5bf4a542162449bc278b0aaa0.zip
Rollup merge of #49965 - nikic:fix-49622, r=rkruppe
Remove warning about f64->f32 cast being potential UB

As discussed in #15536, the LLVM documentation incorrect described overflowing f64->f32 casts as being undefined behavior. LLVM never treated them as such, and the documentation has been adjusted in https://reviews.llvm.org/rL329065. As such, this warning can now be removed.

Closes #49622.

---

I could not find any existing test checking for this warning. Should I be adding a test for the absence of the warning instead?
-rw-r--r--src/librustc_typeck/check/demand.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs
index ecfe1416050..c0d6993c7d4 100644
--- a/src/librustc_typeck/check/demand.rs
+++ b/src/librustc_typeck/check/demand.rs
@@ -502,10 +502,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
                                             &format!("{}, producing the closest possible value",
                                                      msg),
                                             cast_suggestion);
-                        err.warn("casting here will cause undefined behavior if the value is \
-                                  finite but larger or smaller than the largest or smallest \
-                                  finite value representable by `f32` (this is a bug and will be \
-                                  fixed)");
                     }
                     true
                 }