The compiler produces a tight loop, optimizing away the negative shift check.
It would be nice if the bounds check could be eliminated too, but that does not seem to be quite as straightforward to prove.
What did you see instead?
There is a runtime check to see if bits.TrailingZeros64 is negative.
The text was updated successfully, but these errors were encountered: