Description
Location
https://doc.rust-lang.org/stable/std/hint/fn.black_box.html
Summary
The documentation of black_box
states:
Programs cannot rely on black_box for correctness in any way.
but this is not accurate since programs can rely on it behaving like the identity function.
It would be better to reword this as
Programs cannot rely on black_box for correctness beyond it behaving as the identity function.
or similar, e.g.,
Programs cannot rely on the optimisation-inhibiting effects of black_box for correctness.