@@ -173,17 +173,18 @@ fn pow_call_result_sign(cx: &LateContext<'_>, base: &Expr<'_>, exponent: &Expr<'
173173
174174 match ( base_sign, exponent_is_even) {
175175 // Non-negative bases always return non-negative results, ignoring overflow.
176- ( Sign :: ZeroOrPositive , _) => Sign :: ZeroOrPositive ,
177-
176+ ( Sign :: ZeroOrPositive , _) |
178177 // Any base raised to an even exponent is non-negative.
179- // This is true even if we don't know the value of the base.
180- ( _, Some ( true ) ) => Sign :: ZeroOrPositive ,
178+ // These both hold even if we don't know the value of the base.
179+ ( _, Some ( true ) )
180+ => Sign :: ZeroOrPositive ,
181181
182182 // A negative base raised to an odd exponent is non-negative.
183183 ( Sign :: Negative , Some ( false ) ) => Sign :: Negative ,
184184
185- // Negative or unknown base to an unknown exponent, or an unknown base to an odd exponent.
186- ( Sign :: Negative | Sign :: Uncertain , None ) => Sign :: Uncertain ,
185+ // Negative/unknown base to an unknown exponent, or unknown base to an odd exponent.
186+ // Could be negative or positive depending on the actual values.
187+ ( Sign :: Negative | Sign :: Uncertain , None ) |
187188 ( Sign :: Uncertain , Some ( false ) ) => Sign :: Uncertain ,
188189 }
189190}
0 commit comments