Re: [PATCH 02/12] rust: num: reject Bounded::shr overshifts at build time
"Alexandre Courbot" <[email protected]>
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.rust,gmane.comp.video.dri.devel,gmane.linux.documentation |
|---|---|
| Message-ID | <[email protected]> |
On Wed Aug 5, 2026 at 2:44 PM JST, Eliot Courtney wrote: > Make `shr` reject shifts of at least the type's bit width at build > time, instead of panicking or masking the shift amount at runtime. > > Signed-off-by: Eliot Courtney <[email protected]> Indeed it looks like this would panic with the kernel build, and can be easily caught at build-time since `SHIFT` is a constant. Acked-by: Alexandre Courbot <[email protected]>