From 5a49fe76df89a0e46583bd524b252744084ea083 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Tue, 26 Nov 2019 16:43:17 -0800 Subject: [PATCH] Turn a few more assert!s that should never fire into debug_assert!s. These are here to protect against errors when refactoring more than anything else. --- lib/llvm-backend/src/code.rs | 4 ++-- lib/llvm-backend/src/state.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/llvm-backend/src/code.rs b/lib/llvm-backend/src/code.rs index d60ec5aea95..c3da185bef1 100644 --- a/lib/llvm-backend/src/code.rs +++ b/lib/llvm-backend/src/code.rs @@ -1764,11 +1764,11 @@ impl FunctionCodeGenerator for LLVMFunctionCodeGenerator { let info = { let mut info = i1.strip_pending() & i2.strip_pending(); if i1.has_pending_f32_nan() { - assert!(i2.has_pending_f32_nan()); + debug_assert!(i2.has_pending_f32_nan()); info |= ExtraInfo::pending_f32_nan(); } if i1.has_pending_f64_nan() { - assert!(i2.has_pending_f64_nan()); + debug_assert!(i2.has_pending_f64_nan()); info |= ExtraInfo::pending_f64_nan(); } info diff --git a/lib/llvm-backend/src/state.rs b/lib/llvm-backend/src/state.rs index b13b3c358ec..4b374f1da11 100644 --- a/lib/llvm-backend/src/state.rs +++ b/lib/llvm-backend/src/state.rs @@ -163,12 +163,12 @@ impl BitAnd for ExtraInfo { type Output = Self; fn bitand(self, other: Self) -> Self { // Pending canonicalizations are not safe to discard, or even reorder. - assert!( + debug_assert!( self.has_pending_f32_nan() == other.has_pending_f32_nan() || self.is_arithmetic_f32() || other.is_arithmetic_f32() ); - assert!( + debug_assert!( self.has_pending_f64_nan() == other.has_pending_f64_nan() || self.is_arithmetic_f64() || other.is_arithmetic_f64()