@@ -173,17 +173,18 @@ fn pow_call_result_sign(cx: &LateContext<'_>, base: &Expr<'_>, exponent: &Expr<'
173
173
174
174
match ( base_sign, exponent_is_even) {
175
175
// Non-negative bases always return non-negative results, ignoring overflow.
176
- ( Sign :: ZeroOrPositive , _) => Sign :: ZeroOrPositive ,
177
-
176
+ ( Sign :: ZeroOrPositive , _) |
178
177
// 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 ,
181
181
182
182
// A negative base raised to an odd exponent is non-negative.
183
183
( Sign :: Negative , Some ( false ) ) => Sign :: Negative ,
184
184
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 ) |
187
188
( Sign :: Uncertain , Some ( false ) ) => Sign :: Uncertain ,
188
189
}
189
190
}
0 commit comments