Skip to content

Commit

Permalink
Rollup merge of rust-lang#49965 - nikic:fix-49622, r=rkruppe
Browse files Browse the repository at this point in the history
Remove warning about f64->f32 cast being potential UB

As discussed in rust-lang#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 rust-lang#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?
  • Loading branch information
kennytm committed Apr 16, 2018
2 parents 34ee31d + cbabb1b commit 87cd53e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/librustc_typeck/check/demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 87cd53e

Please sign in to comment.