Closed
Description
Currently overlong bit shifts are undefined behavior because that's how llvm rolls--#10183. But even when they aren't, we should warn on something like x << 24
where x
happens to be u8
, since it's a useless operation that couldn't possibly return anything interesting.
There's a motivating example and I imagine it'd be a common gotcha since other languages tend to read unadorned integral literals as 32bit int
s and then promote the x
in x << 24
before doing the actual shift.