-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
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 ints and then promote the x in x << 24 before doing the actual shift.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.