Why does `0usize`.reverse_bits() produce `0`?

Shouldn't it produce 0xffffffffffffffff?

:man_facepalming:
It's reversing the direction of bits, not inverting bits...

It's not flipping the bits but reversing it, i.e. from LSB to MSB. I think you mean flip bits?

Use ! if you actually want to flip the bits, e.g. !0.

Reverse bits, not bytes

Reverse bits swaps the bit order of the value, end to end. The OP seems to want "invert bits", not "reverse bits".