rust/library/core
bors 897ef3a0ec Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
Get rid of bounds check in slice::chunks_exact() and related function…

…s during construction

LLVM can't figure out in

    let rem = self.len() % chunk_size;
    let len = self.len() - rem;
    let (fst, snd) = self.split_at(len);

and

    let rem = self.len() % chunk_size;
    let (fst, snd) = self.split_at(rem);

that the index passed to split_at() is smaller than the slice length and
adds a bounds check plus panic for it.

Apart from removing the overhead of the bounds check this also allows
LLVM to optimize code around the ChunksExact iterator better.
2020-08-31 15:55:13 +00:00
..
benches mv std libs to library/ 2020-07-27 19:51:13 -05:00
src Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa 2020-08-31 15:55:13 +00:00
tests Stabilize Range[Inclusive]::is_empty 2020-08-24 13:20:25 -07:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00