diff options
| author | Ralf Jung <post@ralfj.de> | 2023-09-30 08:15:34 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-01-26 17:23:36 +0100 |
| commit | cda358857214bb5a2b3df4f011102ffee3843a72 (patch) | |
| tree | 94228c3e908821d7d4a9fe1fea70ba2d75c7c2de /compiler/rustc_middle/src/mir/interpret | |
| parent | 69db514ed9238bb11f5d2c576fe26020e3b99a52 (diff) | |
| download | rust-cda358857214bb5a2b3df4f011102ffee3843a72.tar.gz rust-cda358857214bb5a2b3df4f011102ffee3843a72.zip | |
make matching on NaN a hard error
Diffstat (limited to 'compiler/rustc_middle/src/mir/interpret')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/value.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/value.rs b/compiler/rustc_middle/src/mir/interpret/value.rs index 5ecff04f3ae..e937c17c8ac 100644 --- a/compiler/rustc_middle/src/mir/interpret/value.rs +++ b/compiler/rustc_middle/src/mir/interpret/value.rs @@ -418,8 +418,8 @@ impl<'tcx, Prov: Provenance> Scalar<Prov> { #[inline] pub fn to_float<F: Float>(self) -> InterpResult<'tcx, F> { - // Going through `to_uint` to check size and truncation. - Ok(F::from_bits(self.to_uint(Size::from_bits(F::BITS))?)) + // Going through `to_bits` to check size and truncation. + Ok(F::from_bits(self.to_bits(Size::from_bits(F::BITS))?)) } #[inline] |
