by jimmytucson · 11mo ago · 0 comments
let val = arr[i]
to assembly code like: cmp rdx, rsi ; Compare i (rdx) with length (rsi)
jae .Lpanic_label ; Jump if i >= length
; later...
.Lpanic_label:
call core::panicking::panic_bounds_check
Are they saying with "correct code" the line of source code won't be covered? Because the assembly instruction to call panic isn't ever reached?It might be reasonable to redefine their metric as "100% branch coverage except for panics"...if you can reliably determine that `jae .Lpanic_label` is a panic jump. It's obvious to us reading your example of course but I don't know that the compiler guarantees panics always "look like that", and only panics look like that.