driftsort implementation uses an out-of-range literal on 16-bit targets #129910
Closed
Description
opened on Sep 2, 2024
Run
cargo +nightly miri setup --target avr-unknown-gnu-atmega328
Or
x check library/core --target avr-unknown-gnu-atmega328
And you'll get this diagnostic (cargo miri setup makes it a warning, lol):
error: literal out of range for `usize`
--> core/src/slice/sort/stable/mod.rs:62:41
|
62 | const MAX_FULL_ALLOC_BYTES: usize = 8_000_000; // 8MB
| ^^^^^^^^^
|
= note: the literal `8_000_000` does not fit into the type `usize` whose range is `0..=65535`
= note: `#[deny(overflowing_literals)]` on by default
I don't know what effect this has at runtime but it can't be good.
Activity